-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDExtraLink.h
40 lines (29 loc) · 1.07 KB
/
DExtraLink.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
#ifndef DEXTRALINK_H
#define DEXTRALINK_H
#include <time.h>
#include <stdarg.h>
#include <netinet/in.h>
#include "DExtra.h"
#include "G2Link.h"
#include "GateModule.h"
#include "GateContext.h"
class DExtraLink : public G2Link
{
public:
DExtraLink(const char* call, const char* address, GateModule** modules, Observer* observer);
int getDefaultPort();
const char* getCall();
bool receiveData();
bool sendData(const struct sockaddr_in& address, uint16_t session, uint8_t sequence, uint32_t number, struct DStarRoute* route, struct DStarDVFrame* frame);
void disconnectAll();
void doBackgroundActivity();
private:
char call[LONG_CALLSIGN_LENGTH + 1];
GateModule** modules;
void connect(GateContext* context);
void disconnect(GateContext* context);
void handlePoll(const struct sockaddr_in& address, const struct DExtraPoll* data);
void handlePoll(const struct sockaddr_in& address, const struct DExtraPoll2* data);
void handleConnectReply(const struct sockaddr_in& address, const struct DExtraConnectReply* data);
};
#endif