mirror of
https://github.com/DevL0rd/SkyNX
synced 2024-11-21 18:43:03 +00:00
check buffer stream clip length
This commit is contained in:
parent
9db699f863
commit
b0b871c076
1 changed files with 4 additions and 1 deletions
|
@ -482,11 +482,14 @@ hidStreamClient.on('data', function (chunk) {
|
|||
if (hidDataBuffer.includes("ffffffffffffffff") && hidDataBuffer.includes("ffffffffffffff7")) {
|
||||
completeData = hidDataBuffer.split("ffffffffffffffff")[1].split("ffffffffffffff7")[0];
|
||||
hidDataBuffer = "";
|
||||
if (completeData.length != 416) {
|
||||
console.log("Incorrect data length: " + completeData.length + " - " + completeData);
|
||||
return
|
||||
}
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
var data = Buffer.from(completeData, 'hex');
|
||||
console.log(data)
|
||||
var hid = parseInputStruct(data);
|
||||
|
||||
var controllerCount = hid.get("controllerCount");
|
||||
|
|
Loading…
Reference in a new issue