File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed
libraries/Bluefruit52Lib/src Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -23,13 +23,14 @@ bool BLEClientIas::discover(uint16_t conn_handle) {
23
23
24
24
uint16_t BLEClientIas::getAlertLevel () {
25
25
26
- uint16_t level = 0 ;
26
+ uint8_t level = 0 ;
27
+ ble_gattc_handle_range_t bck_range = Bluefruit.Discovery .getHandleRange ();
27
28
28
29
BLEClientCharacteristic chr (uuid);
29
30
chr.begin (this );
30
31
31
32
if (Bluefruit.Discovery .discoverCharacteristic (_conn_hdl, chr)) {
32
- level = chr.read16 ();
33
+ level = chr.read8 ();
33
34
}
34
35
35
36
Bluefruit.Discovery .setHandleRange (bck_range);
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ BLEIas::BLEIas(void) : BLEService(UUID16_SVC_IMMEDIATE_ALERT) {
11
11
12
12
}
13
13
14
- void BLEIas::setAlertLevel (const uint8_t alert_level) {
14
+ void BLEIas::setAlertLevel (uint8_t alert_level) {
15
15
_alert_level = alert_level;
16
16
}
17
17
@@ -27,7 +27,7 @@ err_t BLEIas::begin(void) {
27
27
chars.setProperties (CHR_PROPS_READ);
28
28
chars.setFixedLen (sizeof (_alert_level));
29
29
VERIFY_STATUS (chars.begin ());
30
- chars.write (_alert_level, sizeof (_alert_level) );
30
+ chars.write8 (_alert_level);
31
31
32
32
return ERROR_NONE;
33
33
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ class BLEIas : public BLEService {
16
16
protected:
17
17
union {
18
18
struct {
19
- const uint8_t _alert_level; // UUID 0x2A06
19
+ uint8_t _alert_level; // UUID 0x2A06
20
20
};
21
21
};
22
22
You can’t perform that action at this time.
0 commit comments