MCPcopy Create free account
hub / github.com/BruceDevices/firmware / initBLEServer

Function initBLEServer

src/modules/ble/ble_common.cpp:211–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

209}
210
211bool initBLEServer() {
212 uint64_t chipid = ESP.getEfuseMac();
213 String blename = "Bruce-" + String((uint8_t)(chipid >> 32), HEX);
214
215 BLEDevice::init(blename.c_str());
216 // BLEDevice::setPower(ESP_PWR_LVL_N12);
217 pServer = BLEDevice::createServer();
218
219 pServer->setCallbacks(new MyServerCallbacks());
220 pService = pServer->createService(SERVICE_UUID);
221 pTxCharacteristic = pService->createCharacteristic(CHARACTERISTIC_RX_UUID, NIMBLE_PROPERTY::NOTIFY);
222
223 pTxCharacteristic->addDescriptor(new NimBLE2904());
224 BLECharacteristic *pRxCharacteristic = pService->createCharacteristic(
225 CHARACTERISTIC_TX_UUID, NIMBLE_PROPERTY::WRITE | NIMBLE_PROPERTY::WRITE_NR
226 );
227 pRxCharacteristic->setCallbacks(new MyCallbacks());
228
229 return true;
230}
231
232void disPlayBLESend() {
233 uint8_t senddata[2] = {0};

Callers 1

ble_testFunction · 0.85

Calls 1

initFunction · 0.85

Tested by

no test coverage detected