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
@@ -4,7 +4,7 @@ const uhk = require('./uhk');
|
||||
const device = uhk.getUhkDevice();
|
||||
|
||||
function getAdcValue() {
|
||||
const data = uhk.getTransferData(new Buffer([uhk.usbCommands.getAdcValue]));
|
||||
const data = uhk.getTransferData(Buffer.from([uhk.usbCommands.getAdcValue]));
|
||||
console.log('Sending ', data);
|
||||
device.write(data);
|
||||
const receivedBuffer = Buffer.from(device.readSync());
|
||||
|
||||
Reference in New Issue
Block a user