esp32_loraprs/include/ax25_callsign.h

44 wiersze
935 B
C

#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);
2020-06-19 07:39:49 +00:00
Callsign(const String &inputText);
inline bool IsValid() const { return isValid_; };
inline bool IsTrace() const { return call_.startsWith("TRACE"); }
2020-06-17 10:32:00 +00:00
inline bool IsWide() const { return call_.startsWith("WIDE"); }
inline bool IsPath() const { return IsWide(); }
2022-12-01 17:24:57 +00:00
String ToString(bool isDigirepeater=false) const;
bool ToBinary(byte *txPayload, int bufferLength) const;
bool Digirepeat();
private:
2020-06-17 10:32:00 +00:00
bool fromString(const String &callsign);
bool fromBinary(const byte *rxPtr, int payloadLength);
private:
const int CallsignSize = 7;
private:
bool isValid_;
String call_;
byte ssid_;
};
} // AX25
2021-02-02 09:22:38 +00:00
#endif // AX25_CALLSIGN_H