Skip to content

Commit

Permalink
fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
gniezen committed May 29, 2019
1 parent cae46fe commit d05aaf4
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/drivers/medtronic600/medtronic600Driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -1701,19 +1701,20 @@ class ReadHistoryCommand extends TransmitPacketRequest {
for (let i = 0; i < blockPayload.length / ReadHistoryCommand.BLOCK_SIZE; i++) {
const blockSize = blockPayload
.readUInt16BE(((i + 1) * ReadHistoryCommand.BLOCK_SIZE) - 4);
const blockChecksum = blockPayload
.readUInt16BE(((i + 1) * ReadHistoryCommand.BLOCK_SIZE) - 2);
// const blockChecksum = blockPayload
// .readUInt16BE(((i + 1) * ReadHistoryCommand.BLOCK_SIZE) - 2);

const blockStart = i * ReadHistoryCommand.BLOCK_SIZE;
const blockData = blockPayload.slice(blockStart, blockStart + blockSize);
const calculatedChecksum = NGPMessage.ccittChecksum(blockData, blockSize);
// const calculatedChecksum = NGPMessage.ccittChecksum(blockData, blockSize);

// if (blockChecksum !== calculatedChecksum) {
// throw new ChecksumError(blockChecksum, calculatedChecksum, `Unexpected checksum in block ${i}`);
// throw new ChecksumError(blockChecksum, calculatedChecksum,
// `Unexpected checksum in block ${i}`);
// } else {
console.log('NOTE: Not validating checksums in this test version!');
this.blocks.push(blockData);
//}
this.blocks.push(blockData);
// }
}

this.bytesFetched += blockPayload.length;
Expand Down

0 comments on commit d05aaf4

Please sign in to comment.