Dawn Framework 1.0
Universal data acquisition framework for embedded systems
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
dawn::CProtoNimblePrph Class Reference

BLE Peripheral (Slave) Protocol Implementation using NimBLE. More...

#include <prph.hxx>

Inheritance diagram for dawn::CProtoNimblePrph:
[legend]
Collaboration diagram for dawn::CProtoNimblePrph:
[legend]

Public Types

enum  { CMD_RESET = 0 , CMD_TRIGGER1 = 1 , CMD_TRIGGER2 = 2 , CMD_TRIGGER3 = 3 }
 Control command identifiers for control() More...
 
enum  
 Default descriptor validation failure codes. More...
 
enum  
 Common configuration IDs.
 
enum  EObjectState { STATE_STOPPED = 0 , STATE_RUNNING = 1 }
 Object operational state returned by getState() More...
 
enum  EProtoClass {
  PROTO_CLASS_ANY = 0 , PROTO_CLASS_NIMBLE_PRPH = 1 , PROTO_CLASS_NXSCOPE_DUMMY = 10 , PROTO_CLASS_DUMMY = 12 ,
  PROTO_CLASS_NXSCOPE_SERIAL = 11 , PROTO_CLASS_NXSCOPE_UDP = 13 , PROTO_CLASS_SHELL_STD = 15 , PROTO_CLASS_SHELL_SERIAL = 16 ,
  PROTO_CLASS_SERIAL = 17 , PROTO_CLASS_MODBUS_RTU = 18 , PROTO_CLASS_MODBUS_TCP = 19 , PROTO_CLASS_CAN = 20 ,
  PROTO_CLASS_UDP = 22 , PROTO_CLASS_IPC = 23 , PROTO_CLASS_USER_START = 510 , PROTO_CLASS_USER = 511 ,
  PROTO_CLASS_LAST
}
 Protocol object class types. More...
 
enum  EProtoNimblePrphCfg {
}
 

Public Member Functions

int configure ()
 Configure object from descriptor data.
 
int deinit ()
 De-initialize object.
 
int doStart ()
 Start implementation hook.
 
int doStop ()
 Stop implementation hook.
 
bool getCfgFlag () const
 Check if configuration flag is set.
 
uint16_t getCls () const
 Get object class field.
 
CDescObjectgetDesc ()
 Get descriptor object for this object.
 
uint8_t getDtype () const
 Get data type field.
 
size_t getDtypeSize () const
 Get size of this object's data type.
 
uint8_t getFlags () const
 Get type-specific flags field.
 
SObjectId::UObjectId getId () const
 Get object identifier as union structure.
 
SObjectId::ObjectId getIdV () const
 Get object identifier as raw 32-bit value.
 
CIOCommongetIO (SObjectId::ObjectId id)
 Get an I/O object by ID.
 
const std::map< SObjectId::ObjectId, CIOCommon * > & getIOMap () const
 Get the I/O map for this object.
 
int getObjConfig (SObjectCfg::ObjectCfgId objcfg, uint32_t *data, size_t len)
 Get object configuration item.
 
CIOCommongetObject (SObjectId::ObjectId id)
 Get protocol object by ID.
 
size_t getObjectsLen ()
 Get count of registered I/O objects.
 
uint16_t getPriv () const
 Get instance/private data field.
 
virtual EObjectState getState () const
 Get current operational state.
 
uint8_t getType () const
 Get object type field.
 
bool hasThread () const
 Check if a background thread is active.
 
virtual int init ()
 One-time initialize object after bindings are resolved.
 
void regObject (SObjectId::ObjectId id)
 Register an I/O object for this service.
 
int serviceRegister (struct ble_gatt_svc_def *svc)
 Register a GATT service with the peripheral.
 
int setObjConfig (SObjectCfg::ObjectCfgId objcfg, uint32_t *data, size_t len)
 Set object configuration item.
 
void setObjectMapItem (SObjectId::ObjectId id, CObject *obj)
 Set an item in the object map.
 
int start ()
 Start object.
 
int startService (int id)
 Start a specific service.
 
int stop ()
 Stop object.
 
int stopService (int id)
 Stop a specific service.
 
virtual int trigger (uint8_t cmd)
 Execute a trigger command.
 

Static Public Member Functions

static float charScaleGet (uint16_t u)
 Get scaling factor for a characteristic UUID.
 
static int descValidDefault (const uint32_t *data, size_t len)
 Default descriptor validation method.
 
static int validateDesc (const uint32_t *desc, size_t len)
 Validate entire descriptor.
 

Static Public Attributes

static std::pair< uint16_t, float > charScale []
 Scaling factors for GATT characteristics.
 
static size_t charScaleSize
 Number of characteristic scaling entries.
 
static uint16_t UUID16_ACCEL = 0x2c06
 16-bit UUID for Acceleration characteristic.
 
static uint16_t UUID16_AGGREGATE = 0x2a5a
 16-bit UUID for Aggregate characteristic.
 
static uint16_t UUID16_AIOS = 0x1815
 16-bit Bluetooth SIG UUID for AIOS.
 
static uint16_t UUID16_ANALOG = 0x2a58
 16-bit UUID for Analog characteristic.
 
static uint16_t UUID16_BSS = 0x183b
 16-bit Bluetooth SIG UUID for BSS.
 
