@mega-yfue/eufy-sdk / parseBizMapFrame
Function: parseBizMapFrame()
ts
function parseBizMapFrame(raw): BizMapFrame | undefined;Parse one message off biz/…/res into a map frame, or undefined if it is not one.
undefined is the common case and not an error. This runs against every message on a shared connection: DP reports, ACKs on the biz/…/req leg, live-photo notifications, and anything else the broker delivers all arrive here and all correctly decline. Nothing is logged and nothing throws.
The shape, layer by layer, is the app's:
{ payload }, wherepayloadis an object OR a JSON string holding one — the same double-encoding the DP path already handles.payload.protocol === 41. A43here is a live photo and belongs to a different reader.payload.datacarrying all six ofchannel_id,clear_type,data_type,offset,dataandlen. The app refuses the message outright when any one is missing, and so does this: a frame missing a field is a frame this code does not understand, and half of it is worth nothing.data.data, hex, re-encoded to base64 — and rejected unless it is clean hex, because hex truncates in the one direction the frame's own length prefix cannot catch (see hexToRawDp).
Parameters
raw
unknown
Returns
BizMapFrame | undefined