@mega-yfue/eufy-sdk 0.4.0-beta.14 → 0.4.0-beta.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -14378,6 +14378,11 @@ var ResponseMessageType = {
14378
14378
  LOOKUP_ADDR: Buffer.from([241, 64]),
14379
14379
  LOOKUP_ADDR2: Buffer.from([241, 130]),
14380
14380
  CAM_ID: Buffer.from([241, 66]),
14381
+ /**
14382
+ * The device's own address record, sent in answer to CHECK_CAM ahead of CAM_ID: its 20-byte device id, one
14383
+ * record in `encodeSelfAddress`'s shape naming the address it answers from, then 8 zero bytes (44-byte payload).
14384
+ */
14385
+ CAM_ADDR: Buffer.from([241, 67]),
14381
14386
  TURN_SERVER_CAM_ID: Buffer.from([241, 132]),
14382
14387
  PING: Buffer.from([241, 224]),
14383
14388
  PONG: Buffer.from([241, 225]),
@@ -15737,6 +15742,9 @@ var P2PSession = class _P2PSession extends EventEmitter2 {
15737
15742
  * straddling a level-2 wait on a camera whose failure to deliver video had a separate cause, and did not
15738
15743
  * recur across later probes of it. Correlate an unmodelled type against a WORKING session before reading it
15739
15744
  * as a cause.
15745
+ *
15746
+ * CAM_ADDR is recognised and dropped: it names the address the device is already answering from, and the
15747
+ * CAM_ID that follows it is what completes the connect.
15740
15748
  */
15741
15749
  onMessage(msg, rinfo, socket = this.socket) {
15742
15750
  if (!socket)
@@ -15767,7 +15775,7 @@ var P2PSession = class _P2PSession extends EventEmitter2 {
15767
15775
  } else if (hasHeader(msg, ResponseMessageType.DATA)) {
15768
15776
  if (this.connected)
15769
15777
  this.onData(msg, { host: rinfo.address, port: rinfo.port });
15770
- } else {
15778
+ } else if (!hasHeader(msg, ResponseMessageType.CAM_ADDR)) {
15771
15779
  this.logger.debug(`[p2p] ${this.cfg.stationSn} UNHANDLED payload hex: ${msg.toString("hex")}`);
15772
15780
  }
15773
15781
  }