static uint16_t UUID16_CURRENT = 0x2aee
 16-bit UUID for Electric Current characteristic.
 
static uint16_t UUID16_CURRENTRANGE = 0x2aef
 16-bit UUID for Electric Current Range characteristic.
 
static uint16_t UUID16_CURRENTSPEC = 0x2af0
 16-bit UUID for Electric Current Specification characteristic.
 
static uint16_t UUID16_CURRENTSTATS = 0x2af1
 16-bit UUID for Electric Current Statistics characteristic.
 
static uint16_t UUID16_DIGITAL = 0x2a56
 16-bit UUID for Digital characteristic.
 
static uint16_t UUID16_ESS = 0x181a
 16-bit Bluetooth SIG UUID for ESS.
 
static uint16_t UUID16_HUM = 0x2a6f
 16-bit UUID for Humidity characteristic.
 
static uint16_t UUID16_ILLUMINANCE = 0x2afb
 16-bit UUID for Illuminance characteristic.
 
static uint16_t UUID16_IMDS = 0x185a
 16-bit Bluetooth SIG UUID for IMDS.
 
static uint16_t UUID16_PRESS = 0x2a6d
 16-bit UUID for Pressure characteristic.
 
static uint16_t UUID16_RESISTANCE = 0x272a
 16-bit UUID for Electric Resistance characteristic.
 
static uint16_t UUID16_TEMP = 0x2a6e
 16-bit UUID for Temperature characteristic.
 
static uint16_t UUID16_TWINDDIR = 0x2a71
 16-bit UUID for True Wind Direction characteristic.
 
static uint16_t UUID16_TWINDSPEED = 0x2a70
 16-bit UUID for True Wind Speed characteristic.
 
static uint16_t UUID16_UVIDX = 0x2a76
 16-bit UUID for UV Index characteristic.
 
static uint16_t UUID16_VOLTAGE = 0x2b18
 16-bit UUID for Voltage characteristic.
 
static uint16_t UUID16_VOLTAGEFREQ = 0x2be8
 16-bit UUID for Voltage Frequency characteristic.
 
static uint16_t UUID16_VOLTAGESPEC = 0x2b19
 16-bit UUID for Voltage Specification characteristic.
 
static uint16_t UUID16_VOLTAGESTAT = 0x2b1a
 16-bit UUID for Voltage Statistics characteristic.
 
static uint32_t UUID_ACCEL [4] = {0x2c060010, 0x7474754e, 0x694e2058, 0x454c426d}
 Acceleration Characteristic UUID (0x2C06).
 
static uint32_t UUID_AGGREGATE [4] = {0x2a5a0010, 0x7474754e, 0x694e2058, 0x454c426d}
 Aggregate Characteristic UUID (0x2A5A).
 
static uint32_t UUID_AIOS [4] = {0x18150010, 0x7474754e, 0x694e2058, 0x454c426d}
 Automation I/O Service UUID (0x1815).
 
static uint32_t UUID_ANALOG [4] = {0x2a580010, 0x7474754e, 0x694e2058, 0x454c426d}
 Analog Characteristic UUID (0x2A58).
 
static uint32_t UUID_BSS [4] = {0x183b0010, 0x7474754e, 0x694e2058, 0x454c426d}
 Binary Sensor Service UUID (0x183B).
 
static uint32_t UUID_CURRENT [4] = {0x2aee0010, 0x7474754e, 0x694e2058, 0x454c426d}
 Electric Current Characteristic UUID (0x2AEE).
 
static uint32_t UUID_CURRENTRANGE [4] = {0x2aef0010, 0x7474754e, 0x694e2058, 0x454c426d}
 Electric Current Range Characteristic UUID (0x2AEF).
 
static uint32_t UUID_CURRENTSPEC [4] = {0x2af00010, 0x7474754e, 0x694e2058, 0x454c426d}
 Electric Current Specification Characteristic UUID (0x2AF0).
 
static uint32_t UUID_CURRENTSTATS [4] = {0x2af10010, 0x7474754e, 0x694e2058, 0x454c426d}
 Electric Current Statistics Characteristic UUID (0x2AF1).
 
static uint32_t UUID_DIGITAL [4] = {0x2a560010, 0x7474754e, 0x694e2058, 0x454c426d}
 Digital Characteristic UUID (0x2A56).
 
static uint32_t UUID_ESS [4] = {0x181a0010, 0x7474754e, 0x694e2058, 0x454c426d}
 Environmental Sensing Service UUID (0x181A).
 
static uint32_t UUID_HUM [4] = {0x2a6f0010, 0x7474754e, 0x694e2058, 0x454c426d}
 Humidity Characteristic UUID (0x2A6F).
 
static uint32_t UUID_ILLUMINANCE [4] = {0x2afb0010, 0x7474754e, 0x694e2058, 0x454c426d}
 Illuminance Characteristic UUID (0x2AFB).
 
static uint32_t UUID_IMDS [4] = {0x185a0010, 0x7474754e, 0x694e2058, 0x454c426d}
 Industrial Measurement Device Service UUID (0x185A).
 
static uint32_t UUID_INPUT_TRIGGER_SET [4]
 AIOS Input Trigger Set characteristic (0x2A57).
 
