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
@@ -5,7 +5,7 @@ const uhk = require('./uhk');
|
||||
const slaveId = parseInt(process.argv[2]);
|
||||
|
||||
const device = uhk.getUhkDevice();
|
||||
const sendData = new Buffer([uhk.usbCommands.getSlaveI2cErrors, slaveId]);
|
||||
const sendData = Buffer.from([uhk.usbCommands.getSlaveI2cErrors, slaveId]);
|
||||
device.write(uhk.getTransferData(sendData));
|
||||
const response = Buffer.from(device.readSync());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user