refactor: use Buffer.from and Buffer.alloc instead of new Buffer() (#957)
This commit is contained in:
committed by
László Monda
parent
999feea488
commit
82c9126d82
@@ -3,7 +3,7 @@ const uhk = require('./uhk');
|
||||
const device = uhk.getUhkDevice();
|
||||
|
||||
function readKeyboardState() {
|
||||
const payload = new Buffer([uhk.usbCommands.getDeviceState]);
|
||||
const payload = Buffer.from([uhk.usbCommands.getDeviceState]);
|
||||
console.log('Sending ', uhk.bufferToString(payload));
|
||||
device.write(uhk.getTransferData(payload));
|
||||
const receivedBuffer = device.readSync();
|
||||
|
||||
Reference in New Issue
Block a user