static uint32_t UUID_OUTPUT_TRIGGER_SET [4]
 AIOS Output Trigger Set characteristic (0x2A5C).
 
static uint32_t UUID_PRESS [4] = {0x2a6d0010, 0x7474754e, 0x694e2058, 0x454c426d}
 Pressure Characteristic UUID (0x2A6D).
 
static uint32_t UUID_RESISTANCE [4] = {0x272a0010, 0x7474754e, 0x694e2058, 0x454c426d}
 Electric Resistance Characteristic UUID (0x272A).
 
static uint32_t UUID_TEMP [4] = {0x2a6e0010, 0x7474754e, 0x694e2058, 0x454c426d}
 Temperature Characteristic UUID (0x2A6E).
 
static uint32_t UUID_TIME_TRIGGER_SET [4]
 AIOS Time Trigger Set characteristic (0x2A3F).
 
static uint32_t UUID_TWINDDIR [4] = {0x2a710010, 0x7474754e, 0x694e2058, 0x454c426d}
 True Wind Direction Characteristic UUID (0x2A71).
 
static uint32_t UUID_TWINDSPEED [4] = {0x2a700010, 0x7474754e, 0x694e2058, 0x454c426d}
 True Wind Speed Characteristic UUID (0x2A70).
 
static uint32_t UUID_UVIDX [4] = {0x2a760010, 0x7474754e, 0x694e2058, 0x454c426d}
 UV Index Characteristic UUID (0x2A76).
 
static uint32_t UUID_VOLTAGE [4] = {0x2b180010, 0x7474754e, 0x694e2058, 0x454c426d}
 Voltage Characteristic UUID (0x2B18).
 
static uint32_t UUID_VOLTAGEFREQ [4] = {0x2be80010, 0x7474754e, 0x694e2058, 0x454c426d}
 Voltage Frequency Characteristic UUID (0x2BE8).
 
static uint32_t UUID_VOLTAGESPEC [4] = {0x2b190010, 0x7474754e, 0x694e2058, 0x454c426d}
 Voltage Specification Characteristic UUID (0x2B19).
 
static uint32_t UUID_VOLTAGESTAT [4] = {0x2b1a0010, 0x7474754e, 0x694e2058, 0x454c426d}
 Voltage Statistics Characteristic UUID (0x2B1A).
 

Protected Member Functions

virtual int onSetObjConfig (SObjectCfg::ObjectCfgId objcfg, uint32_t *data, size_t len)
 Pre-update hook for runtime configuration writes.
 

Detailed Description

BLE Peripheral (Slave) Protocol Implementation using NimBLE.

This class implements the BLE peripheral role using Apache NimBLE stack.

Definition at line 24 of file prph.hxx.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited

Control command identifiers for control()

Enumerator
CMD_RESET 

Reset object internal state.

CMD_TRIGGER1 

Object-specific trigger slot 1.

CMD_TRIGGER2 

Object-specific trigger slot 2.

CMD_TRIGGER3 

Object-specific trigger slot 3.

Definition at line 40 of file object.hxx.

◆ anonymous enum

anonymous enum
inherited

Default descriptor validation failure codes.

Negative values identify which length check failed in descValidDefault().

Definition at line 314 of file object.hxx.

◆ EObjectState

Object operational state returned by getState()

Enumerator
STATE_STOPPED 

Object is stopped.

STATE_RUNNING 

Object is running.

Definition at line 32 of file object.hxx.

◆ EProtoClass

Protocol object class types.

Enumerator
PROTO_CLASS_ANY 

Wildcard/any protocol class (for validation/queries).

PROTO_CLASS_NIMBLE_PRPH 

BLE Peripheral using Apache NimBLE stack.

PROTO_CLASS_NXSCOPE_DUMMY 

NxScope real-time visualization (dummy interface).

PROTO_CLASS_DUMMY 

Dummy protocol (test/helper).

PROTO_CLASS_NXSCOPE_SERIAL 

NxScope real-time visualization (serial interface).

PROTO_CLASS_NXSCOPE_UDP 

NxScope real-time visualization (UDP interface).

PROTO_CLASS_SHELL_STD 

Interactive shell on stdin/stdout.

PROTO_CLASS_SHELL_SERIAL 

Interactive shell on serial port.

PROTO_CLASS_SERIAL 

Compact binary protocol over serial port.

PROTO_CLASS_MODBUS_RTU 

Modbus RTU (serial implementation).

PROTO_CLASS_MODBUS_TCP 

Modbus TCP (network implementation).

PROTO_CLASS_CAN 

CAN bus protocol.

PROTO_CLASS_UDP 

UDP-based protocol.

PROTO_CLASS_IPC 

FIFO-based local IPC protocol.

PROTO_CLASS_USER_START 

User-defined protocols start from here.

PROTO_CLASS_USER 

Placeholder for user protocol.

PROTO_CLASS_LAST 

Last protocol class (sentinel value).

Definition at line 27 of file common.hxx.

◆ EProtoNimblePrphCfg

Enumerator
PROTO_NIMBLE_CFG_GAPNAME 

GAP device name configuration.

PROTO_NIMBLE_CFG_IOBIND_DIS 

Device Information Service binding.

PROTO_NIMBLE_CFG_IOBIND_BAS 

Battery Service binding.

