This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| syntax = "proto3"; | |
| package hwid; | |
| message PortalToApp { | |
| uint32 timestampMs = 1; | |
| Event event = 2; | |
| DeviceInfo deviceInfo = 3; | |
| CommandResponse commandResponse = 4; | |
| bytes accessoryMessage = 5; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| exports.bitShiftLeft = function (buffer) { | |
| var shifted = Buffer.alloc(buffer.length); | |
| var last = buffer.length - 1; | |
| for (var index = 0; index < last; index++) { | |
| shifted[index] = buffer[index] << 1; | |
| if (buffer[index + 1] & 0x80) { | |
| shifted[index] += 0x01; | |
| } | |
| } | |
| shifted[last] = buffer[last] << 1; |
OlderNewer