diff --git a/src/protocols/AFSK/AFSK.cpp b/src/protocols/AFSK/AFSK.cpp index 003c729d..bbf25b3a 100644 --- a/src/protocols/AFSK/AFSK.cpp +++ b/src/protocols/AFSK/AFSK.cpp @@ -1,12 +1,12 @@ #include "AFSK.h" #if !defined(RADIOLIB_EXCLUDE_AFSK) -AFSKClient::AFSKClient(PhysicalLayer* phy, uint32_t pin): _pin(pin) { - _phy = phy; +AFSKClient::AFSKClient(PhysicalLayer* phy, uint32_t pin): outPin(pin) { + phyLayer = phy; } int16_t AFSKClient::begin() { - return(_phy->startDirect()); + return(phyLayer->startDirect()); } int16_t AFSKClient::tone(uint16_t freq, bool autoStart) { @@ -15,23 +15,23 @@ int16_t AFSKClient::tone(uint16_t freq, bool autoStart) { } if(autoStart) { - int16_t state = _phy->transmitDirect(); + int16_t state = phyLayer->transmitDirect(); RADIOLIB_ASSERT(state); } - Module* mod = _phy->getMod(); - mod->hal->tone(_pin, freq); + Module* mod = phyLayer->getMod(); + mod->hal->tone(outPin, freq); return(RADIOLIB_ERR_NONE); } int16_t AFSKClient::noTone(bool keepOn) { - Module* mod = _phy->getMod(); - mod->hal->noTone(_pin); + Module* mod = phyLayer->getMod(); + mod->hal->noTone(outPin); if(keepOn) { return(0); } - return(_phy->standby()); + return(phyLayer->standby()); } #endif diff --git a/src/protocols/AFSK/AFSK.h b/src/protocols/AFSK/AFSK.h index bd125784..cdf6ebca 100644 --- a/src/protocols/AFSK/AFSK.h +++ b/src/protocols/AFSK/AFSK.h @@ -11,43 +11,34 @@ /*! \class AFSKClient - \brief Client for audio-based transmissions. Requires Arduino tone() function, and a module capable of direct mode transmission using DIO pins. */ class AFSKClient { public: /*! \brief Default contructor. - \param phy Pointer to the wireless module providing PhysicalLayer communication. - \param pin The pin that will be used for audio output. */ AFSKClient(PhysicalLayer* phy, uint32_t pin); /*! \brief Initialization method. - \returns \ref status_codes */ int16_t begin(); /*! \brief Start transmitting audio tone. - \param freq Frequency of the tone in Hz. - \param autoStart Whether to automatically enter transmission mode. Defaults to true. - \returns \ref status_codes */ int16_t tone(uint16_t freq, bool autoStart = true); /*! \brief Stops transmitting audio tone. - \param freq Keep transmitter on - this may limit noise when switching transmitter on or off. - \returns \ref status_codes */ int16_t noTone(bool keepOn = false); @@ -55,8 +46,8 @@ class AFSKClient { #if !defined(RADIOLIB_GODMODE) private: #endif - PhysicalLayer* _phy; - uint32_t _pin; + PhysicalLayer* phyLayer; + uint32_t outPin; // allow specific classes access the private PhysicalLayer pointer friend class RTTYClient;