PROTO_NIMBLE_CFG_IOBIND_AIOS 

Automation I/O Service binding.

PROTO_NIMBLE_CFG_IOBIND_ESS 

Environmental Sensing Service binding.

PROTO_NIMBLE_CFG_IOBIND_IMDS 

Industrial Measurement Device Service binding.

PROTO_NIMBLE_CFG_IOBIND_OTS 

Object Transfer Service binding.

PROTO_NIMBLE_CFG_IOBIND_CUSTOM 

Generic custom service binding.

Definition at line 29 of file prph.hxx.

Member Function Documentation

◆ charScaleGet()

static float dawn::IProtoNimblePrphCb::charScaleGet ( uint16_t  u)
inlinestaticinherited

Get scaling factor for a characteristic UUID.

Returns the scaling factor for converting raw values to proper units.

Parameters
[in]u16-bit Bluetooth SIG UUID.
Returns
float Scaling factor (1.0 = no scaling, 100.0 = divide by 100).

Definition at line 383 of file iprph.hxx.

References dawn::IProtoNimblePrphCb::charScale, and dawn::IProtoNimblePrphCb::charScaleSize.

◆ configure()

int CProtoNimblePrph::configure ( )
virtual

Configure object from descriptor data.

Called during framework setup before dependency binding. Implementations should parse/validate descriptor configuration and store object settings, but avoid one-time allocations that depend on bound objects.

Returns
OK on success, negative error code on failure.

Reimplemented from dawn::CObject.

Definition at line 304 of file prph.cxx.

References dawn::CObject::getDesc().

Here is the call graph for this function:

◆ deinit()

int CProtoNimblePrph::deinit ( )
virtual

De-initialize object.

Clean up resources allocated during init().

Returns
OK on success, negative error code on failure.

Reimplemented from dawn::CObject.

Definition at line 340 of file prph.cxx.

◆ descValidDefault()

int CObject::descValidDefault ( const uint32_t *  data,
size_t  len 
)
staticinherited

Default descriptor validation method.

Provides basic validation that only checks if descriptor lengths are correct.

Parameters
dataDescriptor data pointer.
lenLength of descriptor data in 32-bit words.
Returns
OK on success, negative error code indicating validation stage.

Definition at line 42 of file object.cxx.

References dawn::SObjectCfg::UObjectCfgId::s, dawn::SObjectCfg::UObjectCfgId::size, and dawn::SObjectCfg::UObjectCfgId::v.

Here is the caller graph for this function:

◆ doStart()

int CProtoNimblePrph::doStart ( )
virtual

Start implementation hook.

Override in derived classes instead of start().

Returns
OK on success, negative error code on failure.

Reimplemented from dawn::CObject.

Definition at line 363 of file prph.cxx.

◆ doStop()

int CProtoNimblePrph::doStop ( )
virtual

Stop implementation hook.

Override in derived classes instead of stop().

Returns
OK on success, negative error code on failure.

Reimplemented from dawn::CObject.

Definition at line 380 of file prph.cxx.

◆ getCfgFlag()

bool CObject::getCfgFlag ( ) const
inherited

Check if configuration flag is set.

Returns
True if this object has configuration data.

Definition at line 160 of file object.cxx.

References dawn::CDescObject::getSize().

Here is the call graph for this function:

◆ getCls()

uint16_t CObject::getCls ( ) const
inherited

Get object class field.

Returns
Object class identifier (0-511).

Definition at line 170 of file object.cxx.

References dawn::SObjectId::UObjectId::cls, and dawn::SObjectId::UObjectId::s.

Here is the caller graph for this function:

◆ getDesc()

CDescObject & CObject::getDesc ( )
inherited

Get descriptor object for this object.

Returns
Reference to associated CDescObject.

Definition at line 190 of file object.cxx.

◆ getDtype()

uint8_t CObject::getDtype ( ) const
inherited

Get data type field.

Returns
Data type (DTYPE_UINT32, DTYPE_FLOAT, etc.).

Definition at line 175 of file object.cxx.

References dawn::SObjectId::UObjectId::dtype, and dawn::SObjectId::UObjectId::s.

Here is the caller graph for this function:

◆ getDtypeSize()

size_t CObject::getDtypeSize ( ) const
inherited

Get size of this object's data type.

Returns
Size in bytes for the configured data type.

Definition at line 195 of file object.cxx.

References dawn::SObjectId::getDtypeSize_(), and dawn::CDescObject::getObjectDtype().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFlags()

uint8_t CObject::getFlags ( ) const
inherited

Get type-specific flags field.

Returns
Flags value (0-3).

Definition at line 180 of file object.cxx.

References dawn::SObjectId::UObjectId::flags, and dawn::SObjectId::UObjectId::s.

Here is the caller graph for this function:

◆ getId()

SObjectId::UObjectId CObject::getId ( ) const
inherited

Get object identifier as union structure.

Returns
Reference to UObjectId structure.

Definition at line 150 of file object.cxx.

◆ getIdV()

SObjectId::ObjectId CObject::getIdV ( ) const
inherited

Get object identifier as raw 32-bit value.

Returns
ObjectID as uint32_t.

Definition at line 155 of file object.cxx.

References dawn::SObjectId::UObjectId::v.

Here is the caller graph for this function:

