]> git.defcon.no Git - hm-trp-tool/blob - hm-trp.h
I forgot, all source needs README and licensing
[hm-trp-tool] / hm-trp.h
1 #ifndef _HM_TRP_H
2 #define _HM_TRP_H
3
4 #include <string.h> /* String function definitions */
5 #include <stdint.h> /* uint*_t types */
6 #include <byteswap.h> /* __bwap_{16,32} */
7 #include "serial.h"
8
9 typedef struct {
10 uint32_t freq;
11 uint32_t air_rate;
12 uint16_t bw;
13 uint8_t deviation;
14 uint8_t power;
15 uint32_t uart_rate;
16 } config_t;
17
18 extern const int count_devtype;
19 extern const char* dev_name[4];
20
21 extern const uint32_t freq_min[4];
22 extern const uint32_t freq_max[4];
23 extern const uint32_t freq_default[4];
24
25 extern const int count_recv_bw;
26 extern const int recv_bw[12];
27
28 extern const int count_freq_dev;
29 extern const int freq_dev[10];
30
31 extern const int count_powerlevel;
32 extern const int powerlevel[8];
33
34 extern const int count_rates;
35 extern const int port_rate_value[9];
36 extern const int port_rates[9];
37
38 extern const char cmd_reset[3];
39 extern const char cmd_config[3];
40 extern const char cmd_frequency[3];
41 extern const char cmd_air_rate[3];
42 extern const char cmd_bw[3];
43 extern const char cmd_deviation[3];
44 extern const char cmd_power[3];
45 extern const char cmd_uart_rate[3];
46 extern const char cmd_RSSI[3];
47 extern const char cmd_SNR[3];
48
49 int write_uint32_t ( int f, uint32_t v );
50 int write_uint16_t ( int f, uint16_t v );
51 int write_uint8_t ( int f, uint8_t v );
52 int write_cmd ( int f, const char* buf );
53 int read_config ( int fd, config_t * config );
54
55 int read_ok( int fd );
56
57 #endif /* _HM_TRP_H */