LoRa_APRS_iGate/src/TaskRadiolib.h

49 wiersze
1.1 KiB
C
Czysty Zwykły widok Historia

2022-04-02 01:20:16 +00:00
#ifndef TASK_LORA_H_
#define TASK_LORA_H_
2023-09-23 13:37:35 +00:00
#include "BoardFinder/BoardFinder.h"
#include "LoRaModem.h"
#include "System/TaskManager.h"
2022-04-02 01:20:16 +00:00
#include "project_configuration.h"
#include <APRS-Decoder.h>
2022-04-02 01:20:16 +00:00
class RadiolibTask : public Task {
public:
explicit RadiolibTask(TaskQueue<std::shared_ptr<APRSMessage>> &fromModem, TaskQueue<std::shared_ptr<APRSMessage>> &_toModem);
virtual ~RadiolibTask();
virtual bool setup(System &system) override;
virtual bool loop(System &system) override;
private:
2023-08-05 22:56:07 +00:00
LoRaModem *_modem;
2022-04-02 01:20:16 +00:00
2023-06-08 10:50:09 +00:00
bool _rxEnable;
bool _txEnable;
2022-04-02 01:20:16 +00:00
TaskQueue<std::shared_ptr<APRSMessage>> &_fromModem;
TaskQueue<std::shared_ptr<APRSMessage>> &_toModem;
2023-08-05 22:56:07 +00:00
static volatile bool _modemInterruptOccurred;
2023-06-08 10:50:09 +00:00
Timer _txWaitTimer;
bool _transmitFlag;
float _frequencyTx;
float _frequencyRx;
bool _frequenciesAreSame;
2022-04-02 01:20:16 +00:00
static void setFlag(void);
2023-06-08 10:50:09 +00:00
void startRX(System &system);
void startTX(System &system, String &str);
void handleModemInterrupt(System &system);
void handleTXing(System &system);
2022-04-02 09:50:54 +00:00
2023-06-08 10:50:09 +00:00
void decodeError(System &system, int16_t state);
2022-04-02 01:20:16 +00:00
};
#endif