@iotize/tap
Version:
IoTize Device client for Javascript
27 lines (26 loc) • 1.43 kB
TypeScript
import { VariableFormat } from '@iotize/tap';
import { BodyConverter } from '@iotize/tap/client/api';
import { StringConverter } from '@iotize/tap/client/impl';
import { VariableConfig } from '@iotize/tap/config/schema/v1';
import { VariableType } from '@iotize/tap/service/impl/variable';
export declare const ASCII_WITH_END_OF_STRING_CHAR_CONVERTER: StringConverter;
export declare function computeByteLengthFromFormat(info: {
length: number;
format: VariableFormat;
}): number;
export declare function computeBitLengthFromFormat(info: {
length: number;
format: VariableFormat;
}): number;
export declare function variableFormatToByteSize(format: VariableFormat): number;
export declare function variableFormatToBitSize(format: VariableFormat): 1 | 8 | 16 | 32;
export declare function variableDataTypeToByteSize(dataType: VariableType.Data): number;
export declare function getConverterFromVariableConfig(variableConfig: VariableConfig, stringConverter?: BodyConverter<string>): BodyConverter<any> | undefined;
/**
* Get converter from variable type and length (number of element)
* @param dataType
* @param length > 1 if it's an array.
*
* @return undefined if converter does not exist for the given type
*/
export declare function getConverterFromVariableType(dataType: VariableType.Data, length?: number, stringConverter?: BodyConverter<string>): BodyConverter<any> | undefined;