From 39489aeae6157b7d4104845456fcc018cb807ff3 Mon Sep 17 00:00:00 2001 From: jgromes Date: Sun, 16 Oct 2022 17:47:58 +0200 Subject: [PATCH] [AX25] Added override for Arduino String class transmit --- src/protocols/AX25/AX25.cpp | 4 ++++ src/protocols/AX25/AX25.h | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/protocols/AX25/AX25.cpp b/src/protocols/AX25/AX25.cpp index 87d97864..19e3c416 100644 --- a/src/protocols/AX25/AX25.cpp +++ b/src/protocols/AX25/AX25.cpp @@ -192,6 +192,10 @@ int16_t AX25Client::begin(const char* srcCallsign, uint8_t srcSSID, uint8_t prea return(_phy->startDirect()); } +int16_t AX25Client::transmit(String& str, const char* destCallsign, uint8_t destSSID) { + return(transmit(str.c_str(), destCallsign, destSSID)); +} + int16_t AX25Client::transmit(const char* str, const char* destCallsign, uint8_t destSSID) { // create control field uint8_t controlField = RADIOLIB_AX25_CONTROL_U_UNNUMBERED_INFORMATION | RADIOLIB_AX25_CONTROL_POLL_FINAL_DISABLED | RADIOLIB_AX25_CONTROL_UNNUMBERED_FRAME; diff --git a/src/protocols/AX25/AX25.h b/src/protocols/AX25/AX25.h index afc110b4..050c39ea 100644 --- a/src/protocols/AX25/AX25.h +++ b/src/protocols/AX25/AX25.h @@ -320,6 +320,19 @@ class AX25Client { */ int16_t begin(const char* srcCallsign, uint8_t srcSSID = 0x00, uint8_t preambleLen = 8); + /*! + \brief Transmit unnumbered information (UI) frame. + + \param str Data to be sent as Arduino String. + + \param destCallsign Callsign of the destination station. + + \param destSSID 4-bit SSID of the destination station (in case there are more stations with the same callsign). Defaults to 0. + + \returns \ref status_codes + */ + int16_t transmit(String& str, const char* destCallsign, uint8_t destSSID = 0x00); + /*! \brief Transmit unnumbered information (UI) frame.