diff options
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 |