@mega-yfue/eufy-sdk / p2pCodec / buildStringCommandPayload
Function: buildStringCommandPayload()
ts
function buildStringCommandPayload(
value,
channel?,
key?,
encType?
): Buffer;Command body carrying a string value (e.g. CMD_SET_PAYLOAD JSON). Mirrors the app's buildCommandWithStringTypePayload: [len:2 LE][00 00][01 00][channel,encType][00 00][data]. When key is given the data is zero-padded to 16 and AES-128-ECB encrypted, and encType is written in the channel word (level-1 encryption = 1).
Parameters
value
string
channel?
number = 0
key?
Buffer<ArrayBufferLike>
encType?
number = 1
Returns
Buffer