Documentation
¶
Overview ¶
Raw CGo bindings for Android sensor
Index ¶
- Constants
- func ASensorEventQueue_disableSensor(queue *ASensorEventQueue, sensor *ASensor) int32
- func ASensorEventQueue_enableSensor(queue *ASensorEventQueue, sensor *ASensor) int32
- func ASensorEventQueue_getEvents(queue *ASensorEventQueue, events *ASensorEvent, count uint64) int64
- func ASensorEventQueue_hasEvents(queue *ASensorEventQueue) int32
- func ASensorEventQueue_registerSensor(queue *ASensorEventQueue, sensor *ASensor, samplingPeriodUs int32, ...) int32
- func ASensorEventQueue_requestAdditionalInfoEvents(queue *ASensorEventQueue, enable bool) int32
- func ASensorEventQueue_setEventRate(queue *ASensorEventQueue, sensor *ASensor, usec int32) int32
- func ASensorManager_configureDirectReport(manager *ASensorManager, sensor *ASensor, channelId int32, rate int32) int32
- func ASensorManager_createHardwareBufferDirectChannel(manager *ASensorManager, buffer *AHardwareBuffer, size uint64) int32
- func ASensorManager_createSharedMemoryDirectChannel(manager *ASensorManager, fd int32, size uint64) int32
- func ASensorManager_destroyDirectChannel(manager *ASensorManager, channelId int32)
- func ASensorManager_destroyEventQueue(manager *ASensorManager, queue *ASensorEventQueue) int32
- func ASensorManager_getDynamicSensorList(manager *ASensorManager, list *ASensorList) int64
- func ASensorManager_getSensorList(manager *ASensorManager, list *ASensorList) int32
- func ASensor_getFifoMaxEventCount(sensor *ASensor) int32
- func ASensor_getFifoReservedEventCount(sensor *ASensor) int32
- func ASensor_getHandle(sensor *ASensor) int32
- func ASensor_getHighestDirectReportRateLevel(sensor *ASensor) int32
- func ASensor_getMinDelay(sensor *ASensor) int32
- func ASensor_getName(sensor *ASensor) string
- func ASensor_getReportingMode(sensor *ASensor) int32
- func ASensor_getResolution(sensor *ASensor) float32
- func ASensor_getStringType(sensor *ASensor) string
- func ASensor_getType(sensor *ASensor) int32
- func ASensor_getVendor(sensor *ASensor) string
- func ASensor_isDirectChannelTypeSupported(sensor *ASensor, channelType int32) bool
- func ASensor_isWakeUpSensor(sensor *ASensor) bool
- type AAdditionalInfoEvent
- type ADynamicSensorEvent
- type AHardwareBuffer
- type AHeadTrackerEvent
- type AHeadingEvent
- type AHeartRateEvent
- type ALimitedAxesImuEvent
- type ALimitedAxesImuUncalibratedEvent
- type ALooper
- type ALooper_callbackFunc
- type AMetaDataEvent
- type ASensor
- type ASensorEvent
- type ASensorEventQueue
- type ASensorList
- type ASensorManager
- type ASensorRef
- type ASensorVector
- type AUncalibratedEvent
- type CgoAllocMap
- type SliceHeader
Constants ¶
View Source
const ( AREPORTING_MODE_INVALID = -1 AREPORTING_MODE_CONTINUOUS = 0 AREPORTING_MODE_ON_CHANGE = 1 AREPORTING_MODE_ONE_SHOT = 2 AREPORTING_MODE_SPECIAL_TRIGGER = 3 )
View Source
const ( ASENSOR_ADDITIONAL_INFO_BEGIN = 0 ASENSOR_ADDITIONAL_INFO_END = 1 ASENSOR_ADDITIONAL_INFO_UNTRACKED_DELAY = 65536 ASENSOR_ADDITIONAL_INFO_INTERNAL_TEMPERATURE = 65537 ASENSOR_ADDITIONAL_INFO_VEC3_CALIBRATION = 65538 ASENSOR_ADDITIONAL_INFO_SENSOR_PLACEMENT = 65539 ASENSOR_ADDITIONAL_INFO_SAMPLING = 65540 )
View Source
const ( ASENSOR_DIRECT_CHANNEL_TYPE_SHARED_MEMORY = 1 ASENSOR_DIRECT_CHANNEL_TYPE_HARDWARE_BUFFER = 2 )
View Source
const ( ASENSOR_DIRECT_RATE_STOP = 0 ASENSOR_DIRECT_RATE_NORMAL = 1 ASENSOR_DIRECT_RATE_FAST = 2 ASENSOR_DIRECT_RATE_VERY_FAST = 3 )
View Source
const ( ASENSOR_STATUS_NO_CONTACT = -1 ASENSOR_STATUS_UNRELIABLE = 0 ASENSOR_STATUS_ACCURACY_LOW = 1 ASENSOR_STATUS_ACCURACY_MEDIUM = 2 ASENSOR_STATUS_ACCURACY_HIGH = 3 )
View Source
const ( ASENSOR_TYPE_INVALID = -1 ASENSOR_TYPE_ACCELEROMETER = 1 ASENSOR_TYPE_MAGNETIC_FIELD = 2 ASENSOR_TYPE_GYROSCOPE = 4 ASENSOR_TYPE_LIGHT = 5 ASENSOR_TYPE_PRESSURE = 6 ASENSOR_TYPE_PROXIMITY = 8 ASENSOR_TYPE_GRAVITY = 9 ASENSOR_TYPE_LINEAR_ACCELERATION = 10 ASENSOR_TYPE_ROTATION_VECTOR = 11 ASENSOR_TYPE_RELATIVE_HUMIDITY = 12 ASENSOR_TYPE_AMBIENT_TEMPERATURE = 13 ASENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED = 14 ASENSOR_TYPE_GAME_ROTATION_VECTOR = 15 ASENSOR_TYPE_GYROSCOPE_UNCALIBRATED = 16 ASENSOR_TYPE_SIGNIFICANT_MOTION = 17 ASENSOR_TYPE_STEP_DETECTOR = 18 ASENSOR_TYPE_STEP_COUNTER = 19 ASENSOR_TYPE_GEOMAGNETIC_ROTATION_VECTOR = 20 ASENSOR_TYPE_HEART_RATE = 21 ASENSOR_TYPE_POSE_6DOF = 28 ASENSOR_TYPE_STATIONARY_DETECT = 29 ASENSOR_TYPE_MOTION_DETECT = 30 ASENSOR_TYPE_HEART_BEAT = 31 ASENSOR_TYPE_DYNAMIC_SENSOR_META = 32 ASENSOR_TYPE_ADDITIONAL_INFO = 33 ASENSOR_TYPE_LOW_LATENCY_OFFBODY_DETECT = 34 ASENSOR_TYPE_ACCELEROMETER_UNCALIBRATED = 35 ASENSOR_TYPE_HINGE_ANGLE = 36 ASENSOR_TYPE_HEAD_TRACKER = 37 ASENSOR_TYPE_ACCELEROMETER_LIMITED_AXES = 38 ASENSOR_TYPE_GYROSCOPE_LIMITED_AXES = 39 ASENSOR_TYPE_ACCELEROMETER_LIMITED_AXES_UNCALIBRATED = 40 ASENSOR_TYPE_GYROSCOPE_LIMITED_AXES_UNCALIBRATED = 41 ASENSOR_TYPE_HEADING = 42 )
Variables ¶
This section is empty.
Functions ¶
func ASensorEventQueue_disableSensor ¶
func ASensorEventQueue_disableSensor(queue *ASensorEventQueue, sensor *ASensor) int32
func ASensorEventQueue_enableSensor ¶
func ASensorEventQueue_enableSensor(queue *ASensorEventQueue, sensor *ASensor) int32
func ASensorEventQueue_getEvents ¶
func ASensorEventQueue_getEvents(queue *ASensorEventQueue, events *ASensorEvent, count uint64) int64
func ASensorEventQueue_hasEvents ¶
func ASensorEventQueue_hasEvents(queue *ASensorEventQueue) int32
func ASensorEventQueue_registerSensor ¶
func ASensorEventQueue_registerSensor(queue *ASensorEventQueue, sensor *ASensor, samplingPeriodUs int32, maxBatchReportLatencyUs int64) int32
func ASensorEventQueue_requestAdditionalInfoEvents ¶
func ASensorEventQueue_requestAdditionalInfoEvents(queue *ASensorEventQueue, enable bool) int32
func ASensorEventQueue_setEventRate ¶
func ASensorEventQueue_setEventRate(queue *ASensorEventQueue, sensor *ASensor, usec int32) int32
func ASensorManager_configureDirectReport ¶
func ASensorManager_configureDirectReport(manager *ASensorManager, sensor *ASensor, channelId int32, rate int32) int32
func ASensorManager_createHardwareBufferDirectChannel ¶
func ASensorManager_createHardwareBufferDirectChannel(manager *ASensorManager, buffer *AHardwareBuffer, size uint64) int32
func ASensorManager_createSharedMemoryDirectChannel ¶
func ASensorManager_createSharedMemoryDirectChannel(manager *ASensorManager, fd int32, size uint64) int32
func ASensorManager_destroyDirectChannel ¶
func ASensorManager_destroyDirectChannel(manager *ASensorManager, channelId int32)
func ASensorManager_destroyEventQueue ¶
func ASensorManager_destroyEventQueue(manager *ASensorManager, queue *ASensorEventQueue) int32
func ASensorManager_getDynamicSensorList ¶
func ASensorManager_getDynamicSensorList(manager *ASensorManager, list *ASensorList) int64
func ASensorManager_getSensorList ¶
func ASensorManager_getSensorList(manager *ASensorManager, list *ASensorList) int32
func ASensor_getHandle ¶
func ASensor_getMinDelay ¶
func ASensor_getName ¶
func ASensor_getResolution ¶
func ASensor_getStringType ¶
func ASensor_getType ¶
func ASensor_getVendor ¶
func ASensor_isWakeUpSensor ¶
Types ¶
type AAdditionalInfoEvent ¶
type AAdditionalInfoEvent C.AAdditionalInfoEvent
type ADynamicSensorEvent ¶
type ADynamicSensorEvent C.ADynamicSensorEvent
type AHardwareBuffer ¶
type AHardwareBuffer C.AHardwareBuffer
type AHeadTrackerEvent ¶
type AHeadTrackerEvent C.AHeadTrackerEvent
type AHeadingEvent ¶
type AHeadingEvent C.AHeadingEvent
type AHeartRateEvent ¶
type AHeartRateEvent C.AHeartRateEvent
type ALimitedAxesImuEvent ¶
type ALimitedAxesImuEvent C.ALimitedAxesImuEvent
type ALimitedAxesImuUncalibratedEvent ¶
type ALimitedAxesImuUncalibratedEvent C.ALimitedAxesImuUncalibratedEvent
type ALooper_callbackFunc ¶
type ALooper_callbackFunc C.ALooper_callbackFunc
type AMetaDataEvent ¶
type AMetaDataEvent C.AMetaDataEvent
type ASensor ¶
func ASensorManager_getDefaultSensor ¶
func ASensorManager_getDefaultSensor(manager *ASensorManager, _type int32) *ASensor
func ASensorManager_getDefaultSensorEx ¶
func ASensorManager_getDefaultSensorEx(manager *ASensorManager, _type int32, wakeUp bool) *ASensor
type ASensorEvent ¶
type ASensorEvent C.ASensorEvent
type ASensorEventQueue ¶
type ASensorEventQueue C.ASensorEventQueue
func ASensorManager_createEventQueue ¶
func ASensorManager_createEventQueue(manager *ASensorManager, looper *ALooper, ident int32, callback ALooper_callbackFunc, data unsafe.Pointer) *ASensorEventQueue
type ASensorList ¶
type ASensorList C.ASensorList
type ASensorManager ¶
type ASensorManager C.ASensorManager
func ASensorManager_getInstance ¶
func ASensorManager_getInstance() *ASensorManager
func ASensorManager_getInstanceForPackage ¶
func ASensorManager_getInstanceForPackage(packageName string) *ASensorManager
type ASensorRef ¶
type ASensorRef C.ASensorRef
type ASensorVector ¶
type ASensorVector C.ASensorVector
type AUncalibratedEvent ¶
type AUncalibratedEvent C.AUncalibratedEvent
type CgoAllocMap ¶
type CgoAllocMap struct {
// contains filtered or unexported fields
}
CgoAllocMap stores pointers to C allocated memory for future reference.
func UnpackPCharString ¶
func UnpackPCharString(str string) (*C.char, *CgoAllocMap)
UnpackPCharString copies the data from Go string as *C.char.
func (*CgoAllocMap) Add ¶
func (a *CgoAllocMap) Add(ptr unsafe.Pointer)
func (*CgoAllocMap) Borrow ¶
func (a *CgoAllocMap) Borrow(b *CgoAllocMap)
func (*CgoAllocMap) Free ¶
func (a *CgoAllocMap) Free()
func (*CgoAllocMap) IsEmpty ¶
func (a *CgoAllocMap) IsEmpty() bool
Click to show internal directories.
Click to hide internal directories.