I'm tinkering w/ zwack (https://github.com/paixaop/zwack) and trying to see what(HEX) are being written to the buffer in an effort to try to simulate a FTMS machine/server
The code
onReadRequest(offset, callback) {
debugFTMS('[SupportedPowerRangeCharacteristic] onReadRequest');
let buffer = new Buffer.alloc(6);
let at = 0;
let minimumPower = 0;
buffer.writeInt16LE(minimumPower, at);
at += 2;
let maximumPower = 1000;
buffer.writeInt16LE(maximumPower, at);
at += 2;
let minimumIncrement = 1;
buffer.writeUInt16LE(minimumIncrement, at);
at += 2;
debugFTMS('[SupportedPowerRangeCharacteristic] onReadRequest:' + buffer);
console.log(buffer);
callback(this.RESULT_SUCCESS, buffer);
}
the console.log(buffer) command outputs
<Buffer 00 00 e8 03 01 00>
I would like to roll this up into the debug messages instead. Specifically into this line
debugFTMS('[SupportedPowerRangeCharacteristic] onReadRequest:' + buffer);
but the result I'm getting is some unprintable characters
ftms [SupportedPowerRangeCharacteristic] onReadRequest:� +0ms