diff --git a/cameras.txt b/cameras.txt deleted file mode 100644 index 55655ac..0000000 --- a/cameras.txt +++ /dev/null @@ -1,10 +0,0 @@ -# This is a simple name mapping for cameras, in the form -# -# CAMERA_ID=descriptive name -# -# Blank lines and lines starting with "#" are ignored. -# -# Any updates to this file require restarting the HTTP server. -# This file is meant to be updated manually, it is NOT updated dynamically. - -FTYC811847AGFDZ=Office camera diff --git a/cmd/bin.ts b/cmd/bin.ts index 8a2996a..a40c34d 100644 --- a/cmd/bin.ts +++ b/cmd/bin.ts @@ -17,10 +17,9 @@ yargs(hideBin(process.argv)) (yargs) => { return yargs .option("ansi", { default: false }) - .option("slow_startup", { default: false }) .option("audio", { describe: "Also stream audio from camera", default: true }) .option("color", { describe: "Use color in logs", default: undefined }) - .boolean(["ansi", "audio", "slow_startup", "color"]) + .boolean(["ansi", "audio", "color"]) .option("log_level", { describe: "Set log level", default: "info" }) .option("discovery_ip", { describe: "Camera discovery IP address", default: "192.168.1.255" }) .option("attempt_to_fix_packet_loss", { default: false }) @@ -43,9 +42,8 @@ yargs(hideBin(process.argv)) (yargs) => { return yargs .option("ansi", { default: false }) - .option("slow_startup", { default: false }) .option("color", { describe: "Use color in logs", default: undefined }) - .boolean(["ansi", "slow_startup", "color"]) + .boolean(["ansi", "color"]) .option("log_level", { describe: "Set log level", default: "info" }) .option("discovery_ip", { describe: "Camera discovery IP address", default: "192.168.1.255" }) .option("attempt_to_fix_packet_loss", { default: false }) diff --git a/options.ts b/options.ts index 3c3df45..cdb2602 100644 --- a/options.ts +++ b/options.ts @@ -1,6 +1,5 @@ export type opt = { ansi: boolean; discovery_ip: string; - slow_startup: boolean; attempt_to_fix_packet_loss: boolean; }; diff --git a/session.ts b/session.ts index cf125fd..61ff3d5 100644 --- a/session.ts +++ b/session.ts @@ -60,23 +60,11 @@ export const makeSession = ( sock.on("message", (msg, rinfo) => handleIncoming(session, handlers, msg, rinfo)); sock.on("listening", () => { - const startup = () => { - const buf = makeP2pRdy(dev); - session.send(buf); - // The YsxLite sends a P2PAlive message immediately after P2PRdy - const alive_buf = create_P2pAlive(); - session.send(alive_buf); - session.started = true; - }; - if (options.slow_startup) { - logger.info("Delaying session startup"); - setTimeout(startup, 6500); - } else { - startup(); - } + const buf = makeP2pRdy(dev); + session.send(buf); + session.started = true; }); - const SEND_PORT = 32108; sock.bind(); const sessTimer = setInterval(() => { const delta = Date.now() - session.lastReceivedPacket;