23#ifndef RH_LORAFILEOPS_h
24#define RH_LORAFILEOPS_h
26#include <RHGenericDriver.h>
27#warning RH_LoRaFileOps unfinished
32#if (RH_PLATFORM == RH_PLATFORM_UNIX) || defined(DOXYGEN)
44#define LORA_IOC_MAGIC '\x74'
46#define LORA_SET_STATE (_IOW(LORA_IOC_MAGIC, 0, int))
47#define LORA_GET_STATE (_IOR(LORA_IOC_MAGIC, 1, int))
48#define LORA_SET_FREQUENCY (_IOW(LORA_IOC_MAGIC, 2, int))
49#define LORA_GET_FREQUENCY (_IOR(LORA_IOC_MAGIC, 3, int))
50#define LORA_SET_POWER (_IOW(LORA_IOC_MAGIC, 4, int))
51#define LORA_GET_POWER (_IOR(LORA_IOC_MAGIC, 5, int))
52#define LORA_SET_LNA (_IOW(LORA_IOC_MAGIC, 6, int))
53#define LORA_GET_LNA (_IOR(LORA_IOC_MAGIC, 7, int))
54#define LORA_SET_LNAAGC (_IOR(LORA_IOC_MAGIC, 8, int))
55#define LORA_SET_SPRFACTOR (_IOW(LORA_IOC_MAGIC, 9, int))
56#define LORA_GET_SPRFACTOR (_IOR(LORA_IOC_MAGIC, 10, int))
57#define LORA_SET_BANDWIDTH (_IOW(LORA_IOC_MAGIC, 11, int))
58#define LORA_GET_BANDWIDTH (_IOR(LORA_IOC_MAGIC, 12, int))
59#define LORA_GET_RSSI (_IOR(LORA_IOC_MAGIC, 13, int))
60#define LORA_GET_SNR (_IOR(LORA_IOC_MAGIC, 14, int))
62#define LORA_SET_CRC (_IOW(LORA_IOC_MAGIC, 15, int))
63#define LORA_SET_CODINGRATE (_IOW(LORA_IOC_MAGIC, 16, int))
64#define LORA_GET_CODINGRATE (_IOR(LORA_IOC_MAGIC, 17, int))
65#define LORA_SET_IMPLICIT (_IOW(LORA_IOC_MAGIC, 18, int))
66#define LORA_SET_LDRO (_IOW(LORA_IOC_MAGIC, 19, int))
67#define LORA_SET_PREAMBLE (_IOW(LORA_IOC_MAGIC, 20, int))
68#define LORA_GET_PREAMBLE (_IOR(LORA_IOC_MAGIC, 21, int))
69#define LORA_SET_PARAMP (_IOW(LORA_IOC_MAGIC, 22, int))
70#define LORA_GET_PARAMP (_IOR(LORA_IOC_MAGIC, 23, int))
71#define LORA_SET_OCPIMAX (_IOW(LORA_IOC_MAGIC, 24, int))
72#define LORA_GET_OCPIMAX (_IOR(LORA_IOC_MAGIC, 25, int))
73#define LORA_SET_LNABOOSTHF (_IOW(LORA_IOC_MAGIC, 26, int))
74#define LORA_SET_PMAX20DBM (_IOW(LORA_IOC_MAGIC, 27, int))
78#define LORA_STATE_SLEEP 0
79#define LORA_STATE_STANDBY 1
80#define LORA_STATE_TX 2
81#define LORA_STATE_RX 3
82#define LORA_STATE_CAD 4
85#define RH_LORAFILEOPS_FIFO_SIZE 255
89#define RH_LORAFILEOPS_MAX_PAYLOAD_LEN RH_LORAFILEOPS_FIFO_SIZE
93#define RH_LORAFILEOPS_HEADER_LEN 4
98#ifndef RH_LORAFILEOPS_MAX_MESSAGE_LEN
99#define RH_LORAFILEOPS_MAX_MESSAGE_LEN (RH_LORAFILEOPS_MAX_PAYLOAD_LEN - RH_LORAFILEOPS_HEADER_LEN)
257 virtual bool recv(uint8_t* buf, uint8_t* len);
265 virtual bool send(
const uint8_t* data, uint8_t len);
Abstract base class for a RadioHead driver.
Definition RHGenericDriver.h:42
Driver to send and receive unaddressed, unreliable datagrams via a LoRa capable radio transceiver on ...
Definition RH_LoRaFileOps.h:221
RH_LoRaFileOps(const char *port)
bool setFrequency(uint32_t centre)
void setTxPower(int32_t power)
virtual uint8_t maxMessageLength()
void setLNAAGC(int32_t lnaagc)
virtual bool send(const uint8_t *data, uint8_t len)
void setState(uint32_t state)
Set the current radio state, one of LORA_STATE_*.
int32_t getSpreadingFactor()
uint32_t getState()
Get the current radio state.
void setSpreadingFactor(int32_t sf)
void setCRC(uint32_t crc)
virtual bool recv(uint8_t *buf, uint8_t *len)