-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathlib.h
More file actions
106 lines (86 loc) · 2.69 KB
/
lib.h
File metadata and controls
106 lines (86 loc) · 2.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#pragma once
#include <stdint.h>
#include <stdlib.h>
#include "wifibroadcast.h"
typedef struct {
uint32_t received_packet_cnt;
uint32_t wrong_crc_cnt;
int8_t current_signal_dbm;
int8_t type; // 0 = Atheros, 1 = Ralink
int signal_good;
} wifi_adapter_rx_status_t;
//typedef struct {
// uint32_t received_packet_cnt;
// uint32_t wrong_crc_cnt;
// int8_t current_signal_dbm;
// int8_t type; // 0 = Atheros, 1 = Ralink
//} wifi_adapter_rx_status_t_rc;
typedef struct {
time_t last_update;
uint32_t received_block_cnt;
uint32_t damaged_block_cnt;
uint32_t lost_packet_cnt;
uint32_t received_packet_cnt;
uint32_t lost_per_block_cnt;
uint32_t tx_restart_cnt;
uint32_t kbitrate;
uint32_t wifi_adapter_cnt;
wifi_adapter_rx_status_t adapter[MAX_PENUMBRA_INTERFACES];
} wifibroadcast_rx_status_t;
typedef struct {
time_t last_update;
uint32_t injected_block_cnt;
uint32_t skipped_fec_cnt;
uint32_t injection_fail_cnt;
long long injection_time_block;
} wifibroadcast_tx_status_t;
typedef struct {
time_t last_update;
uint32_t received_block_cnt;
uint32_t damaged_block_cnt;
uint32_t lost_packet_cnt;
uint32_t received_packet_cnt;
uint32_t lost_per_block_cnt;
uint32_t tx_restart_cnt;
uint32_t kbitrate;
uint32_t wifi_adapter_cnt;
wifi_adapter_rx_status_t adapter[MAX_PENUMBRA_INTERFACES];
} wifibroadcast_rx_status_t_rc;
typedef struct {
time_t last_update;
uint8_t cpuload;
uint8_t temp;
uint32_t injected_block_cnt;
uint32_t skipped_fec_cnt;
uint32_t injection_fail_cnt;
long long injection_time_block;
uint16_t bitrate_kbit;
uint16_t bitrate_measured_kbit;
uint8_t cts;
uint8_t undervolt;
} wifibroadcast_rx_status_t_sysair;
typedef struct {
int valid;
int crc_correct;
size_t len; //this is the actual length of the packet stored in data
uint8_t *data;
} packet_buffer_t;
//this sits at the payload of the wifi packet (outside of FEC)
typedef struct {
uint32_t sequence_number;
} __attribute__((packed)) wifi_packet_header_t;
//this sits at the data payload (which is usually right after the wifi_packet_header_t) (inside of FEC)
typedef struct {
uint32_t data_length;
} __attribute__((packed)) payload_header_t;
packet_buffer_t *lib_alloc_packet_buffer_list(size_t num_packets, size_t packet_length);
// from OSD for rssitx and tx
typedef struct {
wifibroadcast_rx_status_t *rx_status;
wifibroadcast_rx_status_t_rc *rx_status_rc;
wifibroadcast_tx_status_t *tx_status;
} telemetry_data_t;
wifibroadcast_rx_status_t *telemetry_wbc_status_memory_open(void);
wifibroadcast_rx_status_t_rc *telemetry_wbc_status_memory_open_rc(void);
wifibroadcast_tx_status_t *telemetry_wbc_status_memory_open_tx(void);
//wifibroadcast_rx_status_t_sysair *telemetry_wbc_status_memory_open_sysair(void);