| 1 | #include "Button_Service.h" |
| 2 | |
| 3 | void Button_Service::begin() { |
| 4 | buttonService = new BLEService(buttonServiceUuid); |
| 5 | buttonStateC = new BLEUnsignedCharCharacteristic(buttonStateUuid, BLERead | BLENotify); |
| 6 | |
| 7 | // Battery level |
| 8 | BLE.setAdvertisedService(*buttonService); |
| 9 | buttonService->addCharacteristic(*buttonStateC); |
| 10 | BLE.addService(*buttonService); |
| 11 | buttonStateC->writeValue(0); |
| 12 | } |
| 13 | |
| 14 | void Button_Service::write_state(int state) { |
| 15 | buttonStateC->writeValue(state); |
nothing calls this directly
no outgoing calls
no test coverage detected