forked from f4goh/DRAPRS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DRAPRS.h
118 lines (89 loc) · 2.52 KB
/
DRAPRS.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/********************************************************************************************
* VHF DRA818 APRS beacon Arduino library
* Created 6/6/2015
* Anthony LE CREN [email protected]
* Modified 25/02/2015
* Use this library freely
*
* Instance :
*
* Functions :
*
*******************************************************************************************/
#ifndef DRAPRS_H
#define DRAPRS_H
#include <Arduino.h>
//#include <SoftwareSerial.h>
class DRAPRS
{
public:
DRAPRS();
void begin(int p_bf, int p_led, int f1,int f2, int f3);
void sendpacket(unsigned char buffer[], unsigned char size_array);
void gpsnmea(char byteGPS);
void sinus();
void rttyTx(char * stringRtty);
void rttyTxByte (char c);
void hellTx( char * stringHell);
unsigned long computeDdsWord(double freq);
double freq;
int sync;
int led;
int bf;
double refclk;
byte flip_freq;
volatile unsigned long ddsAccu; // phase accumulator
volatile unsigned long ddsWord;
volatile unsigned long ddsWord0; // dds tuning word 0
volatile unsigned long ddsWord1; // dds tuning word 1
volatile unsigned long ddsWord2; // dds tuning word 1
typedef struct {
char hour[6+1];
char Latitude[9+1];
char NS;
char Longitude[10+1];
char EO;
byte fix;
char sat[2+1];
char altitude[7+1];
byte secondes; //secondes in byte from hour
byte minutes; //minutes in byte from hour
unsigned int pperiod; //second order
byte sync; //flag to send (matching for secondes%pperiod==0)
int32_t time;
boolean debug;
boolean dumpNmea;
byte mode;
char neo;
byte Ndelay;
int nbSat;
long altidudeMeters;
long altidudeFeet;
char feet[15];
} GGAstruct;
GGAstruct GPGGA; //declare la structure
volatile int sinusPtr;
volatile int countPtr;
volatile int shift;
byte ptrStartNmea;
private:
int32_t parseDecimal(const char *term);
int32_t timePrec;
unsigned int timeElapsed;
void send_bit(int tempo);
unsigned char flip;
byte validNmea(char byteGPS);
void sendbyte (unsigned char inbyte);
void fcsbit(unsigned short tbyte);
void flipout(void);
void clearGps(void);
unsigned char stuff,flag,fcsflag;
unsigned short crc;
int sentence_status; //0: recherche $, 1:recherche GPxxx, 2:GPGGA trouvé
char sentenceType[5+1]; //GPxxx
int ptr; //ptr for cahr arrays
int comma_count; //count , into sentences
//byte timeModulo;
};
extern DRAPRS Beacon;
#endif