8#include "dawn/porting/config.hxx"
9#include "dawn/proto/nimble/adv.hxx"
10#include "dawn/proto/nimble/hci.hxx"
11#include "dawn/proto/nimble/host.hxx"
12#include "dawn/proto/nimble/iprph.hxx"
13#include "host/ble_gap.h"
14#include "host/ble_gatt.h"
31 PROTO_NIMBLE_CFG_FIRST = 0,
40 PROTO_NIMBLE_CFG_LAST = 31
52 ~CProtoNimblePrph()
override;
54#ifdef CONFIG_DAWN_OBJECT_HAS_NAME
55 const char *getClassNameStr()
const override
78 return this->
getIO(
id);
135 return CProtoNimblePrph::cfgId(
142 std::vector<IProtoNimblePrphService *> vservices;
143 std::vector<struct ble_gatt_svc_def *> vSvcDefs;
144 std::vector<bool> vstart;
145 struct ble_gatt_svc_def *svcDefs;
146 uint8_t noAllocServices;
149 CProtoNimbleHost host;
151 int configureDesc(
const CDescObject &desc);
152 void servicesDefault();
153 int servicesCreate();
157 static void bleSyncCb();
CIOCommon * getIO(SObjectId::ObjectId id)
Get an I/O object by ID.
void setObjectMapItem(SObjectId::ObjectId id, CObject *obj)
Set an item in the object map.
const std::map< SObjectId::ObjectId, CIOCommon * > & getIOMap() const
Get the I/O map for this object.
Descriptor wrapper for individual object configuration.
Base class for all I/O objects.
Base class for all protocol implementations.
@ PROTO_CLASS_NIMBLE_PRPH
BLE Peripheral using Apache NimBLE stack.
BLE Peripheral (Slave) Protocol Implementation using NimBLE.
int stopService(int id)
Stop a specific service.
int doStart()
Start implementation hook.
@ PROTO_NIMBLE_CFG_IOBIND_CUSTOM
Generic custom service binding.
@ PROTO_NIMBLE_CFG_IOBIND_OTS
Object Transfer Service binding.
@ PROTO_NIMBLE_CFG_IOBIND_ESS
Environmental Sensing Service binding.
@ PROTO_NIMBLE_CFG_IOBIND_AIOS
Automation I/O Service binding.
@ PROTO_NIMBLE_CFG_IOBIND_BAS
Battery Service binding.
@ PROTO_NIMBLE_CFG_IOBIND_DIS
Device Information Service binding.
@ PROTO_NIMBLE_CFG_GAPNAME
GAP device name configuration.
@ PROTO_NIMBLE_CFG_IOBIND_IMDS
Industrial Measurement Device Service binding.
size_t getObjectsLen()
Get count of registered I/O objects.
int startService(int id)
Start a specific service.
CIOCommon * getObject(SObjectId::ObjectId id)
Get protocol object by ID.
int configure()
Configure object from descriptor data.
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 deinit()
De-initialize object.
bool hasThread() const
Check if a background thread is active.
int doStop()
Stop implementation hook.
Interface for BLE peripheral services with GATT characteristics.
static ObjectCfgId objectCfg(uint8_t type, uint16_t cls, uint8_t dtype, bool rw, uint16_t size, uint8_t id)
Construct 32-bit ConfigID from component fields.
uint32_t ObjectCfgId
ConfigID type - single 32-bit value.
Out-of-tree user-extension hooks for Dawn.
@ OBJTYPE_PROTO
Protocol object type.
@ DTYPE_ANY
Wildcard data type (matches any actual type).
@ DTYPE_CHAR
Character/string type (null-terminated, 4-byte aligned).
uint32_t ObjectId
ObjectID type - single 32-bit value.
static ObjectId objectId(uint8_t type, uint16_t cls, uint8_t dtype, uint8_t flags, uint16_t priv)
Construct 32-bit ObjectID from component fields.