Skip to content

Commit e22f1e0

Browse files
committed
close #44 add client battery notify with callback support
1 parent faeb0bc commit e22f1e0

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

libraries/Bluefruit52Lib/src/clients/BLEClientBas.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,19 @@ uint8_t BLEClientBas::read(void)
6969
{
7070
return _battery.read8();
7171
}
72+
73+
bool BLEClientBas::enableNotify(void)
74+
{
75+
return _battery.enableNotify();
76+
}
77+
78+
bool BLEClientBas::disableNotify(void)
79+
{
80+
return _battery.disableNotify();
81+
}
82+
83+
void BLEClientBas::setNotifyCallback(BLEClientCharacteristic::notify_cb_t fp, bool useAdaCallback)
84+
{
85+
return _battery.setNotifyCallback(fp, useAdaCallback);
86+
}
87+

libraries/Bluefruit52Lib/src/clients/BLEClientBas.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ class BLEClientBas : public BLEClientService
5151

5252
uint8_t read(void);
5353

54+
bool enableNotify(void);
55+
bool disableNotify(void);
56+
57+
void setNotifyCallback(BLEClientCharacteristic::notify_cb_t fp, bool useAdaCallback = true);
58+
5459
private:
5560
BLEClientCharacteristic _battery;
5661
};

0 commit comments

Comments
 (0)