[AX.25] Added assignment operator overload

pull/1095/head
jgromes 2024-05-12 19:49:28 +01:00
rodzic 0e28810bb0
commit e3f851ef6d
2 zmienionych plików z 20 dodań i 0 usunięć

Wyświetl plik

@ -213,6 +213,20 @@ AX25Client::AX25Client(const AX25Client& ax25)
#endif #endif
} }
AX25Client& AX25Client::operator=(const AX25Client& ax25) {
this->phyLayer = ax25.phyLayer;
this->sourceSSID = ax25.sourceSSID;
this->preambleLen = ax25.preambleLen;
strncpy(sourceCallsign, ax25.sourceCallsign, RADIOLIB_AX25_MAX_CALLSIGN_LEN);
#if !RADIOLIB_EXCLUDE_AFSK
if(ax25.bellModem) {
this->audio = ax25.audio;
this->bellModem = new BellClient(ax25.audio);
}
#endif
return(*this);
}
int16_t AX25Client::setCorrection(int16_t mark, int16_t space, float length) { int16_t AX25Client::setCorrection(int16_t mark, int16_t space, float length) {
BellModem_t modem; BellModem_t modem;
modem.freqMark = Bell202.freqMark + mark; modem.freqMark = Bell202.freqMark + mark;

Wyświetl plik

@ -255,6 +255,12 @@ class AX25Client {
\param ax25 AX25Client instance to copy. \param ax25 AX25Client instance to copy.
*/ */
AX25Client(const AX25Client& ax25); AX25Client(const AX25Client& ax25);
/*!
\brief Overload for assignment operator.
\param ax25 rvalue AX25Client.
*/
AX25Client& operator=(const AX25Client& ax25);
/*! /*!
\brief Set AFSK tone correction offset. On some platforms, this is required to get the audio produced \brief Set AFSK tone correction offset. On some platforms, this is required to get the audio produced