@mega-yfue/eufy-sdk / p2pCodec / buildRawCommandPayload
Function: buildRawCommandPayload()
ts
function buildRawCommandPayload(
data,
channel?,
signCode?,
magic?,
streamId?
): Buffer;Build a command body around an ALREADY-encrypted (or plaintext) data buffer with an explicit signCode — used for level-2 (signCode 8, AES-256-GCM) commands like the media-start 1350 the app sends. Same on-wire layout as buildStringCommandPayload but the caller supplies the body and the signCode verbatim (no ECB step): len(u16) ‖ 0000 ‖ 0100 ‖ [channel, signCode] ‖ 0000 ‖ data.
Parameters
data
Buffer
channel?
number = 0
signCode?
number = 0
magic?
[number, number] = ...
streamId?
number = 0
Returns
Buffer