feat: add firmware version BLE characteristic (VERSION_UUID)
This commit is contained in:
parent
5ed27a9b42
commit
d34dfec1ce
1 changed files with 7 additions and 0 deletions
|
|
@ -15,6 +15,7 @@
|
||||||
#define SERVICE_UUID "4fafc201-1fb5-459e-8fcc-c5c9c331914b"
|
#define SERVICE_UUID "4fafc201-1fb5-459e-8fcc-c5c9c331914b"
|
||||||
#define CHARACTERISTIC_UUID "beb5483e-36e1-4688-b7f5-ea07361f26d8"
|
#define CHARACTERISTIC_UUID "beb5483e-36e1-4688-b7f5-ea07361f26d8"
|
||||||
#define UUID_CHAR_UUID "beb5483e-36e1-4688-b7f5-ea07361f26d9"
|
#define UUID_CHAR_UUID "beb5483e-36e1-4688-b7f5-ea07361f26d9"
|
||||||
|
#define VERSION_UUID "beb5483e-36e1-4688-b7f5-ea07361f26db"
|
||||||
|
|
||||||
#define HMAC_PKT_SIZE 37 // 1 cmd + 4 seq + 32 hmac
|
#define HMAC_PKT_SIZE 37 // 1 cmd + 4 seq + 32 hmac
|
||||||
#define HMAC_KEY_LEN 32
|
#define HMAC_KEY_LEN 32
|
||||||
|
|
@ -202,6 +203,12 @@ void setup() {
|
||||||
);
|
);
|
||||||
pUuidChar->setValue(deviceUuid, ESP_UUID_LEN);
|
pUuidChar->setValue(deviceUuid, ESP_UUID_LEN);
|
||||||
|
|
||||||
|
NimBLECharacteristic *pVersionChar = pService->createCharacteristic(
|
||||||
|
VERSION_UUID,
|
||||||
|
NIMBLE_PROPERTY::READ
|
||||||
|
);
|
||||||
|
pVersionChar->setValue(FIRMWARE_VERSION);
|
||||||
|
|
||||||
NimBLEAdvertising *pAdvertising = NimBLEDevice::getAdvertising();
|
NimBLEAdvertising *pAdvertising = NimBLEDevice::getAdvertising();
|
||||||
pAdvertising->setName("SylDa_Server");
|
pAdvertising->setName("SylDa_Server");
|
||||||
pAdvertising->addServiceUUID(SERVICE_UUID);
|
pAdvertising->addServiceUUID(SERVICE_UUID);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue