PebbleOS v4.48.0-75-g7416f78a1
Loading...
Searching...
No Matches
pbl_sensing_client Struct Reference

A client of a sensor. More...

#include <sensing.h>

Data Fields

const struct pbl_sensor * sensor
 Sensor.
 
enum pbl_sensor_type type
 Type of the frames to read.
 
uint32_t scale
 Multiplier of the SI unit the frames are read in, a power of ten up to 10^9.
 
uint32_t frequency_mhz
 Sampling frequency in millihertz, 0 for no frames.
 
uint16_t batch
 Frames per update at frequency_mhz, bounding how long frames may queue in the sensor.
 
uint8_t events
 Events wanted, a bit per enum pbl_sensor_event_type.
 
bool(* notify )(struct pbl_sensing_client *client)
 Optional.
 
void(* event )(struct pbl_sensing_client *client, const struct pbl_sensor_event *event)
 Optional.
 
void * user_data
 Free for the client's use.
 

Detailed Description

A client of a sensor.

Field Documentation

◆ batch

uint16_t pbl_sensing_client::batch

Frames per update at frequency_mhz, bounding how long frames may queue in the sensor.

0 discards the frames, while the sensor still samples at frequency_mhz. Change with pbl_sensing_client_set_batch().

◆ event

void(* pbl_sensing_client::event) (struct pbl_sensing_client *client, const struct pbl_sensor_event *event)

Optional.

Called on each wanted event, in the device frame.

◆ events

uint8_t pbl_sensing_client::events

Events wanted, a bit per enum pbl_sensor_event_type.

Change with pbl_sensing_client_set_events().

◆ frequency_mhz

uint32_t pbl_sensing_client::frequency_mhz

Sampling frequency in millihertz, 0 for no frames.

Change with pbl_sensing_client_set_frequency().

◆ notify

bool(* pbl_sensing_client::notify) (struct pbl_sensing_client *client)

Optional.

Called when the armed number of frames are waiting, with the client disarmed. Returns true if the frames were handed over, false to stay armed and be called again on the next batch.

◆ scale

uint32_t pbl_sensing_client::scale

Multiplier of the SI unit the frames are read in, a power of ten up to 10^9.

◆ sensor

const struct pbl_sensor* pbl_sensing_client::sensor

Sensor.

◆ type

enum pbl_sensor_type pbl_sensing_client::type

Type of the frames to read.

◆ user_data

void* pbl_sensing_client::user_data

Free for the client's use.


The documentation for this struct was generated from the following file: