ble nano hid over gatt
Dependencies: BLE_API mbed-dev nRF51822
Diff: HIDController_BLE.cpp
- Revision:
- 68:13e2343452d5
- Parent:
- 67:81a545a4963c
- Child:
- 69:9d6ecd584a0c
--- a/HIDController_BLE.cpp Thu Sep 01 19:33:25 2016 +0000 +++ b/HIDController_BLE.cpp Fri Sep 02 07:41:33 2016 +0900 @@ -268,6 +268,7 @@ void HIDController::waitForEvent() { BLE& ble = BLE::Instance(BLE::DEFAULT_INSTANCE); + keyboardService->processSend(); // SoftDevice が waitForEvent 中でも起きて // じわじわと WDT のカウンタがすすんでリセットされてしまう(きがする) @@ -322,7 +323,9 @@ } void HIDController::updateBatteryLevel(const uint8_t percentage, const uint16_t voltage) { + if (!connected()) return; if (!batteryService) return; + DEBUG_PRINTF_BLE("updateBatteryLevel\r\n"); batteryService->updateBatteryLevel(percentage, voltage); }