19 #ifndef __BLE_DEVICE_INFORMATION_SERVICE_H__ 20 #define __BLE_DEVICE_INFORMATION_SERVICE_H__ 24 #include "ble/GattServer.h" 26 #if BLE_FEATURE_GATT_SERVER 56 const char *manufacturersName =
nullptr,
57 const char *modelNumber =
nullptr,
58 const char *serialNumber =
nullptr,
59 const char *hardwareRevision =
nullptr,
60 const char *firmwareRevision =
nullptr,
61 const char *softwareRevision =
nullptr) :
64 (uint8_t *)manufacturersName,
65 (manufacturersName != nullptr) ? strlen(manufacturersName) : 0,
66 (manufacturersName != nullptr) ? strlen(manufacturersName) : 0,
69 (uint8_t *)modelNumber,
70 (modelNumber != nullptr) ? strlen(modelNumber) : 0,
71 (modelNumber != nullptr) ? strlen(modelNumber) : 0,
74 (uint8_t *)serialNumber,
75 (serialNumber != nullptr) ? strlen(serialNumber) : 0,
76 (serialNumber != nullptr) ? strlen(serialNumber) : 0,
79 (uint8_t *)hardwareRevision,
80 (hardwareRevision != nullptr) ? strlen(hardwareRevision) : 0,
81 (hardwareRevision != nullptr) ? strlen(hardwareRevision) : 0,
84 (uint8_t *)firmwareRevision,
85 (firmwareRevision != nullptr) ? strlen(firmwareRevision) : 0,
86 (firmwareRevision != nullptr) ? strlen(firmwareRevision) : 0,
89 (uint8_t *)softwareRevision,
90 (softwareRevision != nullptr) ? strlen(softwareRevision) : 0,
91 (softwareRevision != nullptr) ? strlen(softwareRevision) : 0,
94 static bool serviceAdded =
false;
106 sizeof(charTable) /
sizeof(charTable[0]));
108 ble.gattServer().addService(deviceInformationService);
144 #endif // BLE_FEATURE_GATT_SERVER UUID of the Device Information Service (DIS).
Representation of a GattServer characteristic.
Representation of a GattServer service.
Entry namespace for all BLE API definitions.
Abstract away BLE-capable radio transceivers or SOCs.