Documentation
¶
Overview ¶
Package sensor provides Go bindings for Android Sensor NDK.
Index ¶
- type ALooper
- type ALooper_callbackFunc
- type ASensorList
- type ASensorRef
- type AdditionalInfoEvent
- type DynamicSensorEvent
- type Error
- type EventQueue
- func (h *EventQueue) DisableSensor(sensor *Sensor) error
- func (h *EventQueue) EnableSensor(sensor *Sensor) error
- func (h *EventQueue) GetEvents(events *SensorEvent, count uint64) int64
- func (h *EventQueue) HasEvents() int32
- func (h *EventQueue) Pointer() unsafe.Pointer
- func (h *EventQueue) RegisterSensor(sensor *Sensor, samplingPeriodUs int32, maxBatchReportLatencyUs int64) error
- func (h *EventQueue) RequestAdditionalInfoEvents(enable bool) error
- func (h *EventQueue) SetEventRate(sensor *Sensor, usec int32) error
- type HardwareBuffer
- type HeadTrackerEvent
- type HeadingEvent
- type HeartRateEvent
- type LimitedAxesImuEvent
- type LimitedAxesImuUncalibratedEvent
- type Manager
- func (h *Manager) ConfigureDirectReport(sensor *Sensor, channelID int32, rate int32) error
- func (h *Manager) CreateEventQueue(looper *ALooper, ident int32, callback ALooper_callbackFunc, ...) *EventQueue
- func (h *Manager) CreateHardwareBufferDirectChannel(buffer *HardwareBuffer, size uint64) error
- func (h *Manager) CreateSharedMemoryDirectChannel(fd int32, size uint64) error
- func (h *Manager) DefaultSensor(_type Type) *Sensor
- func (h *Manager) DestroyDirectChannel(channelID int32)
- func (h *Manager) DestroyEventQueue(queue *EventQueue) error
- func (h *Manager) GetDefaultSensorEx(_type Type, wakeUp bool) *Sensor
- func (h *Manager) GetDynamicSensorList(list *ASensorList) int64
- func (h *Manager) Pointer() unsafe.Pointer
- type MetaDataEvent
- type REPORTING_MODE
- type SENSOR_ADDITIONAL_INFO
- type SENSOR_DIRECT_CHANNEL_TYPE
- type SENSOR_DIRECT_RATE
- type Sensor
- func (h *Sensor) GetFifoMaxEventCount() error
- func (h *Sensor) GetFifoReservedEventCount() error
- func (h *Sensor) GetHandle() error
- func (h *Sensor) GetHighestDirectReportRateLevel() error
- func (h *Sensor) GetReportingMode() error
- func (h *Sensor) GetStringType() string
- func (h *Sensor) IsDirectChannelTypeSupported(channelType int32) bool
- func (h *Sensor) IsWakeUpSensor() bool
- func (h *Sensor) MinDelay() int32
- func (h *Sensor) Name() string
- func (h *Sensor) Pointer() unsafe.Pointer
- func (h *Sensor) Resolution() float32
- func (h *Sensor) Type() int32
- func (h *Sensor) Vendor() string
- type SensorEvent
- type SensorVector
- type Status
- type Type
- type UncalibratedEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ALooper_callbackFunc ¶
type ALooper_callbackFunc = capi.ALooper_callbackFunc
type ASensorList ¶
type ASensorList = capi.ASensorList
type ASensorRef ¶
type ASensorRef = capi.ASensorRef
type AdditionalInfoEvent ¶
type AdditionalInfoEvent struct {
// contains filtered or unexported fields
}
AdditionalInfoEvent wraps the NDK AAdditionalInfoEvent handle.
func NewAdditionalInfoEventFromPointer ¶
func NewAdditionalInfoEventFromPointer(ptr unsafe.Pointer) *AdditionalInfoEvent
NewAdditionalInfoEventFromPointer wraps a raw AAdditionalInfoEvent pointer.
func (*AdditionalInfoEvent) Pointer ¶
func (h *AdditionalInfoEvent) Pointer() unsafe.Pointer
Pointer returns the underlying pointer as unsafe.Pointer.
type DynamicSensorEvent ¶
type DynamicSensorEvent struct {
// contains filtered or unexported fields
}
DynamicSensorEvent wraps the NDK ADynamicSensorEvent handle.
func NewDynamicSensorEventFromPointer ¶
func NewDynamicSensorEventFromPointer(ptr unsafe.Pointer) *DynamicSensorEvent
NewDynamicSensorEventFromPointer wraps a raw ADynamicSensorEvent pointer.
func (*DynamicSensorEvent) Pointer ¶
func (h *DynamicSensorEvent) Pointer() unsafe.Pointer
Pointer returns the underlying pointer as unsafe.Pointer.
type EventQueue ¶
type EventQueue struct {
// contains filtered or unexported fields
}
EventQueue wraps the NDK ASensorEventQueue handle.
func NewEventQueueFromPointer ¶
func NewEventQueueFromPointer(ptr unsafe.Pointer) *EventQueue
NewEventQueueFromPointer wraps a raw ASensorEventQueue pointer.
func (*EventQueue) DisableSensor ¶
func (h *EventQueue) DisableSensor(sensor *Sensor) error
DisableSensor calls the underlying NDK function.
func (*EventQueue) EnableSensor ¶
func (h *EventQueue) EnableSensor(sensor *Sensor) error
EnableSensor calls the underlying NDK function.
func (*EventQueue) GetEvents ¶
func (h *EventQueue) GetEvents(events *SensorEvent, count uint64) int64
GetEvents returns the value directly.
func (*EventQueue) HasEvents ¶
func (h *EventQueue) HasEvents() int32
HasEvents returns the value directly.
func (*EventQueue) Pointer ¶
func (h *EventQueue) Pointer() unsafe.Pointer
Pointer returns the underlying pointer as unsafe.Pointer.
func (*EventQueue) RegisterSensor ¶
func (h *EventQueue) RegisterSensor(sensor *Sensor, samplingPeriodUs int32, maxBatchReportLatencyUs int64) error
RegisterSensor calls the underlying NDK function.
func (*EventQueue) RequestAdditionalInfoEvents ¶
func (h *EventQueue) RequestAdditionalInfoEvents(enable bool) error
RequestAdditionalInfoEvents calls the underlying NDK function.
func (*EventQueue) SetEventRate ¶
func (h *EventQueue) SetEventRate(sensor *Sensor, usec int32) error
SetEventRate calls the underlying NDK function.
type HardwareBuffer ¶
type HardwareBuffer struct {
// contains filtered or unexported fields
}
HardwareBuffer wraps the NDK AHardwareBuffer handle.
func NewHardwareBufferFromPointer ¶
func NewHardwareBufferFromPointer(ptr unsafe.Pointer) *HardwareBuffer
NewHardwareBufferFromPointer wraps a raw AHardwareBuffer pointer.
func (*HardwareBuffer) Pointer ¶
func (h *HardwareBuffer) Pointer() unsafe.Pointer
Pointer returns the underlying pointer as unsafe.Pointer.
type HeadTrackerEvent ¶
type HeadTrackerEvent struct {
// contains filtered or unexported fields
}
HeadTrackerEvent wraps the NDK AHeadTrackerEvent handle.
func NewHeadTrackerEventFromPointer ¶
func NewHeadTrackerEventFromPointer(ptr unsafe.Pointer) *HeadTrackerEvent
NewHeadTrackerEventFromPointer wraps a raw AHeadTrackerEvent pointer.
func (*HeadTrackerEvent) Pointer ¶
func (h *HeadTrackerEvent) Pointer() unsafe.Pointer
Pointer returns the underlying pointer as unsafe.Pointer.
type HeadingEvent ¶
type HeadingEvent struct {
// contains filtered or unexported fields
}
HeadingEvent wraps the NDK AHeadingEvent handle.
func NewHeadingEventFromPointer ¶
func NewHeadingEventFromPointer(ptr unsafe.Pointer) *HeadingEvent
NewHeadingEventFromPointer wraps a raw AHeadingEvent pointer.
func (*HeadingEvent) Pointer ¶
func (h *HeadingEvent) Pointer() unsafe.Pointer
Pointer returns the underlying pointer as unsafe.Pointer.
type HeartRateEvent ¶
type HeartRateEvent struct {
// contains filtered or unexported fields
}
HeartRateEvent wraps the NDK AHeartRateEvent handle.
func NewHeartRateEventFromPointer ¶
func NewHeartRateEventFromPointer(ptr unsafe.Pointer) *HeartRateEvent
NewHeartRateEventFromPointer wraps a raw AHeartRateEvent pointer.
func (*HeartRateEvent) Pointer ¶
func (h *HeartRateEvent) Pointer() unsafe.Pointer
Pointer returns the underlying pointer as unsafe.Pointer.
type LimitedAxesImuEvent ¶
type LimitedAxesImuEvent struct {
// contains filtered or unexported fields
}
LimitedAxesImuEvent wraps the NDK ALimitedAxesImuEvent handle.
func NewLimitedAxesImuEventFromPointer ¶
func NewLimitedAxesImuEventFromPointer(ptr unsafe.Pointer) *LimitedAxesImuEvent
NewLimitedAxesImuEventFromPointer wraps a raw ALimitedAxesImuEvent pointer.
func (*LimitedAxesImuEvent) Pointer ¶
func (h *LimitedAxesImuEvent) Pointer() unsafe.Pointer
Pointer returns the underlying pointer as unsafe.Pointer.
type LimitedAxesImuUncalibratedEvent ¶
type LimitedAxesImuUncalibratedEvent struct {
// contains filtered or unexported fields
}
LimitedAxesImuUncalibratedEvent wraps the NDK ALimitedAxesImuUncalibratedEvent handle.
func NewLimitedAxesImuUncalibratedEventFromPointer ¶
func NewLimitedAxesImuUncalibratedEventFromPointer(ptr unsafe.Pointer) *LimitedAxesImuUncalibratedEvent
NewLimitedAxesImuUncalibratedEventFromPointer wraps a raw ALimitedAxesImuUncalibratedEvent pointer.
func (*LimitedAxesImuUncalibratedEvent) Pointer ¶
func (h *LimitedAxesImuUncalibratedEvent) Pointer() unsafe.Pointer
Pointer returns the underlying pointer as unsafe.Pointer.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager wraps the NDK ASensorManager handle.
func ASensorManager_getInstanceForPackage ¶
ASensorManager_getInstanceForPackage calls the underlying C function.
func NewManagerFromPointer ¶
NewManagerFromPointer wraps a raw ASensorManager pointer.
func (*Manager) ConfigureDirectReport ¶
ConfigureDirectReport calls the underlying NDK function.
func (*Manager) CreateEventQueue ¶
func (h *Manager) CreateEventQueue(looper *ALooper, ident int32, callback ALooper_callbackFunc, data unsafe.Pointer) *EventQueue
CreateEventQueue creates a new EventQueue from this Manager.
func (*Manager) CreateHardwareBufferDirectChannel ¶
func (h *Manager) CreateHardwareBufferDirectChannel(buffer *HardwareBuffer, size uint64) error
CreateHardwareBufferDirectChannel calls the underlying NDK function.
func (*Manager) CreateSharedMemoryDirectChannel ¶
CreateSharedMemoryDirectChannel calls the underlying NDK function.
func (*Manager) DefaultSensor ¶
DefaultSensor creates a new Sensor from this Manager.
func (*Manager) DestroyDirectChannel ¶
DestroyDirectChannel calls the underlying NDK function.
func (*Manager) DestroyEventQueue ¶
func (h *Manager) DestroyEventQueue(queue *EventQueue) error
DestroyEventQueue calls the underlying NDK function.
func (*Manager) GetDefaultSensorEx ¶
GetDefaultSensorEx creates a new Sensor from this Manager.
func (*Manager) GetDynamicSensorList ¶
func (h *Manager) GetDynamicSensorList(list *ASensorList) int64
GetDynamicSensorList returns the value directly.
type MetaDataEvent ¶
type MetaDataEvent struct {
// contains filtered or unexported fields
}
MetaDataEvent wraps the NDK AMetaDataEvent handle.
func NewMetaDataEventFromPointer ¶
func NewMetaDataEventFromPointer(ptr unsafe.Pointer) *MetaDataEvent
NewMetaDataEventFromPointer wraps a raw AMetaDataEvent pointer.
func (*MetaDataEvent) Pointer ¶
func (h *MetaDataEvent) Pointer() unsafe.Pointer
Pointer returns the underlying pointer as unsafe.Pointer.
type REPORTING_MODE ¶
type REPORTING_MODE int32
const ( AREPORTING_MODE_INVALID REPORTING_MODE = -1 AREPORTING_MODE_CONTINUOUS REPORTING_MODE = 0 AREPORTING_MODE_ON_CHANGE REPORTING_MODE = 1 AREPORTING_MODE_ONE_SHOT REPORTING_MODE = 2 AREPORTING_MODE_SPECIAL_TRIGGER REPORTING_MODE = 3 )
type SENSOR_ADDITIONAL_INFO ¶
type SENSOR_ADDITIONAL_INFO int32
const ( ASENSOR_ADDITIONAL_INFO_BEGIN SENSOR_ADDITIONAL_INFO = 0 ASENSOR_ADDITIONAL_INFO_END SENSOR_ADDITIONAL_INFO = 1 ASENSOR_ADDITIONAL_INFO_UNTRACKED_DELAY SENSOR_ADDITIONAL_INFO = 65536 ASENSOR_ADDITIONAL_INFO_INTERNAL_TEMPERATURE SENSOR_ADDITIONAL_INFO = 65537 ASENSOR_ADDITIONAL_INFO_VEC3_CALIBRATION SENSOR_ADDITIONAL_INFO = 65538 ASENSOR_ADDITIONAL_INFO_SENSOR_PLACEMENT SENSOR_ADDITIONAL_INFO = 65539 ASENSOR_ADDITIONAL_INFO_SAMPLING SENSOR_ADDITIONAL_INFO = 65540 )
type SENSOR_DIRECT_CHANNEL_TYPE ¶
type SENSOR_DIRECT_CHANNEL_TYPE int32
const ( ASENSOR_DIRECT_CHANNEL_TYPE_SHARED_MEMORY SENSOR_DIRECT_CHANNEL_TYPE = 1 ASENSOR_DIRECT_CHANNEL_TYPE_HARDWARE_BUFFER SENSOR_DIRECT_CHANNEL_TYPE = 2 )
type SENSOR_DIRECT_RATE ¶
type SENSOR_DIRECT_RATE int32
const ( ASENSOR_DIRECT_RATE_STOP SENSOR_DIRECT_RATE = 0 ASENSOR_DIRECT_RATE_NORMAL SENSOR_DIRECT_RATE = 1 ASENSOR_DIRECT_RATE_FAST SENSOR_DIRECT_RATE = 2 ASENSOR_DIRECT_RATE_VERY_FAST SENSOR_DIRECT_RATE = 3 )
type Sensor ¶
type Sensor struct {
// contains filtered or unexported fields
}
Sensor wraps the NDK ASensor handle.
func NewSensorFromPointer ¶
NewSensorFromPointer wraps a raw ASensor pointer.
func (*Sensor) GetFifoMaxEventCount ¶
GetFifoMaxEventCount calls the underlying NDK function.
func (*Sensor) GetFifoReservedEventCount ¶
GetFifoReservedEventCount calls the underlying NDK function.
func (*Sensor) GetHighestDirectReportRateLevel ¶
GetHighestDirectReportRateLevel calls the underlying NDK function.
func (*Sensor) GetReportingMode ¶
GetReportingMode calls the underlying NDK function.
func (*Sensor) GetStringType ¶
GetStringType returns the value directly.
func (*Sensor) IsDirectChannelTypeSupported ¶
IsDirectChannelTypeSupported returns the value directly.
func (*Sensor) IsWakeUpSensor ¶
IsWakeUpSensor returns the value directly.
func (*Sensor) Resolution ¶
Resolution returns the value directly.
type SensorEvent ¶
type SensorEvent struct {
// contains filtered or unexported fields
}
SensorEvent wraps the NDK ASensorEvent handle.
func NewSensorEventFromPointer ¶
func NewSensorEventFromPointer(ptr unsafe.Pointer) *SensorEvent
NewSensorEventFromPointer wraps a raw ASensorEvent pointer.
func (*SensorEvent) Pointer ¶
func (h *SensorEvent) Pointer() unsafe.Pointer
Pointer returns the underlying pointer as unsafe.Pointer.
type SensorVector ¶
type SensorVector struct {
// contains filtered or unexported fields
}
SensorVector wraps the NDK ASensorVector handle.
func NewSensorVectorFromPointer ¶
func NewSensorVectorFromPointer(ptr unsafe.Pointer) *SensorVector
NewSensorVectorFromPointer wraps a raw ASensorVector pointer.
func (*SensorVector) Pointer ¶
func (h *SensorVector) Pointer() unsafe.Pointer
Pointer returns the underlying pointer as unsafe.Pointer.
type Type ¶
type Type int32
const ( Invalid Type = -1 Accelerometer Type = 1 MagneticField Type = 2 Gyroscope Type = 4 Light Type = 5 Pressure Type = 6 Proximity Type = 8 Gravity Type = 9 LinearAcceleration Type = 10 RotationVector Type = 11 RelativeHumidity Type = 12 AmbientTemperature Type = 13 MagneticFieldUncalibrated Type = 14 GameRotationVector Type = 15 GyroscopeUncalibrated Type = 16 SignificantMotion Type = 17 StepDetector Type = 18 StepCounter Type = 19 GeomagneticRotationVector Type = 20 HeartRate Type = 21 Pose6dof Type = 28 StationaryDetect Type = 29 MotionDetect Type = 30 HeartBeat Type = 31 DynamicSensorMeta Type = 32 AdditionalInfo Type = 33 LowLatencyOffbodyDetect Type = 34 AccelerometerUncalibrated Type = 35 HingeAngle Type = 36 HeadTracker Type = 37 AccelerometerLimitedAxes Type = 38 GyroscopeLimitedAxes Type = 39 AccelerometerLimitedAxesUncalibrated Type = 40 GyroscopeLimitedAxesUncalibrated Type = 41 Heading Type = 42 )
type UncalibratedEvent ¶
type UncalibratedEvent struct {
// contains filtered or unexported fields
}
UncalibratedEvent wraps the NDK AUncalibratedEvent handle.
func NewUncalibratedEventFromPointer ¶
func NewUncalibratedEventFromPointer(ptr unsafe.Pointer) *UncalibratedEvent
NewUncalibratedEventFromPointer wraps a raw AUncalibratedEvent pointer.
func (*UncalibratedEvent) Pointer ¶
func (h *UncalibratedEvent) Pointer() unsafe.Pointer
Pointer returns the underlying pointer as unsafe.Pointer.
Source Files
¶
- additional_info_event.go
- alooper.go
- alooper_callback_func.go
- asensor_list.go
- asensor_ref.go
- dynamic_sensor_event.go
- errors.go
- event_queue.go
- functions.go
- hardware_buffer.go
- head_tracker_event.go
- heading_event.go
- heart_rate_event.go
- limited_axes_imu_event.go
- limited_axes_imu_uncalibrated_event.go
- manager.go
- meta_data_event.go
- package.go
- reporting_mode.go
- sensor.go
- sensor_additional_info.go
- sensor_direct_channel_type.go
- sensor_direct_rate.go
- sensor_event.go
- sensor_vector.go
- status.go
- type.go
- uncalibrated_event.go