@iotize/tap
Version:
IoTize Device client for Javascript
120 lines (119 loc) • 4.03 kB
TypeScript
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/
export interface SinglePacketStoreInfo {
state: SinglePacketStoreInfo.State;
}
export declare namespace SinglePacketStoreInfo {
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/
enum State {
UNAVAILABLE = 0,
EMPTY = 1,
USED = 2,
FULL = 3,
ERROR = 4
}
}
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/
export interface SinglePacket {
sendTime: number;
header: SinglePacket.Header;
payload: SinglePacket.Payload;
}
export declare namespace SinglePacket {
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/
interface Header {
/**
* Packet length is full size without send_time. When encoded, it is a multile of 16 when encryption is enabled and a multiple of 256 when is_extended is enabled
*/
packetLength: number;
packetId: number;
configVersion: number;
messageType: SinglePacket.PacketType;
/**
* if true, packet length is a multiple of 256 otherwise it's a multiple of 16
*/
isExtended: boolean;
encryption: boolean;
ack: boolean;
senderId: number;
salt: number;
}
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/
interface Payload {
logTime: number;
/**
* Same as packet_length, size depends on the unit. In case of a code_exec packet, this is not used
*/
dataSize?: number;
data: Uint8Array;
padding?: Uint8Array;
/**
* CRC32 is computed starting from field packet_length
*/
crc?: number;
}
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/
enum PacketType {
DATA_LOG = 1,
COMMAND = 2,
CODE_EXEC = 3,
CONF_UPDATE = 4,
SECURITY_TOKEN = 5,
TARGET_FW_UPDATE = 6,
MASK = 7
}
}
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/
export interface SinglePacketChunk {
/**
* Frame format
*/
format: SinglePacketChunk.Format;
/**
* Single packet chunk length. Actual byte length is multiplied by 16
*/
length?: number;
/**
* Single packet chunk offset in single packet store. Actual byte offset is multiplied by 16
*/
offset: number;
data: Uint8Array;
}
export declare namespace SinglePacketChunk {
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/
enum Format {
OFFSET_ON_2_BYTES = 0,
OFFSET_ON_4_BYTES = 8
}
}