File tree Expand file tree Collapse file tree 2 files changed +45
-1
lines changed
libraries/Bluefruit52Lib/src/clients Expand file tree Collapse file tree 2 files changed +45
-1
lines changed Original file line number Diff line number Diff line change 33//
44
55#include " BLEClientIas.h"
6+ #include " bluefruit.h"
7+
8+ BLEClientIas::BLEClientIas () : BLEClientService(UUID16_SVC_IMMEDIATE_ALERT) {
9+
10+ }
11+
12+ bool BLEClientIas::begin (void ) {
13+ // invoke superclass begin()
14+ BLEClientService::begin ();
15+ return true ;
16+ }
17+
18+ bool BLEClientIas::discover (uint16_t conn_handle) {
19+ VERIFY (BLEClientService::discover (conn_handle));
20+
21+ return true ;
22+ }
23+
24+ uint16_t BLEClientIas::getAlertLevel () {
25+
26+ uint16_t level = 0 ;
27+
28+ BLEClientCharacteristic chr (uuid);
29+ chr.begin (this );
30+
31+ if (Bluefruit.Discovery .discoverCharacteristic (_conn_hdl, chr)) {
32+ level = chr.read16 ();
33+ }
34+
35+ Bluefruit.Discovery .setHandleRange (bck_range);
36+
37+ return level;
38+ }
Original file line number Diff line number Diff line change 55#ifndef ADAFRUIT_NRF52_ARDUINO_BLECLIENTIAS_H
66#define ADAFRUIT_NRF52_ARDUINO_BLECLIENTIAS_H
77
8+ #include " bluefruit_common.h"
9+ #include " BLEClientCharacteristic.h"
10+ #include " BLEClientService.h"
811
9- class BLEClientIas {
12+ class BLEClientIas : public BLEClientService {
13+
14+ public:
15+ BLEClientIas (void );
16+
17+ virtual bool begin (void );
18+ virtual bool discover (uint16_t conn_handle);
19+
20+ uint16_t getAlertLevel (void );
1021
1122};
1223
You can’t perform that action at this time.
0 commit comments