20 #warning "These services are deprecated and will be removed. Please see services.md for details about replacement services." 22 #ifndef __BLE_DEVICE_INFORMATION_SERVICE_H__ 23 #define __BLE_DEVICE_INFORMATION_SERVICE_H__ 27 #include "ble/GattServer.h" 29 #if BLE_FEATURE_GATT_SERVER 59 const char *manufacturersName =
nullptr,
60 const char *modelNumber =
nullptr,
61 const char *serialNumber =
nullptr,
62 const char *hardwareRevision =
nullptr,
63 const char *firmwareRevision =
nullptr,
64 const char *softwareRevision =
nullptr) :
67 (uint8_t *)manufacturersName,
68 (manufacturersName != nullptr) ? strlen(manufacturersName) : 0,
69 (manufacturersName != nullptr) ? strlen(manufacturersName) : 0,
72 (uint8_t *)modelNumber,
73 (modelNumber != nullptr) ? strlen(modelNumber) : 0,
74 (modelNumber != nullptr) ? strlen(modelNumber) : 0,
77 (uint8_t *)serialNumber,
78 (serialNumber != nullptr) ? strlen(serialNumber) : 0,
79 (serialNumber != nullptr) ? strlen(serialNumber) : 0,
82 (uint8_t *)hardwareRevision,
83 (hardwareRevision != nullptr) ? strlen(hardwareRevision) : 0,
84 (hardwareRevision != nullptr) ? strlen(hardwareRevision) : 0,
87 (uint8_t *)firmwareRevision,
88 (firmwareRevision != nullptr) ? strlen(firmwareRevision) : 0,
89 (firmwareRevision != nullptr) ? strlen(firmwareRevision) : 0,
92 (uint8_t *)softwareRevision,
93 (softwareRevision != nullptr) ? strlen(softwareRevision) : 0,
94 (softwareRevision != nullptr) ? strlen(softwareRevision) : 0,
97 static bool serviceAdded =
false;
109 sizeof(charTable) /
sizeof(charTable[0]));
111 ble.gattServer().addService(deviceInformationService);
147 #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.