10#include "dawn/io/common.hxx"
11#include "dawn/porting/config.hxx"
12#include "dawn/proto/nimble/adv.hxx"
32 constexpr static uint32_t
UUID_AIOS[4] = {0x18150010, 0x7474754e, 0x694e2058, 0x454c426d};
78 constexpr static uint32_t
UUID_ESS[4] = {0x181a0010, 0x7474754e, 0x694e2058, 0x454c426d};
89 constexpr static uint32_t
UUID_IMDS[4] = {0x185a0010, 0x7474754e, 0x694e2058, 0x454c426d};
101 constexpr static uint32_t
UUID_BSS[4] = {0x183b0010, 0x7474754e, 0x694e2058, 0x454c426d};
113 constexpr static uint32_t
UUID_DIGITAL[4] = {0x2a560010, 0x7474754e, 0x694e2058, 0x454c426d};
125 constexpr static uint32_t
UUID_ANALOG[4] = {0x2a580010, 0x7474754e, 0x694e2058, 0x454c426d};
137 constexpr static uint32_t
UUID_AGGREGATE[4] = {0x2a5a0010, 0x7474754e, 0x694e2058, 0x454c426d};
149 constexpr static uint32_t
UUID_TEMP[4] = {0x2a6e0010, 0x7474754e, 0x694e2058, 0x454c426d};
162 constexpr static uint32_t
UUID_ACCEL[4] = {0x2c060010, 0x7474754e, 0x694e2058, 0x454c426d};
174 constexpr static uint32_t
UUID_HUM[4] = {0x2a6f0010, 0x7474754e, 0x694e2058, 0x454c426d};
186 constexpr static uint32_t
UUID_PRESS[4] = {0x2a6d0010, 0x7474754e, 0x694e2058, 0x454c426d};
197 constexpr static uint32_t
UUID_UVIDX[4] = {0x2a760010, 0x7474754e, 0x694e2058, 0x454c426d};
209 constexpr static uint32_t
UUID_TWINDSPEED[4] = {0x2a700010, 0x7474754e, 0x694e2058, 0x454c426d};
221 constexpr static uint32_t
UUID_TWINDDIR[4] = {0x2a710010, 0x7474754e, 0x694e2058, 0x454c426d};
233 constexpr static uint32_t
UUID_VOLTAGE[4] = {0x2b180010, 0x7474754e, 0x694e2058, 0x454c426d};
245 constexpr static uint32_t
UUID_VOLTAGEFREQ[4] = {0x2be80010, 0x7474754e, 0x694e2058, 0x454c426d};
257 constexpr static uint32_t
UUID_VOLTAGESPEC[4] = {0x2b190010, 0x7474754e, 0x694e2058, 0x454c426d};
269 constexpr static uint32_t
UUID_VOLTAGESTAT[4] = {0x2b1a0010, 0x7474754e, 0x694e2058, 0x454c426d};
281 constexpr static uint32_t
UUID_CURRENT[4] = {0x2aee0010, 0x7474754e, 0x694e2058, 0x454c426d};
293 constexpr static uint32_t
UUID_CURRENTRANGE[4] = {0x2aef0010, 0x7474754e, 0x694e2058, 0x454c426d};
304 constexpr static uint32_t
UUID_CURRENTSPEC[4] = {0x2af00010, 0x7474754e, 0x694e2058, 0x454c426d};
316 constexpr static uint32_t
UUID_CURRENTSTATS[4] = {0x2af10010, 0x7474754e, 0x694e2058, 0x454c426d};
328 constexpr static uint32_t
UUID_ILLUMINANCE[4] = {0x2afb0010, 0x7474754e, 0x694e2058, 0x454c426d};
342 constexpr static uint32_t
UUID_RESISTANCE[4] = {0x272a0010, 0x7474754e, 0x694e2058, 0x454c426d};
354 constexpr static std::pair<uint16_t, float>
charScale[] = {
496 DAWNASSERT(desc_ !=
nullptr,
"NULL pointer");
497 DAWNASSERT(cb_ !=
nullptr,
"NULL pointer");
557 std::vector<SObjectId::ObjectId>
vio;
Base class for all I/O objects.
Interface for BLE peripheral services with GATT characteristics.
static uint16_t UUID16_UVIDX
16-bit UUID for UV Index characteristic.
virtual int startService(int id)=0
Start a specific service.
static uint16_t UUID16_VOLTAGESTAT
16-bit UUID for Voltage Statistics characteristic.
static uint32_t UUID_UVIDX[4]
UV Index Characteristic UUID (0x2A76).
static uint32_t UUID_CURRENTSPEC[4]
Electric Current Specification Characteristic UUID (0x2AF0).
static uint32_t UUID_TWINDDIR[4]
True Wind Direction Characteristic UUID (0x2A71).
static uint32_t UUID_VOLTAGE[4]
Voltage Characteristic UUID (0x2B18).
static uint32_t UUID_ESS[4]
Environmental Sensing Service UUID (0x181A).
static uint16_t UUID16_AGGREGATE
16-bit UUID for Aggregate characteristic.
static uint32_t UUID_BSS[4]
Binary Sensor Service UUID (0x183B).
static uint16_t UUID16_VOLTAGE
16-bit UUID for Voltage characteristic.
static uint32_t UUID_CURRENTSTATS[4]
Electric Current Statistics Characteristic UUID (0x2AF1).
virtual size_t getObjectsLen()=0
Get count of registered I/O objects.
static float charScaleGet(uint16_t u)
Get scaling factor for a characteristic UUID.
static size_t charScaleSize
Number of characteristic scaling entries.
static uint32_t UUID_INPUT_TRIGGER_SET[4]
AIOS Input Trigger Set characteristic (0x2A57).
static uint32_t UUID_ACCEL[4]
Acceleration Characteristic UUID (0x2C06).
static uint32_t UUID_CURRENTRANGE[4]
Electric Current Range Characteristic UUID (0x2AEF).
static uint16_t UUID16_HUM
16-bit UUID for Humidity characteristic.
static uint32_t UUID_ANALOG[4]
Analog Characteristic UUID (0x2A58).
static uint16_t UUID16_CURRENTRANGE
16-bit UUID for Electric Current Range characteristic.
static uint32_t UUID_OUTPUT_TRIGGER_SET[4]
AIOS Output Trigger Set characteristic (0x2A5C).
static uint16_t UUID16_TWINDSPEED
16-bit UUID for True Wind Speed characteristic.
static uint16_t UUID16_IMDS
16-bit Bluetooth SIG UUID for IMDS.
virtual CIOCommon * getObject(SObjectId::ObjectId id)=0
Get protocol object by ID.
static uint16_t UUID16_ANALOG
16-bit UUID for Analog characteristic.
static uint32_t UUID_PRESS[4]
Pressure Characteristic UUID (0x2A6D).
static uint16_t UUID16_CURRENT
16-bit UUID for Electric Current characteristic.
static uint32_t UUID_CURRENT[4]
Electric Current Characteristic UUID (0x2AEE).
static uint32_t UUID_VOLTAGESTAT[4]
Voltage Statistics Characteristic UUID (0x2B1A).
static std::pair< uint16_t, float > charScale[]
Scaling factors for GATT characteristics.
static uint16_t UUID16_BSS
16-bit Bluetooth SIG UUID for BSS.
static uint32_t UUID_TEMP[4]
Temperature Characteristic UUID (0x2A6E).
static uint32_t UUID_DIGITAL[4]
Digital Characteristic UUID (0x2A56).
static uint32_t UUID_TWINDSPEED[4]
True Wind Speed Characteristic UUID (0x2A70).
static uint32_t UUID_VOLTAGEFREQ[4]
Voltage Frequency Characteristic UUID (0x2BE8).
static uint32_t UUID_ILLUMINANCE[4]
Illuminance Characteristic UUID (0x2AFB).
static uint16_t UUID16_TEMP
16-bit UUID for Temperature characteristic.
static uint32_t UUID_AGGREGATE[4]
Aggregate Characteristic UUID (0x2A5A).
static uint16_t UUID16_ILLUMINANCE
16-bit UUID for Illuminance characteristic.
static uint32_t UUID_RESISTANCE[4]
Electric Resistance Characteristic UUID (0x272A).
virtual int serviceRegister(struct ble_gatt_svc_def *svc)=0
Register a GATT service with the peripheral.
static uint16_t UUID16_RESISTANCE
16-bit UUID for Electric Resistance characteristic.
static uint16_t UUID16_DIGITAL
16-bit UUID for Digital characteristic.
static uint16_t UUID16_ACCEL
16-bit UUID for Acceleration characteristic.
virtual void regObject(SObjectId::ObjectId id)=0
Register an I/O object for this service.
static uint32_t UUID_VOLTAGESPEC[4]
Voltage Specification Characteristic UUID (0x2B19).
static uint32_t UUID_IMDS[4]
Industrial Measurement Device Service UUID (0x185A).
static uint16_t UUID16_CURRENTSTATS
16-bit UUID for Electric Current Statistics characteristic.
static uint16_t UUID16_ESS
16-bit Bluetooth SIG UUID for ESS.
static uint16_t UUID16_CURRENTSPEC
16-bit UUID for Electric Current Specification characteristic.
static uint32_t UUID_TIME_TRIGGER_SET[4]
AIOS Time Trigger Set characteristic (0x2A3F).
static uint32_t UUID_HUM[4]
Humidity Characteristic UUID (0x2A6F).
static uint16_t UUID16_VOLTAGESPEC
16-bit UUID for Voltage Specification characteristic.
virtual int stopService(int id)=0
Stop a specific service.
static uint16_t UUID16_TWINDDIR
16-bit UUID for True Wind Direction characteristic.
static uint16_t UUID16_VOLTAGEFREQ
16-bit UUID for Voltage Frequency characteristic.
static uint16_t UUID16_AIOS
16-bit Bluetooth SIG UUID for AIOS.
static uint32_t UUID_AIOS[4]
Automation I/O Service UUID (0x1815).
static uint16_t UUID16_PRESS
16-bit UUID for Pressure characteristic.
Base interface for GATT services exposed by BLE peripheral.
virtual int deinit()=0
Deinitialize service.
std::vector< SObjectId::ObjectId > vio
Vector of I/O objects exposed by this service.
const SObjectCfg::SObjectCfgItem * desc
Configuration descriptor for this service.
virtual int start()=0
Start service.
virtual int init()=0
Initialize service.
IProtoNimblePrphCb * cb
Callback interface to peripheral.
virtual ~IProtoNimblePrphService()
Virtual destructor.
IProtoNimblePrphService(const SObjectCfg::SObjectCfgItem *desc_, IProtoNimblePrphCb *cb_)
Constructor.
virtual int stop()=0
Stop service.
Out-of-tree user-extension hooks for Dawn.
Context data for characteristic notification callbacks.
io_ddata_t * data
GATT attribute handle for notification.
uint16_t handle
Pointer to I/O object being monitored.
Single configuration item within object.
uint32_t ObjectId
ObjectID type - single 32-bit value.
Heap-allocated dynamic I/O data buffer.