@iotize/tap
Version:
IoTize Device client for Javascript
32 lines (31 loc) • 929 B
TypeScript
/**
* Created by IoTize on 19/04/2018.
* <p>
* Glue packet chunk to build the original ble packet
* @param {number} bufferLength
* @class
*/
export declare class BLEPacketBuilder {
bufferOffset: number;
protected data: Uint8Array;
dataLength: number;
constructor(bufferLength: number);
/**
* Append new chunk of data into the builder
* @param {Array} dataChunk the data chunk. The first byte must be the position offset of this chunk in the buffer (in bytes)
*/
append(dataChunk: Uint8Array): void;
reset(): void;
hasAllChunks(): boolean;
isChecksumValid(): boolean;
getComputedChecksum(): number;
getExpectedChecksum(): number;
/**
* @return {Array} the result data without the checksum
*/
getData(): Uint8Array;
/**
* @return {Array} the buffer (with the checksum)
*/
getBuffer(): Uint8Array;
}