esp32_loraprs/ax25_payload.h

51 wiersze
848 B
C++

#ifndef AX25_PAYLOAD_H
#define AX25_PAYLOAD_H
#include <Arduino.h>
#include "ax25_callsign.h"
namespace AX25 {
class Payload
{
public:
Payload(byte *rxPayload, int payloadLength);
Payload(String inputText);
inline bool IsValid() const { return isValid_; }
String ToString(String customComment);
int ToBinary(byte *txPayload, int bufferLength) const;
bool Digirepeat(const String &ownCallsign);
void Dump();
private:
bool fromString(String inputText);
bool fromBinary(const byte *rxPayload, int payloadLength);
private:
enum AX25Ctrl {
UI = 0x03
};
enum AX25Pid {
NoLayer3 = 0xf0
};
const int CallsignSize = 7;
const int RptMaxCount = 7;
private:
bool isValid_;
Callsign srcCall_, dstCall_;
Callsign rptCalls_[7];
int rptCallsCount_;
String info_;
};
} // AX25
#endif // APRSMSG_H