This shows you the differences between two versions of the page.
iothings:laboratoare:2025:lab2 [2025/09/28 18:03] dan.tudose [Sparrow BLE Service] |
iothings:laboratoare:2025:lab2 [2025/09/28 18:16] (current) dan.tudose [Sparrow BLE Service] |
||
---|---|---|---|
Line 209: | Line 209: | ||
static const char* DIS_FW_REV = "1.0.0"; | static const char* DIS_FW_REV = "1.0.0"; | ||
static const char* DIS_SW_REV = "1.0.0"; | static const char* DIS_SW_REV = "1.0.0"; | ||
+ | static const char* DIS_SN = "SN-000001"; | ||
+ | static const char* DIS_HW = "RevA"; | ||
/* ============================ | /* ============================ | ||
Line 356: | Line 358: | ||
gDIS->createCharacteristic(DIS_FW_UUID, NIMBLE_PROPERTY::READ)->setValue(DIS_FW_REV); | gDIS->createCharacteristic(DIS_FW_UUID, NIMBLE_PROPERTY::READ)->setValue(DIS_FW_REV); | ||
gDIS->createCharacteristic(DIS_SW_UUID, NIMBLE_PROPERTY::READ)->setValue(DIS_SW_REV); | gDIS->createCharacteristic(DIS_SW_UUID, NIMBLE_PROPERTY::READ)->setValue(DIS_SW_REV); | ||
+ | gDIS->createCharacteristic((uint16_t)0x2A25, NIMBLE_PROPERTY::READ)->setValue(DIS_SN); // Serial Number | ||
+ | gDIS->createCharacteristic((uint16_t)0x2A27, NIMBLE_PROPERTY::READ)->setValue(DIS_HW); // Hardware Rev | ||
// PnP ID (7 bytes): Vendor ID Source (1=Bluetooth, 2=USB), Vendor ID (LE16), Product ID (LE16), Product Version (LE16) | // PnP ID (7 bytes): Vendor ID Source (1=Bluetooth, 2=USB), Vendor ID (LE16), Product ID (LE16), Product Version (LE16) | ||
Line 475: | Line 479: | ||
Then, click on the second icon (the one that looks like a " mark) at the left to change the format. You can change to unsigned int for all characteristics. You’ll start seeing the temperature, humidity, and pressure values being reported every 2 seconds. | Then, click on the second icon (the one that looks like a " mark) at the left to change the format. You can change to unsigned int for all characteristics. You’ll start seeing the temperature, humidity, and pressure values being reported every 2 seconds. | ||
+ | |||
+ | You can also see a Battery Service and a Device Information Service. Battery is hardcoded for now at 100% and device information is also hardcoded. | ||
===== Web BLE Application ===== | ===== Web BLE Application ===== |