MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / writeAttributeValue

Method writeAttributeValue

tools/bles2gatt.js:1575–1582  ·  view source on GitHub ↗
(file, attribute, index, prefix)

Source from the content-addressed store, hash-verified

1573 return perms.join("|");
1574 }
1575 writeAttributeValue(file, attribute, index, prefix) {
1576 let buffer = typedValueToBuffer(attribute.type, attribute.value);
1577 attribute._length = buffer.byteLength;
1578 file.write(`static const uint8_t ${prefix}_value${index}[${buffer.byteLength}] = { `);
1579 file.write(buffer2hexlist(buffer));
1580 file.write(" };");
1581 file.line("");
1582 }
1583 writeAttributeUUID(file, attribute, index, prefix) {
1584 let uuid = attribute.uuid;
1585 if (4 == uuid.length)

Callers 1

generateMethod · 0.95

Calls 4

buffer2hexlistFunction · 0.85
typedValueToBufferFunction · 0.70
writeMethod · 0.65
lineMethod · 0.45

Tested by

no test coverage detected