SysIo
1.9.0
Embedded Library and tools
Main Page
Modules
Classes
Examples
ax25.hpp
1
9
#ifndef _SYSIO_AX25_HPP_
10
#define _SYSIO_AX25_HPP_
11
12
#include <string>
13
14
struct
xAx25Node
;
15
struct
xAx25Frame
;
16
struct
xAx25
;
17
28
class
Ax25Node
{
29
30
public
:
31
Ax25Node
(
const
char
*callsign =
"nocall"
);
32
Ax25Node
(
struct
xAx25Node
*p);
33
~
Ax25Node
();
34
void
clear();
35
36
void
setCallsign (
const
char
*str);
37
const
char
* getCallsign()
const
;
38
39
void
setSsid (
unsigned
char
ssid);
40
unsigned
char
getSsid()
const
;
41
42
void
setFlag (
bool
flag);
43
bool
getFlag()
const
;
44
45
const
char
* toStr();
46
47
private
:
48
struct
xAx25Node
*p;
49
std::string _tostr;
50
};
51
52
//##############################################################################
53
//# #
54
//# xAx25Frame Class #
55
//# #
56
//##############################################################################
57
class
Ax25
;
61
class
Ax25Frame
{
62
63
public
:
64
static
const
unsigned
char
maxRepeater;
65
enum
{
66
CTRL_UI = 0x03,
67
PID_NOLAYER3 = 0xF0
68
};
69
70
Ax25Frame
(
const
char
*dst =
"nocall"
,
const
char
*src =
"nocall"
);
71
Ax25Frame
(
struct
xAx25Frame
*p);
72
~
Ax25Frame
();
73
void
clear();
74
75
Ax25Node
& getSrc();
76
Ax25Node
& getDst();
77
Ax25Node
& repeater (
unsigned
char
index);
78
unsigned
char
getReplen()
const
;
79
void
addRepeater (
const
char
*str,
unsigned
char
ssid = 0);
80
void
setRepeaterFlag (
unsigned
char
index,
bool
flag);
81
82
void
setCtrl (
unsigned
char
ctrl);
83
unsigned
char
getCtrl()
const
;
84
85
void
setPid (
unsigned
char
pid);
86
unsigned
char
getPid()
const
;
87
88
void
setInfo (
const
char
*msg,
size_t
len);
89
const
char
* getInfo()
const
;
90
size_t
getInfolen()
const
;
91
92
const
char
* toStr();
93
94
private
:
95
friend
class
Ax25
;
96
std::string _tostr;
97
Ax25Node
*_src;
98
Ax25Node
*_dst;
99
Ax25Node
**_rep;
100
101
protected
:
102
struct
xAx25Frame
*p;
103
};
104
105
//##############################################################################
106
//# #
107
//# xAx25 Class #
108
//# #
109
//##############################################################################
113
class
Ax25
{
114
115
public
:
116
enum
{
117
CTRL_UI = 0x03,
118
PID_NOLAYER3 = 0xF0,
119
SUCCESS = 0,
120
FILE_ACCESS_ERROR = -1,
121
ILLEGAL_CALLSIGN = -2,
122
INVALID_FRAME = -3,
123
CRC_ERROR = -4,
124
NOT_ENOUGH_MEMORY = -5,
125
NOT_ENOUGH_REPEATER = -6,
126
OBJECT_NOT_FOUND = -7,
127
FILE_NOT_FOUND = -8,
128
ILLEGAL_REPEATER = -9,
129
NO_FRAME_RECEIVED = -10
130
};
131
132
Ax25
();
133
~
Ax25
();
134
void
clear();
135
int
getError();
136
137
void
setFdout (
int
fdo);
138
int
getFdout()
const
;
139
void
setFdin (
int
fdi);
140
int
getFdin()
const
;
141
142
bool
poll();
143
void
send (
const
Ax25Frame
&f);
144
void
send (
const
Ax25Frame
*f);
145
void
read (
Ax25Frame
&f);
146
void
read (
Ax25Frame
*f);
147
148
private
:
149
struct
xAx25
*p;
150
};
156
/* ========================================================================== */
157
#endif
/* _SYSIO_AX25_HPP_ */
Ax25Node
Definition:
ax25.hpp:28
xAx25
Definition:
ax25.h:295
xAx25Frame
Definition:
ax25.h:177
xAx25Node
Definition:
ax25.h:102
Ax25Frame
Definition:
ax25.hpp:61
Ax25
Definition:
ax25.hpp:113
radio
include
radio
ax25.hpp
Generated on Sun Mar 11 2018 00:54:46 for SysIo by
1.8.11