/// /** * Crazyradio constants * These values were taken from (https://wiki.bitcraze.io/doc:crazyradio:usb:index) */ export declare const CRAZYRADIO: { VID: number; PID: number; }; export declare enum DATA_RATES { '250K' = 0, '1M' = 1, '2M' = 2, } export declare function GET_DATA_RATE(targetRate: number): "250K" | "1M" | "2M"; export declare enum RADIO_POWERS { '-18dBm' = 0, '-12dBm' = 1, '-6dBm' = 2, '0dBm' = 3, } export declare function GET_RADIO_POWER(targetPower: number): "-18dBm" | "-12dBm" | "-6dBm" | "0dBm"; export declare const BM_REQUEST_TYPE = 64; export declare const VENDOR_REQUESTS: { SET_RADIO_CHANNEL: number; SET_RADIO_ADDRESS: number; SET_DATA_RATE: number; SET_RADIO_POWER: number; SET_RADIO_ARD: number; SET_RADIO_ARC: number; ACK_ENABLE: number; SET_CONT_CARRIER: number; SCAN_CHANNELS: number; LAUNCH_BOOTLOADER: number; }; /** * Crazyflie Real-Time Protocol (CRTP) * These values were taken from (https://wiki.bitcraze.io/projects:crazyflie:crtp) */ export declare const PORTS: { CONSOLE: number; PARAMETERS: number; COMMANDER: number; LOGGING: number; COMMANDER_GENERIC: number; LINK_LAYER: number; }; export declare const MAX_PAYLOAD_SIZE = 31; export declare const CHANNELS: { TOC: number; PARAM: { READ: number; WRITE: number; MISC: number; }; LOG: { CTRL: number; DATA: number; }; }; export declare const COMMANDS: { TOC: { GET_ITEM: number; GET_INFO: number; }; PARAM_MISC: { SET_BY_NAME: number; }; LOG_CTRL: { CREATE_BLOCK: number; APPEND_BLOCK: number; DELETE_BLOCK: number; START_BLOCK: number; STOP_BLOCK: number; RESET_LOG: number; }; COMMANDER_GENERIC: { STOP: number; VELOCITY_WORLD: number; Z_DISTANCE: number; HOVER: number; }; }; /** * Parameter types * (https://wiki.bitcraze.io/doc:crazyflie:crtp:param#toc_access) */ export declare enum PARAM_TYPES { int8 = 0, int16 = 1, int32 = 2, int64 = 3, fp16 = 5, float = 6, double = 7, uInt8 = 8, uInt16 = 9, uInt32 = 10, uInt64 = 11, } export declare type Type = keyof typeof PARAM_TYPES; export declare function GET_PARAM_TYPE(typeValue: number): "int8" | "int16" | "int32" | "int64" | "fp16" | "float" | "double" | "uInt8" | "uInt16" | "uInt32" | "uInt64"; /** * Logging types * (https://wiki.bitcraze.io/projects:crazyflie:firmware:log#firmware_usage) */ export declare enum LOGGING_TYPES { uInt8 = 1, uInt16 = 2, uInt32 = 3, int8 = 4, int16 = 5, int32 = 6, float = 7, fp16 = 8, } export declare function GET_LOGGING_TYPE(typeValue: number): "int8" | "int16" | "int32" | "fp16" | "float" | "uInt8" | "uInt16" | "uInt32"; /** * Possible logging errors * (https://wiki.bitcraze.io/projects:crazyflie:firmware:comm_protocol#variable_format) */ export declare const BLOCK_ERRORS: { [status: number]: { name: string; message: string; }; }; /** * Buffers used for things */ export declare const BUFFERS: { NOTHING: Buffer; SOMETHING: Buffer; }; /** * Factory to return read and write functions for a buffer * We need to bind the `this` context to the functions otherwise it won't work * @TODO Implement i64/u64/fp16 functions and get rid of Partial */ export declare function BUFFER_TYPES(buffer: Buffer): Partial>; export interface TypeData { size: number; read: (offset: number, noAssert?: boolean) => number; write: (value: number, offset: number, noAssert?: boolean) => number; }