UNPKG

@danidoble/webserial-vending-commands

Version:
34 lines (33 loc) 798 B
var a = Object.defineProperty; var o = (c, t, i) => t in c ? a(c, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : c[t] = i; var s = (c, t, i) => o(c, typeof t != "symbol" ? t + "" : t, i); import { p as h } from "./parser-DRICA5j-.js"; const n = class n { build(t) { return t[3] = this.withChecksum(t), h(t); } withChecksum(t) { let i = 0; return t.forEach((r, u) => { u !== 3 && (i += r); }), i; } static connection(t = 1) { return n.instance.build([160, t, 0, 161]); } static deactivate(t = 1) { return n.connection(t); } static activate() { return n.instance.build([160, 1, 1, 162]); } static custom(t) { return n.instance.build(t); } }; s(n, "instance"); let e = n; e.instance = new e(); export { e as Relay };