Developer World
Spresense SDK Library v3.2.0-ebc0364
Sensor Manager API

Classes

struct  sensor_command_header_t
 Sensor Commnad Header. All sensor command has this header. More...
 
struct  sensor_command_data_t
 The command of send some sensor data without MemHandle to the sensor manager. More...
 
struct  sensor_command_data_mh_t
 The command of send some sensor data with MemHandle to the sensor manager. This function only can call on C++. More...
 
struct  sensor_command_register_t
 The command of resister a sensor. More...
 
struct  sensor_command_release_t
 The command of release the sensor. More...
 
struct  sensor_command_change_subscription_t
 The command of change subscription of client. More...
 
struct  sensor_command_result_t
 The command of release the sensor. More...
 
struct  sensor_command_power_t
 The command of setting sleep mode to sensor. More...
 

Typedefs

typedef bool(* sensor_data_callback_t) (sensor_command_data_t &)
 A function pointer for sensor data (without mem handle) callback.
 
typedef bool(* sensor_data_mh_callback_t) (sensor_command_data_mh_t &)
 A function pointer for sensor data with MemHandle callback.
 
typedef bool(* sensor_power_callback_t) (bool)
 A function pointer for power control callback.
 
typedef void(* api_response_callback_t) (unsigned int code, unsigned int ercd, unsigned int self_id)
 A function pointer for API response callback.
 

Enumerations

enum  SensorCommandCode {
  ResisterClient = 0 , ReleaseClient , ChangeSubscription , SetPower ,
  ClearPower , SendData , SendDataMH , SendResult ,
  SensorCommandMum
}
 Sensor Command Code for each sensors. More...
 

Functions

bool SS_ActivateSensorSubSystem (MsgQueId selfMId, api_response_callback_t callback)
 Activation function for sensor manager. Before using a sensor manager, it is necessary to call this API. More...
 
bool SS_DeactivateSensorSubSystem ()
 Deativation function for sensor manager. More...
 
void SS_SendSensorData (FAR sensor_command_data_t *packet)
 Sender function to Sensor Manager without MemHandle. Send data is publish to own subscriber. More...
 
void SS_SendSensorResult (FAR sensor_command_result_t *packet)
 Sender function to Sensor Manager without MemHandle. Send result data is publish to own subscriber. More...
 
void SS_SendSensorResister (FAR sensor_command_register_t *packet)
 Resister a sensor client to Sensor Manager as subscriber. Registed sensor can recieve a "publish data" from required sensors. When data is published, a registed callback function will be called. More...
 
void SS_SendSensorSetPower (FAR sensor_command_power_t *packet)
 When sensor power mode are controlled, this function can set. (If you enable CONFIG_SENSING_MANAGER_POWERCTRL.) More...
 
void SS_SendSensorClearPower (FAR sensor_command_power_t *packet)
 
void SS_SendSensorRelease (FAR sensor_command_release_t *packet)
 Unresister the sensor client from Sensor Manager. More...
 
void SS_SendSensorChangeSubscription (FAR sensor_command_change_subscription_t *packet)
 Change subscriptions of sensor client. More...
 
void SS_SendSensorDataMH (FAR sensor_command_data_mh_t *packet)
 Sender function to Sensor Manager with MemHandle Send data is publish to own subscriber. More...
 

Detailed Description

Enumeration Type Documentation

◆ SensorCommandCode

Sensor Command Code for each sensors.

Enumerator
ResisterClient 

Resister sensor client

ReleaseClient 

Reales sensor client

ChangeSubscription 

Change subscriptions

SetPower 

Set power mode

ClearPower 

Clear power mode

SendData 

Sensing Data send

SendDataMH 

Sensing Data send

SendResult 

Logical sensing result send

SensorCommandMum 

Number of sensor commands

Function Documentation

◆ SS_ActivateSensorSubSystem()

bool SS_ActivateSensorSubSystem ( MsgQueId  selfMId,
api_response_callback_t  callback 
)

Activation function for sensor manager. Before using a sensor manager, it is necessary to call this API.

Returns
true: success

◆ SS_DeactivateSensorSubSystem()

bool SS_DeactivateSensorSubSystem ( )

Deativation function for sensor manager.

Returns
sucess true

◆ SS_SendSensorData()

void SS_SendSensorData ( FAR sensor_command_data_t packet)

Sender function to Sensor Manager without MemHandle. Send data is publish to own subscriber.

Note
This API send address of publish data.
Parameters
[in]packet
Returns
void

◆ SS_SendSensorResult()

void SS_SendSensorResult ( FAR sensor_command_result_t packet)

Sender function to Sensor Manager without MemHandle. Send result data is publish to own subscriber.

Note
This API send result data of sensor process.
Parameters
[in]packet
Returns
void

◆ SS_SendSensorResister()

void SS_SendSensorResister ( FAR sensor_command_register_t packet)

Resister a sensor client to Sensor Manager as subscriber. Registed sensor can recieve a "publish data" from required sensors. When data is published, a registed callback function will be called.

Note
If there is not required sensor, then error occurs.
Parameters
[in]packet
Returns
void

◆ SS_SendSensorSetPower()

void SS_SendSensorSetPower ( FAR sensor_command_power_t packet)

When sensor power mode are controlled, this function can set. (If you enable CONFIG_SENSING_MANAGER_POWERCTRL.)

Parameters
[in]packet
Returns
void

◆ SS_SendSensorRelease()

void SS_SendSensorRelease ( FAR sensor_command_release_t packet)

Unresister the sensor client from Sensor Manager.

Note
If any sensors sbsribing own, then error occurs.
Parameters
[in]packet
Returns
void

◆ SS_SendSensorChangeSubscription()

void SS_SendSensorChangeSubscription ( FAR sensor_command_change_subscription_t packet)

Change subscriptions of sensor client.

Note
Only change subscription. Effective to registered sensors.
Parameters
[in]packet
Returns
void

◆ SS_SendSensorDataMH()

void SS_SendSensorDataMH ( FAR sensor_command_data_mh_t packet)

Sender function to Sensor Manager with MemHandle Send data is publish to own subscriber.

Note
This API send MemHandle of publish data.
Parameters
[in]packet
Returns
void