29#ifndef __SENSORCLIENT_H
30#define __SENSORCLIENT_H
43#include <sdk/config.h>
44#include <nuttx/init.h>
45#include <nuttx/arch.h>
46#include <asmp/mpshm.h>
48#include <pins_arduino.h>
50#include <sensing/sensor_api.h>
51#include <sensing/sensor_id.h>
52#include <sensing/sensor_ecode.h>
54#include <MemoryUtil.h>
63#define SENSORCLIENT_ECODE_OK 0x0
67#define SENSORCLIENT_ECODE_ACTIVATE_MANAGER_ERROR 0x1
71#define SENSORCLIENT_ECODE_DEACTIVATE_MANAGER_ERROR 0x2
75#define SENSORCLIENT_ECODE_SENSOR_CLIENT_ID_ERROR 0x3
79#define SENSORCLIENT_ECODE_MEMORY_ALLOCATE_ERROR 0x4
112 NumOfGeneralSensorClientID,
121 SEN_selfID = SensorClientID00,
122 SEN_accelID = SensorClientID01,
123 SEN_accel1ID = SensorClientID02,
124 SEN_magID = SensorClientID03,
125 SEN_pressureID = SensorClientID04,
126 SEN_lightID = SensorClientID05,
127 SEN_pulseID = SensorClientID06,
128 SEN_tempID = SensorClientID07,
129 SEN_gyroID = SensorClientID08,
130 SEN_gnssID = SensorClientID09,
131 SEN_stepcounterID = SensorClientID10,
132 SEN_tramID = SensorClientID11,
133 SEN_gestureID = SensorClientID12,
134 SEN_compassID = SensorClientID13,
135 SEN_barometerID = SensorClientID14,
136 SEN_tramliteID = SensorClientID15,
137 SEN_vadID = SensorClientID16,
138 SEN_wuwsrID = SensorClientID17,
139 SEN_adcID = SensorClientID18,
140 SEN_reserve19ID = SensorClientID19,
141 SEN_app0ID = SensorClientID20,
142 SEN_app1ID = SensorClientID21,
143 SEN_app2ID = SensorClientID22,
144 SEN_app3ID = SensorClientID23,
145 SEN_ID_MAX = NumOfGeneralSensorClientID,
151#define SUBSCRIPTION(x) (1 << (x))
168 uint32_t subscriptions = 0,
170 int sample_watermark_num = 0,
171 int size_per_sample = 0,
172 sensor_data_mh_callback_t cb =NULL);
175 uint32_t subscriptions,
176 sensor_data_mh_callback_t cb);
195 uint32_t size_per_sample,
197 uint32_t sample_watermark_num,
207 MemMgrLite::MemHandle& mh,
208 uint32_t size_per_sample,
210 uint32_t sample_watermark_num,
214 uint32_t size_per_sample,
216 uint32_t sample_watermark_num,
227 return data.mh.getVa();
233 int m_sample_watermark_num;
234 int m_size_per_sample;
Definition: SensorClient.h:160
bool end(void)
Release sensor ID.
void * subscribe(sensor_command_data_mh_t &data)
Read sensing data from buffer.
Definition: SensorClient.h:225
int publish(PoolId id, FAR void *data, uint32_t size_per_sample, uint32_t freq, uint32_t sample_watermark_num, uint32_t timestamp)
Write sensing data from buffer.
int publish(MemMgrLite::MemHandle &mh, uint32_t size_per_sample, uint32_t freq, uint32_t sample_watermark_num, uint32_t timestamp)
Write sensing data from MemHandle.
bool begin(int id, uint32_t subscriptions=0, int rate=0, int sample_watermark_num=0, int size_per_sample=0, sensor_data_mh_callback_t cb=NULL)
Register sensor ID.
GeneralSensorClientID
Definition: SensorClient.h:87