◆ getIO()

CIOCommon * CBindableObject::getIO ( SObjectId::ObjectId  id)
inherited

Get an I/O object by ID.

Parameters
idObject ID to retrieve.
Returns
Pointer to the I/O object, or nullptr if not found.

Definition at line 41 of file bindable.cxx.

Here is the caller graph for this function:

◆ getIOMap()

const std::map< SObjectId::ObjectId, CIOCommon * > & CBindableObject::getIOMap ( ) const
inherited

Get the I/O map for this object.

Returns
Pointer to a map of object IDs to I/O objects.

Definition at line 18 of file bindable.cxx.

Here is the caller graph for this function:

◆ getObjConfig()

int CObject::getObjConfig ( SObjectCfg::ObjectCfgId  objcfg,
uint32_t *  data,
size_t  len 
)
inherited

Get object configuration item.

Retrieves configuration data for this object.

Parameters
objcfgConfiguration ID specifying which config item to retrieve.
dataPointer to buffer for configuration data.
lenLength of buffer in 32-bit words.
Returns
OK on success, negative error code on failure.

Definition at line 240 of file object.cxx.

References dawn::SObjectCfg::SObjectCfgItem::data, dawn::SObjectCfg::objectCfgGetSize(), and dawn::CDescObject::objectCfgItemId().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getObject()

CIOCommon * dawn::CProtoNimblePrph::getObject ( SObjectId::ObjectId  id)
inlinevirtual

Get protocol object by ID.

Retrieves a protocol instance by its object ID.

Parameters
[in]idI/O object ID.
Returns
CIOCommon* Pointer to I/O object, nullptr if not registered.

Implements dawn::IProtoNimblePrphCb.

Definition at line 76 of file prph.hxx.

References dawn::CBindableObject::getIO().

Here is the call graph for this function:

◆ getObjectsLen()

size_t dawn::CProtoNimblePrph::getObjectsLen ( )
inlinevirtual

Get count of registered I/O objects.

Returns
size_t Total number of I/O objects registered.

Implements dawn::IProtoNimblePrphCb.

Definition at line 81 of file prph.hxx.

References dawn::CBindableObject::getIOMap().

Here is the call graph for this function:

◆ getPriv()

uint16_t CObject::getPriv ( ) const
inherited

Get instance/private data field.

Returns
Instance ID (0-16383).

Definition at line 185 of file object.cxx.

References dawn::SObjectId::UObjectId::priv, and dawn::SObjectId::UObjectId::s.

Here is the caller graph for this function:

◆ getState()

virtual EObjectState dawn::CObject::getState ( ) const
inlinevirtualinherited

Get current operational state.

Default returns STATE_RUNNING after successful start(), STATE_STOPPED otherwise. Objects with richer states (e.g. paused) should override.

Returns
Current EObjectState value.

Definition at line 183 of file object.hxx.

References dawn::CObject::STATE_RUNNING, and dawn::CObject::STATE_STOPPED.

◆ getType()

uint8_t CObject::getType ( ) const
inherited

Get object type field.

Returns
Object type (OBJTYPE_IO, OBJTYPE_PROTO, OBJTYPE_PROG).

Definition at line 165 of file object.cxx.

References dawn::SObjectId::UObjectId::s, and dawn::SObjectId::UObjectId::type.

◆ hasThread()

bool CProtoNimblePrph::hasThread ( ) const
virtual

Check if a background thread is active.

Used by Dawn's main loop to detect when clean exit is possible. Objects without a background thread must return false. Independent of operational state tracked via getState().

Returns
True if a background thread is active, false otherwise.

Reimplemented from dawn::CObject.

Definition at line 396 of file prph.cxx.

◆ init()

virtual int dawn::CObject::init ( )
inlinevirtualinherited

◆ onSetObjConfig()

virtual int dawn::CObject::onSetObjConfig ( SObjectCfg::ObjectCfgId  objcfg,
uint32_t *  data,
size_t  len 
)
inlineprotectedvirtualinherited

Pre-update hook for runtime configuration writes.

Called by setObjConfig() before descriptor-backed storage is updated. Derived classes may validate incoming data and prepare/apply runtime side effects. Returning a negative error rejects the update.

Parameters
objcfgConfiguration ID that will be updated.
dataPointer to new config words.
lenNumber of config words.
Returns
OK on success, or negative error code to reject update.

Reimplemented in dawn::CIOAdcStream, dawn::CIOAdcSync, and dawn::CIOPwm.

Definition at line 386 of file object.hxx.

Here is the caller graph for this function:

◆ regObject()

void dawn::CProtoNimblePrph::regObject ( SObjectId::ObjectId  id)
inlinevirtual

Register an I/O object for this service.

Called by services to register I/O objects.

Parameters
[in]idI/O object ID to register.

Implements dawn::IProtoNimblePrphCb.

Definition at line 71 of file prph.hxx.

References dawn::CBindableObject::setObjectMapItem().

Here is the call graph for this function:

◆ serviceRegister()

int CProtoNimblePrph::serviceRegister ( struct ble_gatt_svc_def *  svc)
virtual

Register a GATT service with the peripheral.

Called by service implementations to register their GATT service definition.

Parameters
[in]svcGATT service definition (from NimBLE ble_gatt_svc_def).
Returns
int Service ID assigned by peripheral (for start/stop), or.

