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) {
2323
2424uint16_t BLEClientIas::getAlertLevel () {
2525
26- uint16_t level = 0 ;
26+ uint8_t level = 0 ;
27+ ble_gattc_handle_range_t bck_range = Bluefruit.Discovery .getHandleRange ();
2728
2829 BLEClientCharacteristic chr (uuid);
2930 chr.begin (this );
3031
3132 if (Bluefruit.Discovery .discoverCharacteristic (_conn_hdl, chr)) {
32- level = chr.read16 ();
33+ level = chr.read8 ();
3334 }
3435
3536 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) {
1111
1212}
1313
14- void BLEIas::setAlertLevel (const uint8_t alert_level) {
14+ void BLEIas::setAlertLevel (uint8_t alert_level) {
1515 _alert_level = alert_level;
1616}
1717
@@ -27,7 +27,7 @@ err_t BLEIas::begin(void) {
2727 chars.setProperties (CHR_PROPS_READ);
2828 chars.setFixedLen (sizeof (_alert_level));
2929 VERIFY_STATUS (chars.begin ());
30- chars.write (_alert_level, sizeof (_alert_level) );
30+ chars.write8 (_alert_level);
3131
3232 return ERROR_NONE;
3333
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ class BLEIas : public BLEService {
1616protected:
1717 union {
1818 struct {
19- const uint8_t _alert_level; // UUID 0x2A06
19+ uint8_t _alert_level; // UUID 0x2A06
2020 };
2121 };
2222
You can’t perform that action at this time.
0 commit comments