1 #if !defined(_RADIOLIB_AX25_H)
2 #define _RADIOLIB_AX25_H
4 #include "../../TypeDef.h"
6 #if !RADIOLIB_EXCLUDE_AX25
8 #include "../PhysicalLayer/PhysicalLayer.h"
9 #include "../AFSK/AFSK.h"
10 #include "../BellModem/BellModem.h"
11 #include "../../utils/CRC.h"
14 #define SET_BIT_IN_ARRAY(A, k) ( A[(k/8)] |= (1 << (k%8)) )
15 #define CLEAR_BIT_IN_ARRAY(A, k) ( A[(k/8)] &= ~(1 << (k%8)) )
16 #define TEST_BIT_IN_ARRAY(A, k) ( A[(k/8)] & (1 << (k%8)) )
17 #define GET_BIT_IN_ARRAY(A, k) ( (A[(k/8)] & (1 << (k%8))) ? 1 : 0 )
20 #define RADIOLIB_AX25_MAX_CALLSIGN_LEN 6
23 #define RADIOLIB_AX25_FLAG 0b01111110
26 #define RADIOLIB_AX25_SSID_COMMAND_DEST 0b10000000
27 #define RADIOLIB_AX25_SSID_COMMAND_SOURCE 0b00000000
28 #define RADIOLIB_AX25_SSID_RESPONSE_DEST 0b00000000
29 #define RADIOLIB_AX25_SSID_RESPONSE_SOURCE 0b10000000
30 #define RADIOLIB_AX25_SSID_HAS_NOT_BEEN_REPEATED 0b00000000
31 #define RADIOLIB_AX25_SSID_HAS_BEEN_REPEATED 0b10000000
32 #define RADIOLIB_AX25_SSID_RESERVED_BITS 0b01100000
33 #define RADIOLIB_AX25_SSID_HDLC_EXTENSION_CONTINUE 0b00000000
34 #define RADIOLIB_AX25_SSID_HDLC_EXTENSION_END 0b00000001
37 #define RADIOLIB_AX25_CONTROL_U_SET_ASYNC_BAL_MODE 0b01101100
38 #define RADIOLIB_AX25_CONTROL_U_SET_ASYNC_BAL_MODE_EXT 0b00101100
39 #define RADIOLIB_AX25_CONTROL_U_DISCONNECT 0b01000000
40 #define RADIOLIB_AX25_CONTROL_U_DISCONNECT_MODE 0b00001100
41 #define RADIOLIB_AX25_CONTROL_U_UNNUMBERED_ACK 0b01100000
42 #define RADIOLIB_AX25_CONTROL_U_FRAME_REJECT 0b10000100
43 #define RADIOLIB_AX25_CONTROL_U_UNNUMBERED_INFORMATION 0b00000000
44 #define RADIOLIB_AX25_CONTROL_U_EXHANGE_IDENTIFICATION 0b10101100
45 #define RADIOLIB_AX25_CONTROL_U_TEST 0b11100000
46 #define RADIOLIB_AX25_CONTROL_POLL_FINAL_ENABLED 0b00010000
47 #define RADIOLIB_AX25_CONTROL_POLL_FINAL_DISABLED 0b00000000
48 #define RADIOLIB_AX25_CONTROL_S_RECEIVE_READY 0b00000000
49 #define RADIOLIB_AX25_CONTROL_S_RECEIVE_NOT_READY 0b00000100
50 #define RADIOLIB_AX25_CONTROL_S_REJECT 0b00001000
51 #define RADIOLIB_AX25_CONTROL_S_SELECTIVE_REJECT 0b00001100
52 #define RADIOLIB_AX25_CONTROL_INFORMATION_FRAME 0b00000000
53 #define RADIOLIB_AX25_CONTROL_SUPERVISORY_FRAME 0b00000001
54 #define RADIOLIB_AX25_CONTROL_UNNUMBERED_FRAME 0b00000011
57 #define RADIOLIB_AX25_PID_ISO_8208 0x01
58 #define RADIOLIB_AX25_PID_TCP_IP_COMPRESSED 0x06
59 #define RADIOLIB_AX25_PID_TCP_IP_UNCOMPRESSED 0x07
60 #define RADIOLIB_AX25_PID_SEGMENTATION_FRAGMENT 0x08
61 #define RADIOLIB_AX25_PID_TEXNET_DATAGRAM_PROTOCOL 0xC3
62 #define RADIOLIB_AX25_PID_LINK_QUALITY_PROTOCOL 0xC4
63 #define RADIOLIB_AX25_PID_APPLETALK 0xCA
64 #define RADIOLIB_AX25_PID_APPLETALK_ARP 0xCB
65 #define RADIOLIB_AX25_PID_ARPA_INTERNET_PROTOCOL 0xCC
66 #define RADIOLIB_AX25_PID_ARPA_ADDRESS_RESOLUTION 0xCD
67 #define RADIOLIB_AX25_PID_FLEXNET 0xCE
68 #define RADIOLIB_AX25_PID_NET_ROM 0xCF
69 #define RADIOLIB_AX25_PID_NO_LAYER_3 0xF0
70 #define RADIOLIB_AX25_PID_ESCAPE_CHARACTER 0xFF
128 #if !RADIOLIB_STATIC_ONLY
147 uint8_t
info[RADIOLIB_STATIC_ARRAY_SIZE];
246 #if !RADIOLIB_EXCLUDE_AFSK
261 int16_t
setCorrection(int16_t mark, int16_t space,
float length = 1.0f);
275 int16_t
begin(
const char* srcCallsign, uint8_t srcSSID = 0x00, uint8_t preLen = 8);
277 #if defined(RADIOLIB_BUILD_ARDUINO)
286 int16_t
transmit(String& str,
const char* destCallsign, uint8_t destSSID = 0x00);
297 int16_t
transmit(
const char* str,
const char* destCallsign, uint8_t destSSID = 0x00);
306 #if !RADIOLIB_GODMODE
312 #if !RADIOLIB_EXCLUDE_AFSK
316 char sourceCallsign[RADIOLIB_AX25_MAX_CALLSIGN_LEN + 1] = {0, 0, 0, 0, 0, 0, 0};
317 uint8_t sourceSSID = 0;
318 uint16_t preambleLen = 0;
320 void getCallsign(
char* buff);
Client for audio-based transmissions. Requires Arduino tone() function, and a module capable of direc...
Definition: AFSK.h:16
Client for APRS communication.
Definition: APRS.h:69
Client for AX25 communication.
Definition: AX25.h:238
int16_t sendFrame(AX25Frame *frame)
Transmit arbitrary AX.25 frame.
Definition: AX25.cpp:222
int16_t setCorrection(int16_t mark, int16_t space, float length=1.0f)
Set AFSK tone correction offset. On some platforms, this is required to get the audio produced by the...
Definition: AX25.cpp:168
int16_t transmit(const char *str, const char *destCallsign, uint8_t destSSID=0x00)
Transmit unnumbered information (UI) frame.
Definition: AX25.cpp:211
int16_t begin(const char *srcCallsign, uint8_t srcSSID=0x00, uint8_t preLen=8)
Initialization method.
Definition: AX25.cpp:180
AX25Client(PhysicalLayer *phy)
Constructor for 2-FSK mode.
Definition: AX25.cpp:154
Abstraction of AX.25 frame format.
Definition: AX25.h:76
void setSendSequence(uint8_t seqNumber)
Method to set send sequence number.
Definition: AX25.cpp:150
AX25Frame(const char *destCallsign, uint8_t destSSID, const char *srcCallsign, uint8_t srcSSID, uint8_t control)
Overloaded constructor, for frames without info field.
Definition: AX25.cpp:5
char ** repeaterCallsigns
Array of repeater callsigns.
Definition: AX25.h:137
char srcCallsign[RADIOLIB_AX25_MAX_CALLSIGN_LEN+1]
Callsign of the source station.
Definition: AX25.h:91
void setRecvSequence(uint8_t seqNumber)
Method to set receive sequence number.
Definition: AX25.cpp:146
uint16_t sendSeqNumber
Send sequence number.
Definition: AX25.h:126
uint8_t srcSSID
SSID of the source station.
Definition: AX25.h:96
AX25Frame & operator=(const AX25Frame &frame)
Overload for assignment operator.
Definition: AX25.cpp:75
uint8_t control
The control field.
Definition: AX25.h:106
uint8_t * repeaterSSIDs
Array of repeater SSIDs.
Definition: AX25.h:142
uint16_t infoLen
Number of bytes in the information field.
Definition: AX25.h:116
int16_t setRepeaters(char **repeaterCallsigns, uint8_t *repeaterSSIDs, uint8_t numRepeaters)
Method to set the repeater callsigns and SSIDs.
Definition: AX25.cpp:110
char destCallsign[RADIOLIB_AX25_MAX_CALLSIGN_LEN+1]
Callsign of the destination station.
Definition: AX25.h:81
uint8_t * info
The info field.
Definition: AX25.h:132
uint8_t protocolID
The protocol identifier (PID) field.
Definition: AX25.h:111
~AX25Frame()
Default destructor.
Definition: AX25.cpp:57
uint8_t numRepeaters
Number of repeaters to be used.
Definition: AX25.h:101
uint8_t rcvSeqNumber
Receive sequence number.
Definition: AX25.h:121
uint8_t destSSID
SSID of the destination station.
Definition: AX25.h:86
Client for Bell modem communication. The public interface is the same as Arduino Serial.
Definition: BellModem.h:57
Provides common interface for protocols that run on LoRa/FSK modules, such as RTTY or LoRaWAN....
Definition: PhysicalLayer.h:34