@apocaliss92/nodelink-js 0.4.32 → 0.4.33
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/README.md +34 -2
- package/dist/{chunk-5Z7NVPV6.js → chunk-OZL6C2YJ.js} +30 -1
- package/dist/chunk-OZL6C2YJ.js.map +1 -0
- package/dist/cli/rtsp-server.cjs +29 -0
- package/dist/cli/rtsp-server.cjs.map +1 -1
- package/dist/cli/rtsp-server.js +1 -1
- package/dist/index.cjs +29 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +29 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-5Z7NVPV6.js.map +0 -1
package/dist/cli/rtsp-server.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -20199,6 +20199,21 @@ var ReolinkBaichuanApi = class _ReolinkBaichuanApi {
|
|
|
20199
20199
|
// check every 10s
|
|
20200
20200
|
simpleEventWatchdogSilenceThresholdMs = 5 * 6e4;
|
|
20201
20201
|
// 5 min without events
|
|
20202
|
+
/**
|
|
20203
|
+
* Whether the silence-based resubscribe path of the watchdog is
|
|
20204
|
+
* enabled. On UDP (battery cameras) silence is the *normal* state
|
|
20205
|
+
* while the device sleeps — firing `ensureSimpleEventSubscribed`
|
|
20206
|
+
* every 5 minutes wakes the camera on every tick, drains the
|
|
20207
|
+
* battery, and is observably wrong because the cam emits a
|
|
20208
|
+
* sleep/awake push when it actually wakes for motion.
|
|
20209
|
+
*
|
|
20210
|
+
* Defaults: `false` on UDP, `true` on TCP / `auto`. The subscription-
|
|
20211
|
+
* failed recovery path (Case 2) stays active regardless — it only
|
|
20212
|
+
* runs when the connection is alive, doesn't wake anyone, and is
|
|
20213
|
+
* useful on every transport when the initial subscribe call lost
|
|
20214
|
+
* the response packet.
|
|
20215
|
+
*/
|
|
20216
|
+
eventWatchdogSilenceResubscribeEnabled = true;
|
|
20202
20217
|
statePollingInterval;
|
|
20203
20218
|
udpSleepInferenceInterval;
|
|
20204
20219
|
udpLastInferredSleepStateByChannel = /* @__PURE__ */ new Map();
|
|
@@ -21156,6 +21171,12 @@ var ReolinkBaichuanApi = class _ReolinkBaichuanApi {
|
|
|
21156
21171
|
} else {
|
|
21157
21172
|
this.eventResubscribeEnabled = opts.transport !== "udp";
|
|
21158
21173
|
}
|
|
21174
|
+
const explicitWatchdogResubscribe = opts.enableEventWatchdogSilenceResubscribe;
|
|
21175
|
+
if (typeof explicitWatchdogResubscribe === "boolean") {
|
|
21176
|
+
this.eventWatchdogSilenceResubscribeEnabled = explicitWatchdogResubscribe;
|
|
21177
|
+
} else {
|
|
21178
|
+
this.eventWatchdogSilenceResubscribeEnabled = opts.transport !== "udp";
|
|
21179
|
+
}
|
|
21159
21180
|
const maxSessions = opts.maxDedicatedSessionsBeforeReboot;
|
|
21160
21181
|
if (typeof maxSessions === "number" && Number.isFinite(maxSessions) && maxSessions > 0) {
|
|
21161
21182
|
this.maxDedicatedSessionsBeforeReboot = Math.floor(maxSessions);
|
|
@@ -21978,6 +21999,14 @@ var ReolinkBaichuanApi = class _ReolinkBaichuanApi {
|
|
|
21978
21999
|
if (this.simpleEventSubscribed && this.simpleEventLastReceivedAt > 0) {
|
|
21979
22000
|
const silence = now - this.simpleEventLastReceivedAt;
|
|
21980
22001
|
if (silence < this.simpleEventWatchdogSilenceThresholdMs) return;
|
|
22002
|
+
if (!this.eventWatchdogSilenceResubscribeEnabled) {
|
|
22003
|
+
this.logger.debug?.(
|
|
22004
|
+
`[ReolinkBaichuanApi] event watchdog: silence-based resubscribe disabled (UDP / battery), skipping`,
|
|
22005
|
+
{ host: this.host, silenceMs: silence }
|
|
22006
|
+
);
|
|
22007
|
+
this.simpleEventLastReceivedAt = now;
|
|
22008
|
+
return;
|
|
22009
|
+
}
|
|
21981
22010
|
(this.logger.warn ?? this.logger.log).call(
|
|
21982
22011
|
this.logger,
|
|
21983
22012
|
`[ReolinkBaichuanApi] event watchdog: no events for ${Math.round(silence / 6e4)} min, forcing resubscribe`,
|