MCPcopy Create free account
hub / github.com/OpenEarable/open-earable / begin

Method begin

src/button_service/Button_Service.cpp:3–12  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1#include "Button_Service.h"
2
3void 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
14void Button_Service::write_state(int state) {
15 buttonStateC->writeValue(state);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected