diff options
author | chegewara <imperiaonline4@gmail.com> | 2018-11-30 10:59:14 +0100 |
---|---|---|
committer | chegewara <imperiaonline4@gmail.com> | 2018-11-30 10:59:14 +0100 |
commit | 934702b6169b92c71cbc850876fd17fb9ee3236d (patch) | |
tree | 048df4f7106cd4a574b609a13e62a36567f5a322 /src/BLE2902.cpp | |
parent | Upload of 0.4.16 (diff) | |
download | thermostat-934702b6169b92c71cbc850876fd17fb9ee3236d.tar.gz thermostat-934702b6169b92c71cbc850876fd17fb9ee3236d.tar.bz2 thermostat-934702b6169b92c71cbc850876fd17fb9ee3236d.zip |
Changes, bugfixes and updgrades. Library is ready to work with arduino-esp32 v1.0.1.
Diffstat (limited to 'src/BLE2902.cpp')
-rw-r--r-- | src/BLE2902.cpp | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/BLE2902.cpp b/src/BLE2902.cpp index 8984da8..23d9c77 100644 --- a/src/BLE2902.cpp +++ b/src/BLE2902.cpp @@ -15,7 +15,7 @@ #include "BLE2902.h" BLE2902::BLE2902() : BLEDescriptor(BLEUUID((uint16_t) 0x2902)) { - uint8_t data[2] = {0,0}; + uint8_t data[2] = { 0, 0 }; setValue(data, 2); } // BLE2902 @@ -44,11 +44,8 @@ bool BLE2902::getIndications() { */ void BLE2902::setIndications(bool flag) { uint8_t *pValue = getValue(); - if (flag) { - pValue[0] |= 1<<1; - } else { - pValue[0] &= ~(1<<1); - } + if (flag) pValue[0] |= 1 << 1; + else pValue[0] &= ~(1 << 1); } // setIndications @@ -58,12 +55,8 @@ void BLE2902::setIndications(bool flag) { */ void BLE2902::setNotifications(bool flag) { uint8_t *pValue = getValue(); - if (flag) { - pValue[0] |= 1<<0; - } else { - pValue[0] &= ~(1<<0); - } + if (flag) pValue[0] |= 1 << 0; + else pValue[0] &= ~(1 << 0); } // setNotifications - #endif |