summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoruvok2025-07-22 09:45:17 +0200
committeruvok2025-07-22 09:45:17 +0200
commitb3027f3fd49e64d19a5054831117e4598f491ab9 (patch)
tree5f80cf065d82a9018aeb055031ebd8493e6e6795
parent223ba64fd157ffdf9289ce017398ccdf311f79d8 (diff)
Set MTU, MSD
-rw-r--r--src/ble.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ble.cpp b/src/ble.cpp
index 5cf8b00..ff38b18 100644
--- a/src/ble.cpp
+++ b/src/ble.cpp
@@ -71,6 +71,7 @@ class BadgeSelectorCallbacks : public NimBLECharacteristicCallbacks
void de::uvok::badge::ble_init(void)
{
NimBLEDevice::init("Espadge");
+
server = NimBLEDevice::createServer();
server->setCallbacks(&badgeServerCallbacks);
@@ -93,13 +94,16 @@ void de::uvok::badge::ble_init(void)
s.concat(tmp);
}
call->setValue(s.c_str());
+ const uint16_t mtuLen = max<uint16_t>(s.length() + 16, 256);
+ NimBLEDevice::setMTU(mtuLen);
service->start();
server->addService(service);
pAdvertising = NimBLEDevice::getAdvertising();
- pAdvertising->setName("NimBLE");
+ pAdvertising->setName("NimBLE Badge");
+ pAdvertising->setManufacturerData("\xff\xffuvok");
}
bool de::uvok::badge::ble_is_active(void)