fix index for command data

This commit is contained in:
Dan 2024-06-09 01:29:30 +00:00 committed by GitHub
parent eacce2e00c
commit ee90585a0a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -437,7 +437,7 @@ class WebuiBridge {
// Get function name
const functionName: string = this.#getDataStrFromPacket(buffer8, this.#PROTOCOL_DATA);
// Get the raw data
const rawDataIndex: number = this.#PROTOCOL_DATA + 2 + functionName.length + 1;
const rawDataIndex: number = this.#PROTOCOL_DATA + functionName.length + 1;
const userRawData = buffer8.subarray(rawDataIndex);
if (this.#log) console.log(`WebUI -> CMD -> Send Raw ${buffer8.length} bytes to [${functionName}()]`);
// Call the user function, and pass the raw data