sensor_devctl_queue_u

Structure for enabling or disabling sensor event queuing.

Synopsis:

typedef union {
    sensor_devctl_enable_tx_t tx;
    struct {
        unsigned int size;
    } rx;
} sensor_devctl_queue_u;

Since:

BlackBerry 10.0.0

Data:

int size
The number of events to queue.

Library:

None.

Description:

The union sensor__devctl__queue__u is used with the DCMD_SENSOR_QUEUE device command to enable/disable sensor event queuing. Sensor services queues only one event by default. If a new event comes in before the client reads the last event, the previous event is overwritten. When event queuing is enabled, up to X events will be queued by the system. Client can set their read buffers up to X * sizeof(sensor_event_t) to be able to read all events queued.

Example usage:
sensor_devctl_queue_u sensorQue;
sensorQue.tx.enable = 1;  // 1 = enable, 0 = disable
result = devctl(fd, DCMD_SENSOR_QUEUE, &sensorQue, sizeof(sensorQue),
                NULL);
                
where:

sensorQue.rx.size is the number of events that will be queued.

result is EOK for success (or see errno return code descriptions).

Last modified: 2014-05-14



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus