Skip to content

Commit 9388e73

Browse files
committed
updated to be consistent with uint8_t
1 parent 687a545 commit 9388e73

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

libraries/Bluefruit52Lib/src/clients/BLEClientIas.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,14 @@ bool BLEClientIas::discover(uint16_t conn_handle) {
2323

2424
uint16_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);

libraries/Bluefruit52Lib/src/services/BLEIas.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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

libraries/Bluefruit52Lib/src/services/BLEIas.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class BLEIas : public BLEService {
1616
protected:
1717
union {
1818
struct {
19-
const uint8_t _alert_level; // UUID 0x2A06
19+
uint8_t _alert_level; // UUID 0x2A06
2020
};
2121
};
2222

0 commit comments

Comments
 (0)