From 07342d66298a4cc64057affe8742ae75bdf9e675 Mon Sep 17 00:00:00 2001 From: DavidVentura Date: Sun, 28 Jan 2024 20:16:00 +0100 Subject: [PATCH] add DevStatus type --- datatypes.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/datatypes.ts b/datatypes.ts index 812036b..4e87ea7 100644 --- a/datatypes.ts +++ b/datatypes.ts @@ -24,12 +24,17 @@ export const Commands = { }; // Record { - acc[Commands[cur]] = cur; +type t = Record; +export const CommandsByValue: t = Object.keys(Commands).reduce((acc: t, cur) => { + let key: keyof typeof Commands = cur as keyof typeof Commands; + acc[Commands[key]] = key; return acc; }, {}); +export const DrwStart = 0x0a11; export const ControlCommands = { ConnectUser: 0x2010, ConnectUserAck: 0x2011, + DevStatus: 0x0810, + DevStatusAck: 0x0811, };