Dawn Framework 1.0
Universal data acquisition framework for embedded systems
prph_bas.hxx
1// dawn/include/dawn/proto/nimble/prph_bas.hxx
2//
3// SPDX-License-Identifier: Apache-2.0
4//
5
6#pragma once
7
8#include "dawn/porting/config.hxx"
9#include "dawn/proto/nimble/iprph.hxx"
10#include "host/ble_gatt.h"
11
12namespace dawn
13{
14// Forward reference
15
16class CProtoNimblePrph;
17
25{
26public:
27 struct
28 {
30 } typedef SProtoNimblePrphIOBindBas;
31
33
34 ~CProtoNimblePrphBas() override;
35
36 int init() override;
37 int deinit() override;
38 int start() override;
39 int stop() override;
40
41private:
42 int id;
43 SPrphNotiferCb *ncb;
44
45 static int notifierCb(void *priv, io_ddata_t *data);
46
47 int bindObject();
48 int updateBatteryLevel();
49 void configureDesc(const SObjectCfg::SObjectCfgItem *item);
50 void allocObject(const SObjectId::UObjectId &obj);
51};
52} // Namespace dawn
Battery Service (BAS) for BLE Peripheral.
Definition prph_bas.hxx:25
int stop()
Stop service.
Definition prph_bas.cxx:247
int init()
Initialize service.
Definition prph_bas.cxx:93
int start()
Start service.
Definition prph_bas.cxx:226
int deinit()
Deinitialize service.
Definition prph_bas.cxx:115
Interface for BLE peripheral services with GATT characteristics.
Definition iprph.hxx:24
Base interface for GATT services exposed by BLE peripheral.
Definition iprph.hxx:467
Out-of-tree user-extension hooks for Dawn.
Definition bindable.hxx:13
Context data for characteristic notification callbacks.
Definition iprph.hxx:476
Single configuration item within object.
Heap-allocated dynamic I/O data buffer.
Definition ddata.hxx:21
32-bit encoded object identifier (union with bit field).
Definition objectid.hxx:218