From 7e3fbbfa47d148fd88953dfb97e2023dfef03c71 Mon Sep 17 00:00:00 2001 From: DavidVentura Date: Tue, 30 Jan 2024 11:37:04 +0100 Subject: [PATCH] impl reboot & p2pclose --- impl.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/impl.ts b/impl.ts index b65210e..056ccd3 100644 --- a/impl.ts +++ b/impl.ts @@ -82,6 +82,12 @@ export const SendStartVideo = (session: Session): DataView => { return makeDataReadWrite(session, ControlCommands.StartVideo, null); }; +export const SendReboot = (session: Session): DataView => { + //const dv = new DataView(new Uint8Array(8).fill(0).buffer); + let dv = null; + return makeDataReadWrite(session, ControlCommands.Reboot, dv); +}; + export const SendUsrChk = (session: Session, username: string, password: string): DataView => { let buf = new Uint8Array(0x20 + 0x80); buf.fill(0); @@ -114,3 +120,10 @@ export const create_P2pAlive = (): DataView => { outbuf.add(2).writeU16(0); return outbuf; }; + +export const create_P2pClose = (): DataView => { + const outbuf = new DataView(new Uint8Array(4).buffer); + outbuf.writeU16(Commands.Close); + outbuf.add(2).writeU16(0); + return outbuf; +};