diff options
author | dakkar <dakkar@thenautilus.net> | 2019-02-22 12:39:08 +0000 |
---|---|---|
committer | dakkar <dakkar@thenautilus.net> | 2019-02-22 12:39:08 +0000 |
commit | 67a9dbb8e33e2bbb785e6a16a6ce5837c1a46c97 (patch) | |
tree | 0f5b064f03372305369a41b10e157aa89552e2f0 /sensor/patchedBLE/src/BLE2902.cpp | |
parent | uni-init BLE before sleeping (diff) | |
parent | Merge pull request #23 from tatsutaigu/master (diff) | |
download | thermostat-67a9dbb8e33e2bbb785e6a16a6ce5837c1a46c97.tar.gz thermostat-67a9dbb8e33e2bbb785e6a16a6ce5837c1a46c97.tar.bz2 thermostat-67a9dbb8e33e2bbb785e6a16a6ce5837c1a46c97.zip |
Merge commit 'b232e7f5f0e87f36afbc2f4e03a2c49c48dd47bc'
Diffstat (limited to 'sensor/patchedBLE/src/BLE2902.cpp')
-rw-r--r-- | sensor/patchedBLE/src/BLE2902.cpp | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/sensor/patchedBLE/src/BLE2902.cpp b/sensor/patchedBLE/src/BLE2902.cpp index 8984da8..23d9c77 100644 --- a/sensor/patchedBLE/src/BLE2902.cpp +++ b/sensor/patchedBLE/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 |