Implements dawn::IProtoNimblePrphCb.

Definition at line 401 of file prph.cxx.

◆ setObjConfig()

int CObject::setObjConfig ( SObjectCfg::ObjectCfgId  objcfg,
uint32_t *  data,
size_t  len 
)
inherited

Set object configuration item.

Updates a configuration item for this object.

Parameters
objcfgConfiguration ID specifying which config item to update.
dataPointer to configuration data.
lenLength of configuration data in 32-bit words.
Returns
OK on success, negative error code on failure.

Definition at line 200 of file object.cxx.

References dawn::SObjectCfg::SObjectCfgItem::data, dawn::SObjectCfg::objectCfgGetRw(), dawn::SObjectCfg::objectCfgGetSize(), dawn::CDescObject::objectCfgItemId(), and dawn::CObject::onSetObjConfig().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setObjectMapItem()

void CBindableObject::setObjectMapItem ( SObjectId::ObjectId  id,
CObject obj 
)
inherited

Set an item in the object map.

Parameters
idObject ID to set.
objObject pointer to associate with the ID.

Definition at line 23 of file bindable.cxx.

References dawn::SObjectId::objectIdGetType(), and dawn::SObjectId::OBJTYPE_IO.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ start()

int dawn::CObject::start ( )
inlineinherited

Start object.

Tracks operational state and calls doStart(). This phase may run many times during an object's lifetime and should not perform one-time allocation. Sets started on successful doStart() return.

Returns
OK on success, negative error code on failure.

Definition at line 116 of file object.hxx.

References dawn::CObject::doStart().

Here is the call graph for this function:

◆ startService()

int CProtoNimblePrph::startService ( int  id)
virtual

Start a specific service.

Enables a service (makes its characteristics available to clients).

Parameters
[in]idService ID from serviceRegister().
Returns
int 0 on success, negative error code on failure.

Implements dawn::IProtoNimblePrphCb.

Definition at line 421 of file prph.cxx.

References dawn::CProtoNimbleAdv::gapName.

◆ stop()

int dawn::CObject::stop ( )
inlineinherited

Stop object.

Tracks operational state and calls doStop(). This phase may run many times during an object's lifetime and should not perform one-time deallocation. Always clears started regardless of doStop() return value.

Returns
OK on success, negative error code on failure.

Definition at line 145 of file object.hxx.

References dawn::CObject::doStop().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stopService()

int CProtoNimblePrph::stopService ( int  id)
virtual

Stop a specific service.

Disables a service (removes its characteristics from the GATT database).

Parameters
[in]idService ID from serviceRegister().
Returns
int 0 on success, negative error code on failure.

Implements dawn::IProtoNimblePrphCb.

Definition at line 464 of file prph.cxx.

◆ trigger()

virtual int dawn::CObject::trigger ( uint8_t  cmd)
inlinevirtualinherited

Execute a trigger command.

Parameters
cmdCommand identifier (EObjectCmd value).
Returns
OK on success, -ENOTSUP if not supported.

Reimplemented in dawn::CIOAdcFetch, dawn::CIOAdcStream, dawn::CIOAdcSync, dawn::CIOEncoder, dawn::CIOEncoderIndex, dawn::CIOPwm, dawn::CProgBuffer, dawn::CProgCounter, dawn::CProgProcess, dawn::CProgSequencer, dawn::CProgThresholdBase, and dawn::CProgToggle.

Definition at line 195 of file object.hxx.

◆ validateDesc()

int CObject::validateDesc ( const uint32_t *  desc,
size_t  len 
)
staticinherited

Validate entire descriptor.

Validates a descriptor binary object-by-object using default checks.

Parameters
descDescriptor binary pointer.
lenDescriptor length in 32-bit words.
Returns
OK on success, negative error code indicating validation stage.

Definition at line 123 of file object.cxx.

References dawn::CObject::descValidDefault().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ charScale

std::pair<uint16_t, float> dawn::IProtoNimblePrphCb::charScale[]
staticinherited
Initial value:
= {
{UUID16_TEMP, 100.0f},
{UUID16_HUM, 100.0f},
{UUID16_PRESS, 100.0f},
{UUID16_UVIDX, 1.0f},
{UUID16_ILLUMINANCE, 100.0f},
}
static uint16_t UUID16_UVIDX
16-bit UUID for UV Index characteristic.
Definition iprph.hxx:201
static uint16_t UUID16_HUM
16-bit UUID for Humidity characteristic.
Definition iprph.hxx:178
static uint16_t UUID16_TEMP
16-bit UUID for Temperature characteristic.
Definition iprph.hxx:153
static uint16_t UUID16_ILLUMINANCE
16-bit UUID for Illuminance characteristic.
Definition iprph.hxx:332
static uint16_t UUID16_RESISTANCE
16-bit UUID for Electric Resistance characteristic.
Definition iprph.hxx:346
static uint16_t UUID16_PRESS
16-bit UUID for Pressure characteristic.
Definition iprph.hxx:189

Scaling factors for GATT characteristics.

Maps characteristic UUIDs to their scaling factors.

Definition at line 354 of file iprph.hxx.

◆ UUID_ACCEL

