MCPcopy Index your code
hub / github.com/Moddable-OpenSource/moddable / writeAttributeValue

Method writeAttributeValue

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

Source from the content-addressed store, hash-verified

315 return perms.join("|");
316 }
317 writeAttributeValue(file, attribute, index, prefix) {
318 let buffer = typedValueToBuffer(attribute.type, attribute.value);
319 attribute._length = buffer.byteLength;
320 file.write(`static const uint8_t ${prefix}_value${index}[${buffer.byteLength}] = { `);
321 file.write(buffer2hexlist(buffer));
322 file.write(" };");
323 file.line("");
324 }
325 writeAttributeUUID(file, attribute, index, prefix) {
326 let uuid = attribute.uuid;
327 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