-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathax25_callsign.h
43 lines (31 loc) · 944 Bytes
/
ax25_callsign.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
#ifndef AX25_CALLSIGN_H
#define AX25_CALLSIGN_H
#include <Arduino.h>
namespace AX25 {
class Callsign
{
public:
Callsign();
Callsign(const Callsign &callsign);
Callsign& operator=(const Callsign &callsign);
Callsign(const byte *rxPayload, int payloadLength);
Callsign(const String &inputText);
inline bool IsValid() const { return isValid_; };
inline bool IsTrace() const { return call_.startsWith("TRACE"); }
inline bool IsWide() const { return call_.startsWith("WIDE"); }
inline bool IsPath() const { return IsWide(); }
String ToString(bool isDigirepeater=false) const;
bool ToBinary(byte *txPayload, size_t bufferLength) const;
bool Digirepeat();
private:
bool fromString(const String &callsign);
bool fromBinary(const byte *rxPtr, size_t payloadLength);
private:
const size_t CallsignSize = 7;
private:
bool isValid_;
String call_;
byte ssid_;
};
} // AX25
#endif // AX25_CALLSIGN_H