# RadioLib: src/protocols/APRS/APRS.h Source File

APRS.h
#if !defined(_RADIOLIB_RADIOLIB_APRS_H)
#define _RADIOLIB_RADIOLIB_APRS_H
#include "../../TypeDef.h"
#if !defined(RADIOLIB_EXCLUDE_APRS)
#include "../PhysicalLayer/PhysicalLayer.h"
#include "../AX25/AX25.h"
// APRS data type identifiers
#define RADIOLIB_APRS_DATA_TYPE_POSITION_NO_TIME_NO_MSG "!"
#define RADIOLIB_APRS_DATA_TYPE_GPS_RAW "$"
#define RADIOLIB_APRS_DATA_TYPE_ITEM ")"
#define RADIOLIB_APRS_DATA_TYPE_TEST ","
#define RADIOLIB_APRS_DATA_TYPE_POSITION_TIME_NO_MSG "/"
#define RADIOLIB_APRS_DATA_TYPE_MSG ":"
#define RADIOLIB_APRS_DATA_TYPE_OBJECT ";"
#define RADIOLIB_APRS_DATA_TYPE_STATION_CAPABILITES "<"
#define RADIOLIB_APRS_DATA_TYPE_POSITION_NO_TIME_MSG "="
#define RADIOLIB_APRS_DATA_TYPE_STATUS ">"
#define RADIOLIB_APRS_DATA_TYPE_QUERY "?"
#define RADIOLIB_APRS_DATA_TYPE_POSITION_TIME_MSG "@"
#define RADIOLIB_APRS_DATA_TYPE_TELEMETRY "T"
#define RADIOLIB_APRS_DATA_TYPE_MAIDENHEAD_BEACON "["
#define RADIOLIB_APRS_DATA_TYPE_WEATHER_REPORT "_"
#define RADIOLIB_APRS_DATA_TYPE_USER_DEFINED "{"
#define RADIOLIB_APRS_DATA_TYPE_THIRD_PARTY "}"
#define RADIOLIB_APRS_MIC_E_TYPE_OFF_DUTY 0b00000111
#define RADIOLIB_APRS_MIC_E_TYPE_EN_ROUTE 0b00000110
#define RADIOLIB_APRS_MIC_E_TYPE_IN_SERVICE 0b00000101
#define RADIOLIB_APRS_MIC_E_TYPE_RETURNING 0b00000100
#define RADIOLIB_APRS_MIC_E_TYPE_COMMITTED 0b00000011
#define RADIOLIB_APRS_MIC_E_TYPE_SPECIAL 0b00000010
#define RADIOLIB_APRS_MIC_E_TYPE_PRIORITY 0b00000001
#define RADIOLIB_APRS_MIC_E_TYPE_EMERGENCY 0b00000000
// magic offset applied to encode extra bits in the Mic-E destination field
#define RADIOLIB_APRS_MIC_E_DEST_BIT_OFFSET 25
// Mic-E data types
#define RADIOLIB_APRS_MIC_E_GPS_DATA_CURRENT '`'
#define RADIOLIB_APRS_MIC_E_GPS_DATA_OLD '\''
// Mic-E telemetry flags
#define RADIOLIB_APRS_MIC_E_TELEMETRY_LEN_2 '`'
#define RADIOLIB_APRS_MIC_E_TELEMETRY_LEN_5 '\''
// alias for unused altitude in Mic-E
#define RADIOLIB_APRS_MIC_E_ALTITUDE_UNUSED -1000000
class APRSClient {
public:
explicit APRSClient(AX25Client* ax);
// basic methods
int16_t begin(char sym, bool alt = false);
int16_t sendPosition(char* destCallsign, uint8_t destSSID, char* lat, char* lon, char* msg = NULL, char* time = NULL);
int16_t sendMicE(float lat, float lon, uint16_t heading, uint16_t speed, uint8_t type, uint8_t* telem = NULL, size_t telemLen = 0, char* grid = NULL, char* status = NULL, int32_t alt = RADIOLIB_APRS_MIC_E_ALTITUDE_UNUSED);
int16_t sendFrame(char* destCallsign, uint8_t destSSID, char* info);
#if !defined(RADIOLIB_GODMODE)
private:
#endif
AX25Client* axClient;
// default APRS symbol (car)
char symbol = '>';
char table = '/';
};
#endif
#endif
APRSClient
Client for APRS communication.
Definition: APRS.h:65
APRSClient::sendFrame
int16_t sendFrame(char *destCallsign, uint8_t destSSID, char *info)
Transmit generic APRS frame.
Definition: APRS.cpp:221
APRSClient::APRSClient
APRSClient(AX25Client *ax)
Default constructor.
Definition: APRS.cpp:7
APRSClient::begin
int16_t begin(char sym, bool alt=false)
Initialization method.
Definition: APRS.cpp:11
APRSClient::sendPosition
int16_t sendPosition(char *destCallsign, uint8_t destSSID, char *lat, char *lon, char *msg=NULL, char *time=NULL)
Transmit position.
Definition: APRS.cpp:24
APRSClient::sendMicE
int16_t sendMicE(float lat, float lon, uint16_t heading, uint16_t speed, uint8_t type, uint8_t *telem=NULL, size_t telemLen=0, char *grid=NULL, char *status=NULL, int32_t alt=RADIOLIB_APRS_MIC_E_ALTITUDE_UNUSED)
Transmit position using Mic-E encoding.
Definition: APRS.cpp:61
AX25Client
Client for AX25 communication.
Definition: AX25.h:238