-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathaprs.h
86 lines (74 loc) · 1.72 KB
/
aprs.h
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
#ifndef __aprs_h__
#define __aprs_h__
#include "fix.h"
#ifndef TEST
void aprs_prepare_buffer(struct gps_fix *fix, uint8_t backlog_fix);
void tx_aprs(void);
#else
uint8_t get_next_bit(void);
void aprs_init(void);
#endif
/* APRS destination SSID is 0 */
#define DST_SSID 0
/* APRS source SSID */
#define SRC_SSID 12
/* WIDE1-x SSID */
#define WIDE_SSID 1
/* data from matlab script */
#define APRS_MARK 0
#define APRS_SPACE 1
#define APRS_MARK_TICKS 11
#define APRS_SPACE_TICKS 6
#define APRS_BAUD_TICKS 22
/* AX.25 header consists of:
* 7 bytes source
* 7 bytes destination
* 7 bytes path
* 7 bytes repeater subfield
* 1 byte control field
* 1 byte PID field
*/
#define APRS_HEADER_LEN 23
#define PID_NONE 0xf0
#define CONTROL_UI 0x03
#define SSID_RESC 0x60
#define HEADER_END 0x01
#define APRS_TLM_TEMP_OFFSET 512
/*
* buffer length
* example: /ddhhmmz/xxxxyyyyOaa1|ss001122|
* 1 report indicator (real time, no APRS messaging)
* 2 + 2 + 2 + 1: day / hour / minute / zulu time indicator
* 1 symbol table
* 4 lat
* 4 lon
* 1 symbol
* 3 compressed alt + indicator
* 1 tlm delimiter
* 2 tlm sequence id
* 2 tlm temperature
* 2 tlm battery
* 2 tlm solar
* 1 tlm delimiter
*/
#define APRS_BUF_LEN 1 + 7 + 1 + 4 + 4 + 1 + 3 + 1 + 2 + 2 + 2 + 2 + 1
#define APRS_TIME_START 1
#define APRS_TIME_LEN 6
#define APRS_LAT_START 9
#define APRS_LAT_LEN 4
#define APRS_LON_START 13
#define APRS_LON_LEN 4
#define APRS_ALT_START 18
#define APRS_ALT_LEN 2
#define APRS_SEQ_START 22
#define APRS_SEQ_LEN 1
#define APRS_TEMP_START 24
#define APRS_TEMP_LEN 1
#define APRS_VOLT_START 26
#define APRS_VOLT_LEN 1
#define APRS_VSOL_START 28
#define APRS_VSOL_LEN 1
#define AX25_SFLAGS 75
#define AX25_EFLAGS 2
#define AX25_FLAG 0b01111110
#endif