UNPKG

hackrf.js

Version:
147 lines (146 loc) 3.77 kB
/** * Enums and constants */ /** */ export declare const SAMPLES_PER_BLOCK = 8192; export declare const BYTES_PER_BLOCK = 16384; export declare const MAX_SWEEP_RANGES = 10; export declare enum ErrorCode { /** invalid parameter(s) */ INVALID_PARAM = -2, /** HackRF not found */ NOT_FOUND = -5, /** HackRF busy */ BUSY = -6, /** insufficient memory */ NO_MEM = -11, /** USB error */ LIBUSB = -1000, /** transfer thread error */ THREAD = -1001, /** streaming thread encountered an error */ STREAMING_THREAD_ERR = -1002, /** streaming stopped */ STREAMING_STOPPED = -1003, /** streaming terminated */ STREAMING_EXIT_CALLED = -1004, /** feature not supported by installed firmware */ USB_API_VERSION = -1005, /** one or more HackRFs still in use */ NOT_LAST_DEVICE = -2000, /** unspecified error */ OTHER = -9999 } export declare const errorMessages: { [code: number]: string; }; export declare enum BoardId { JELLYBEAN = 0, JAWBREAKER = 1, HACKRF_ONE = 2, RAD1O = 3 } export declare const boardIdNames: { [boardId: number]: string; }; /** USB PIDs */ export declare enum UsbBoardId { JAWBREAKER = 24651, HACKRF_ONE = 24713, RAD1O = 52245 } export declare const usbBoardIdNames: { [usbBoardId: number]: string; }; export declare enum RfPathFilter { /** mixer bypass */ BYPASS = 0, /** low pass filter */ LOW_PASS = 1, /** high pass filter */ HIGH_PASS = 2 } export declare const rfPathFilterNames: { [rfPathFilter: number]: string; }; export declare enum OperacakePorts { PA1 = 0, PA2 = 1, PA3 = 2, PA4 = 3, PB1 = 4, PB2 = 5, PB3 = 6, PB4 = 7 } export declare enum SweepStyle { /** * `stepWidth` is added to the current frequency at each step */ LINEAR = 0, /** * invokes a scheme in which each step is divided into two * interleaved sub-steps, allowing the host to select the best portions * of the FFT of each sub-step and discard the rest. */ INTERLEAVED = 1 } export declare const FREQ_HZ_MIN = 0; /** 7250MHz */ export declare const FREQ_HZ_MAX = 7250000000; export declare const IF_HZ_MIN = 2150000000; export declare const IF_HZ_MAX = 2750000000; export declare const LO_FREQ_HZ_MIN = 84375000; export declare const LO_FREQ_HZ_MAX = 5400000000; /** 1.75 MHz min value */ export declare const BASEBAND_FILTER_BW_MIN = 1750000; /** 28 MHz max value */ export declare const BASEBAND_FILTER_BW_MAX = 28000000; export declare const USB_HACKRF_VID = 7504; export declare const USB_CONFIG_STANDARD = 1; export declare const USB_MAX_SERIAL_LENGTH = 32; export declare enum VendorRequest { SET_TRANSCEIVER_MODE = 1, MAX2837_WRITE = 2, MAX2837_READ = 3, SI5351C_WRITE = 4, SI5351C_READ = 5, SAMPLE_RATE_SET = 6, BASEBAND_FILTER_BANDWIDTH_SET = 7, RFFC5071_WRITE = 8, RFFC5071_READ = 9, SPIFLASH_ERASE = 10, SPIFLASH_WRITE = 11, SPIFLASH_READ = 12, BOARD_ID_READ = 14, VERSION_STRING_READ = 15, SET_FREQ = 16, AMP_ENABLE = 17, BOARD_PARTID_SERIALNO_READ = 18, SET_LNA_GAIN = 19, SET_VGA_GAIN = 20, SET_TXVGA_GAIN = 21, ANTENNA_ENABLE = 23, SET_FREQ_EXPLICIT = 24, USB_WCID_VENDOR_REQ = 25, INIT_SWEEP = 26, OPERACAKE_GET_BOARDS = 27, OPERACAKE_SET_PORTS = 28, SET_HW_SYNC_MODE = 29, RESET = 30, OPERACAKE_SET_RANGES = 31, CLKOUT_ENABLE = 32, SPIFLASH_STATUS = 33, SPIFLASH_CLEAR_STATUS = 34, OPERACAKE_GPIO_TEST = 35, CPLD_CHECKSUM = 36, UI_ENABLE = 37 } export declare enum TransceiverMode { OFF = 0, RECEIVE = 1, TRANSMIT = 2, SS = 3, CPLD_UPDATE = 4, RX_SWEEP = 5 }