/* Copyright (c) 2016-2020 Peter Antypas This file is part of the MAIANAâ„¢ transponder firmware. The firmware is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see */ #ifndef RADIOMANAGER_HPP_ #define RADIOMANAGER_HPP_ #include "Receiver.hpp" #include "Transceiver.hpp" #include "GPS.hpp" #include "TXPacket.hpp" #include "CircularQueue.hpp" #include "EventQueue.hpp" #include "AISChannels.h" class RadioManager : public GPSDelegate, public EventConsumer { public: static RadioManager &instance(); void init(); void start(); void onBitClock(uint8_t ic); void timeSlotStarted(uint32_t slotNumber); void scheduleTransmission(TXPacket *p); bool initialized(); void sendTestPacketNow(TXPacket *p); void processEvent(const Event &e); void transmitCW(VHFChannel channel); VHFChannel alternateChannel(VHFChannel channel); void noiseFloorUpdated(VHFChannel channel, uint8_t rssi); private: RadioManager(); void spiOff(); void configureInterrupts(); private: Transceiver *mTransceiverIC; Receiver *mReceiverIC; bool mInitializing; CircularQueue *mTXQueue; time_t mUTC; }; #endif /* RADIOMANAGER_HPP_ */