(file, attribute, index, prefix)
| 1581 | file.line(""); |
| 1582 | } |
| 1583 | writeAttributeUUID(file, attribute, index, prefix) { |
| 1584 | let uuid = attribute.uuid; |
| 1585 | if (4 == uuid.length) |
| 1586 | file.line(`static const uint16_t ${prefix}_uuid${index} = 0x${uuid};`); |
| 1587 | else if (36 == uuid.length) { |
| 1588 | file.write(`static const uint8_t ${prefix}_uuid${index}[16] = { `); |
| 1589 | file.write(buffer2hexlist(uuid128toBuffer(uuid))); |
| 1590 | file.write(" };"); |
| 1591 | file.line(""); |
| 1592 | } |
| 1593 | else |
| 1594 | throw new Error("unsupported UUID length"); |
| 1595 | } |
| 1596 | writeAttributeHandle(file, attribute, index, prefix) { |
| 1597 | file.line(`static const uint16_t ${prefix}_handle${index};`); |
| 1598 | } |
no test coverage detected