diff --git a/sdk/commands/config.ts b/sdk/commands/config.ts index f14693d..55c9a73 100644 --- a/sdk/commands/config.ts +++ b/sdk/commands/config.ts @@ -348,12 +348,15 @@ export class SMXConfig { /** * Take in the data array and decode it into this. */ - constructor(data: Array, firmware_version: number) { - this.firmwareVersion = firmware_version; + constructor(data: Array, firmwareVersion: number) { + this.firmwareVersion = firmwareVersion; + console.log("Config Firmware Version: ", this.firmwareVersion); + console.log("CONFIG RAW DATA: ", data.toString()); if (this.firmwareVersion >= 5) { this.config = smx_config_t.decode(data.slice(2, -1), true); } else { + console.log("Reading Old Config"); this.oldConfig = smx_old_config_t.decode(data.slice(2, -1), true); this.config = this.convertOldToNew(this.oldConfig); } @@ -365,6 +368,7 @@ export class SMXConfig { } if (!this.oldConfig) throw new ReferenceError("Can not encode old config as it is null"); + console.log("Writing Old Config"); this.convertNewToOld(); return Array.from(new Uint8Array(smx_old_config_t.encode(this.oldConfig, true).buffer)); } diff --git a/sdk/commands/data_info.ts b/sdk/commands/data_info.ts index beff915..563da69 100644 --- a/sdk/commands/data_info.ts +++ b/sdk/commands/data_info.ts @@ -23,6 +23,7 @@ export class SMXDeviceInfo { player = 0; constructor(data: Array) { + console.log("DEVICEINFO RAW DATA: ", data.toString()); this.#decode(data); } diff --git a/sdk/packet.ts b/sdk/packet.ts index 3f984a9..bb8e113 100644 --- a/sdk/packet.ts +++ b/sdk/packet.ts @@ -28,12 +28,11 @@ export async function send_data(dev: HIDDevice, data: Array, debug = fal // Split data into packets const packets = make_packets(data); - if (debug) { - console.log("Sending Packets: ", packets); - } - // Send each packet for (const packet of packets) { + if (debug) { + console.log("OUTGOING RAW PACKET: ", packet.toString()); + } await dev.sendReport(HID_REPORT_OUTPUT, packet); } } diff --git a/sdk/smx.ts b/sdk/smx.ts index 1c4c804..2f0af43 100644 --- a/sdk/smx.ts +++ b/sdk/smx.ts @@ -147,8 +147,6 @@ export class SMXStage { * SET_PANEL_TEST_MODE * * Double Stretch Goal: - * GET_CONFIG (old firmware) - * WRITE_CONFIG (old_firmware) * SET_SERIAL_NUMBERS */ diff --git a/sdk/state-machines/collate-packets.ts b/sdk/state-machines/collate-packets.ts index 070e818..9417652 100644 --- a/sdk/state-machines/collate-packets.ts +++ b/sdk/state-machines/collate-packets.ts @@ -31,7 +31,7 @@ export const collatePackets: StateF = (st let currentPacket = state.currentPacket; const data = new Uint8Array(event.value.buffer); - // console.log("Raw Packet Data: ", data); + console.log("INCOMING RAW PACKET: ", data.toString()); // Return if packet is empty if (data.length <= PACKET_PREAMBLE_SIZE) {