uint32_t dawn::IProtoNimblePrphCb::UUID_ACCEL[4] = {0x2c060010, 0x7474754e, 0x694e2058, 0x454c426d}
staticinherited

Acceleration Characteristic UUID (0x2C06).

NOTE: NON-STANDARD. 0x2C06 is not assigned by the Bluetooth SIG; this is a Dawn-vendor placeholder for three-axis acceleration.

Definition at line 162 of file iprph.hxx.

◆ UUID_AGGREGATE

uint32_t dawn::IProtoNimblePrphCb::UUID_AGGREGATE[4] = {0x2a5a0010, 0x7474754e, 0x694e2058, 0x454c426d}
staticinherited

Aggregate Characteristic UUID (0x2A5A).

Aggregates readable AIOS Digital and Analog characteristic values.

Definition at line 137 of file iprph.hxx.

◆ UUID_AIOS

uint32_t dawn::IProtoNimblePrphCb::UUID_AIOS[4] = {0x18150010, 0x7474754e, 0x694e2058, 0x454c426d}
staticinherited

Automation I/O Service UUID (0x1815).

Service for digital and analog I/O control and monitoring via BLE.

Definition at line 32 of file iprph.hxx.

◆ UUID_ANALOG

uint32_t dawn::IProtoNimblePrphCb::UUID_ANALOG[4] = {0x2a580010, 0x7474754e, 0x694e2058, 0x454c426d}
staticinherited

Analog Characteristic UUID (0x2A58).

Represents analog (continuous) I/O values.

Definition at line 125 of file iprph.hxx.

◆ UUID_BSS

uint32_t dawn::IProtoNimblePrphCb::UUID_BSS[4] = {0x183b0010, 0x7474754e, 0x694e2058, 0x454c426d}
staticinherited

Binary Sensor Service UUID (0x183B).

Service for binary state sensors (on/off, open/closed).

Definition at line 101 of file iprph.hxx.

◆ UUID_CURRENT

uint32_t dawn::IProtoNimblePrphCb::UUID_CURRENT[4] = {0x2aee0010, 0x7474754e, 0x694e2058, 0x454c426d}
staticinherited

Electric Current Characteristic UUID (0x2AEE).

Electrical current measurement in Amperes.

Definition at line 281 of file iprph.hxx.

◆ UUID_CURRENTRANGE

uint32_t dawn::IProtoNimblePrphCb::UUID_CURRENTRANGE[4] = {0x2aef0010, 0x7474754e, 0x694e2058, 0x454c426d}
staticinherited

Electric Current Range Characteristic UUID (0x2AEF).

Supported current measurement range (min, max).

Definition at line 293 of file iprph.hxx.

◆ UUID_CURRENTSPEC

uint32_t dawn::IProtoNimblePrphCb::UUID_CURRENTSPEC[4] = {0x2af00010, 0x7474754e, 0x694e2058, 0x454c426d}
staticinherited

Electric Current Specification Characteristic UUID (0x2AF0).

Rated current specification for the device.

Definition at line 304 of file iprph.hxx.

◆ UUID_CURRENTSTATS

uint32_t dawn::IProtoNimblePrphCb::UUID_CURRENTSTATS[4] = {0x2af10010, 0x7474754e, 0x694e2058, 0x454c426d}
staticinherited

Electric Current Statistics Characteristic UUID (0x2AF1).

Current measurements and statistics (min, max, average).

Definition at line 316 of file iprph.hxx.

◆ UUID_DIGITAL

uint32_t dawn::IProtoNimblePrphCb::UUID_DIGITAL[4] = {0x2a560010, 0x7474754e, 0x694e2058, 0x454c426d}
staticinherited

Digital Characteristic UUID (0x2A56).

Represents digital (boolean) I/O values.

Definition at line 113 of file iprph.hxx.

◆ UUID_ESS

uint32_t dawn::IProtoNimblePrphCb::UUID_ESS[4] = {0x181a0010, 0x7474754e, 0x694e2058, 0x454c426d}
staticinherited

Environmental Sensing Service UUID (0x181A).

Service for environmental measurement characteristics (temperature, humidity, pressure, UV index, wind speed/direction).

Definition at line 78 of file iprph.hxx.

◆ UUID_HUM

uint32_t dawn::IProtoNimblePrphCb::UUID_HUM[4] = {0x2a6f0010, 0x7474754e, 0x694e2058, 0x454c426d}
staticinherited

Humidity Characteristic UUID (0x2A6F).

Relative humidity in 0.01% units.

Definition at line 174 of file iprph.hxx.

◆ UUID_ILLUMINANCE

uint32_t dawn::IProtoNimblePrphCb::UUID_ILLUMINANCE[4] = {0x2afb0010, 0x7474754e, 0x694e2058, 0x454c426d}
staticinherited

Illuminance Characteristic UUID (0x2AFB).

Illuminance / light level in 0.01 lux units (uint24).

Definition at line 328 of file iprph.hxx.

◆ UUID_IMDS

uint32_t dawn::IProtoNimblePrphCb::UUID_IMDS[4] = {0x185a0010, 0x7474754e, 0x694e2058, 0x454c426d}
staticinherited

Industrial Measurement Device Service UUID (0x185A).

Service for industrial measurement devices and sensors.

Definition at line 89 of file iprph.hxx.

