mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-22 10:42:49 +00:00
trunk roundhouse kick
This commit is contained in:
@@ -1,22 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
#include "RadioInterface.h"
|
||||
#include "MeshPacketQueue.h"
|
||||
#include "RadioInterface.h"
|
||||
#include "api/WiFiServerAPI.h"
|
||||
|
||||
#include <RadioLib.h>
|
||||
|
||||
class SimRadio : public RadioInterface
|
||||
{
|
||||
enum PendingISR { ISR_NONE = 0, ISR_RX, ISR_TX, TRANSMIT_DELAY_COMPLETED };
|
||||
enum PendingISR { ISR_NONE = 0, ISR_RX, ISR_TX, TRANSMIT_DELAY_COMPLETED };
|
||||
|
||||
/**
|
||||
* Debugging counts
|
||||
*/
|
||||
uint32_t rxBad = 0, rxGood = 0, txGood = 0;
|
||||
/**
|
||||
* Debugging counts
|
||||
*/
|
||||
uint32_t rxBad = 0, rxGood = 0, txGood = 0;
|
||||
|
||||
MeshPacketQueue txQueue = MeshPacketQueue(MAX_TX_QUEUE);
|
||||
|
||||
MeshPacketQueue txQueue = MeshPacketQueue(MAX_TX_QUEUE);
|
||||
|
||||
public:
|
||||
SimRadio();
|
||||
|
||||
@@ -24,7 +24,6 @@ class SimRadio : public RadioInterface
|
||||
*/
|
||||
static SimRadio *instance;
|
||||
|
||||
|
||||
virtual ErrorCode send(MeshPacket *p) override;
|
||||
|
||||
/** can we detect a LoRa preamble on the current channel? */
|
||||
@@ -38,7 +37,7 @@ class SimRadio : public RadioInterface
|
||||
/** Attempt to cancel a previously sent packet. Returns true if a packet was found we could cancel */
|
||||
virtual bool cancelSending(NodeNum from, PacketId id) override;
|
||||
|
||||
/**
|
||||
/**
|
||||
* Start waiting to receive a message
|
||||
*
|
||||
* External functions can call this method to wake the device from sleep.
|
||||
@@ -47,13 +46,11 @@ class SimRadio : public RadioInterface
|
||||
|
||||
QueueStatus getQueueStatus() override;
|
||||
|
||||
|
||||
protected:
|
||||
protected:
|
||||
/// are _trying_ to receive a packet currently (note - we might just be waiting for one)
|
||||
bool isReceiving = false;
|
||||
|
||||
private:
|
||||
|
||||
private:
|
||||
void setTransmitDelay();
|
||||
|
||||
/** random timer with certain min. and max. settings */
|
||||
@@ -71,19 +68,17 @@ class SimRadio : public RadioInterface
|
||||
virtual void startSend(MeshPacket *txp);
|
||||
|
||||
// derive packet length
|
||||
size_t getPacketLength(MeshPacket *p);
|
||||
size_t getPacketLength(MeshPacket *p);
|
||||
|
||||
int16_t readData(uint8_t* str, size_t len);
|
||||
int16_t readData(uint8_t *str, size_t len);
|
||||
|
||||
protected:
|
||||
protected:
|
||||
/** Could we send right now (i.e. either not actively receiving or transmitting)? */
|
||||
virtual bool canSendImmediately();
|
||||
|
||||
|
||||
/**
|
||||
* If a send was in progress finish it and return the buffer to the pool */
|
||||
void completeSending();
|
||||
|
||||
};
|
||||
|
||||
extern SimRadio *simRadio;
|
||||
Reference in New Issue
Block a user