(file, attribute, index, prefix)
| 323 | file.line(""); |
| 324 | } |
| 325 | writeAttributeUUID(file, attribute, index, prefix) { |
| 326 | let uuid = attribute.uuid; |
| 327 | if (4 == uuid.length) |
| 328 | file.line(`static const uint16_t ${prefix}_uuid${index} = 0x${uuid};`); |
| 329 | else if (36 == uuid.length) { |
| 330 | file.write(`static const uint8_t ${prefix}_uuid${index}[16] = { `); |
| 331 | file.write(buffer2hexlist(uuid128toBuffer(uuid))); |
| 332 | file.write(" };"); |
| 333 | file.line(""); |
| 334 | } |
| 335 | else |
| 336 | throw new Error("unsupported UUID length"); |
| 337 | } |
| 338 | }; |
| 339 | |
| 340 | class NimBLEGATTFile extends ESP32GATTFile { |
no test coverage detected