◆ UUID_INPUT_TRIGGER_SET

uint32_t dawn::IProtoNimblePrphCb::UUID_INPUT_TRIGGER_SET[4]
staticinherited
Initial value:
= {0x2a570010,
0x7474754e,
0x694e2058,
0x454c426d}

AIOS Input Trigger Set characteristic (0x2A57).

Specifies trigger conditions for digital inputs.

Definition at line 44 of file iprph.hxx.

◆ UUID_OUTPUT_TRIGGER_SET

uint32_t dawn::IProtoNimblePrphCb::UUID_OUTPUT_TRIGGER_SET[4]
staticinherited
Initial value:
= {0x2a5c0010,
0x7474754e,
0x694e2058,
0x454c426d}

AIOS Output Trigger Set characteristic (0x2A5C).

Specifies trigger conditions for digital outputs.

Definition at line 55 of file iprph.hxx.

◆ UUID_PRESS

uint32_t dawn::IProtoNimblePrphCb::UUID_PRESS[4] = {0x2a6d0010, 0x7474754e, 0x694e2058, 0x454c426d}
staticinherited

Pressure Characteristic UUID (0x2A6D).

Barometric pressure in Pascals.

Definition at line 186 of file iprph.hxx.

◆ UUID_RESISTANCE

uint32_t dawn::IProtoNimblePrphCb::UUID_RESISTANCE[4] = {0x272a0010, 0x7474754e, 0x694e2058, 0x454c426d}
staticinherited

Electric Resistance Characteristic UUID (0x272A).

NOTE: NON-STANDARD. 0x272A is not assigned by the Bluetooth SIG; this is a Dawn-vendor characteristic exposed for gas-resistance sensors until a real GATT mapping is chosen. Unit is kilohms (no scaling).

Definition at line 342 of file iprph.hxx.

◆ UUID_TEMP

uint32_t dawn::IProtoNimblePrphCb::UUID_TEMP[4] = {0x2a6e0010, 0x7474754e, 0x694e2058, 0x454c426d}
staticinherited

Temperature Characteristic UUID (0x2A6E).

Temperature measurement in 0.01°C units.

Definition at line 149 of file iprph.hxx.

◆ UUID_TIME_TRIGGER_SET

uint32_t dawn::IProtoNimblePrphCb::UUID_TIME_TRIGGER_SET[4]
staticinherited
Initial value:
= {0x2a3f0010,
0x7474754e,
0x694e2058,
0x454c426d}

AIOS Time Trigger Set characteristic (0x2A3F).

Specifies time-based trigger conditions.

Definition at line 66 of file iprph.hxx.

◆ UUID_TWINDDIR

uint32_t dawn::IProtoNimblePrphCb::UUID_TWINDDIR[4] = {0x2a710010, 0x7474754e, 0x694e2058, 0x454c426d}
staticinherited

True Wind Direction Characteristic UUID (0x2A71).

Wind direction in degrees (0-359).

Definition at line 221 of file iprph.hxx.

◆ UUID_TWINDSPEED

uint32_t dawn::IProtoNimblePrphCb::UUID_TWINDSPEED[4] = {0x2a700010, 0x7474754e, 0x694e2058, 0x454c426d}
staticinherited

True Wind Speed Characteristic UUID (0x2A70).

Wind speed in 0.01 m/s units.

Definition at line 209 of file iprph.hxx.

◆ UUID_UVIDX

uint32_t dawn::IProtoNimblePrphCb::UUID_UVIDX[4] = {0x2a760010, 0x7474754e, 0x694e2058, 0x454c426d}
staticinherited

UV Index Characteristic UUID (0x2A76).

UV index value.

Definition at line 197 of file iprph.hxx.

◆ UUID_VOLTAGE

uint32_t dawn::IProtoNimblePrphCb::UUID_VOLTAGE[4] = {0x2b180010, 0x7474754e, 0x694e2058, 0x454c426d}
staticinherited

Voltage Characteristic UUID (0x2B18).

Electrical voltage measurement.

Definition at line 233 of file iprph.hxx.

◆ UUID_VOLTAGEFREQ

uint32_t dawn::IProtoNimblePrphCb::UUID_VOLTAGEFREQ[4] = {0x2be80010, 0x7474754e, 0x694e2058, 0x454c426d}
staticinherited

Voltage Frequency Characteristic UUID (0x2BE8).

AC voltage frequency in Hz.

Definition at line 245 of file iprph.hxx.

◆ UUID_VOLTAGESPEC

uint32_t dawn::IProtoNimblePrphCb::UUID_VOLTAGESPEC[4] = {0x2b190010, 0x7474754e, 0x694e2058, 0x454c426d}
staticinherited

Voltage Specification Characteristic UUID (0x2B19).

Rated voltage specification for the device.

Definition at line 257 of file iprph.hxx.

◆ UUID_VOLTAGESTAT

uint32_t dawn::IProtoNimblePrphCb::UUID_VOLTAGESTAT[4] = {0x2b1a0010, 0x7474754e, 0x694e2058, 0x454c426d}
staticinherited

Voltage Statistics Characteristic UUID (0x2B1A).

Voltage measurements and statistics (min, max, average).

Definition at line 269 of file iprph.hxx.


The documentation for this class was generated from the following files: