Skip to content

@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:

  1. { payload }, where payload is an object OR a JSON string holding one — the same double-encoding the DP path already handles.
  2. payload.protocol === 41. A 43 here is a live photo and belongs to a different reader.
  3. payload.data carrying all six of channel_id, clear_type, data_type, offset, data and len. 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.
  4. 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

Independent and unofficial. Not affiliated with, endorsed by, or sponsored by Anker Innovations, Anker eufy, or eufy. "Anker eufy", "eufy" and "Anker" are trademarks of their respective owners. Use responsibly — rapid or failed logins can trigger captcha or temporary cooldowns.