21 #ifndef COSA_WIRELESS_HH 22 #define COSA_WIRELESS_HH 129 virtual bool begin(
const void* config =
NULL) = 0;
191 virtual int send(uint8_t dest, uint8_t port,
const iovec_t* vec) = 0;
203 virtual int send(uint8_t dest, uint8_t port,
const void* buf,
size_t len)
209 return (
send(dest, port, vec));
222 return (
send(BROADCAST, port, vec));
235 virtual int broadcast(uint8_t port,
const void* buf,
size_t len)
237 return (
send(BROADCAST, port, buf, len));
253 virtual int recv(uint8_t& src, uint8_t& port,
254 void* buf,
size_t len,
255 uint32_t ms = 0L) = 0;
264 return (
m_dest == BROADCAST);
virtual void output_power_level(int8_t dBm)
addr_t m_addr
Current network and device address.
virtual int send(uint8_t dest, uint8_t port, const void *buf, size_t len)
volatile bool m_avail
Message available. May be set by ISR.
uint8_t m_channel
Current channel (device dependent.
uint8_t m_dest
Latest message destination device address.
void channel(uint8_t channel)
virtual bool begin(const void *config=NULL)=0
uint8_t device
Device address (LSB).
void address(int16_t net, uint8_t dev)
virtual int send(uint8_t dest, uint8_t port, const iovec_t *vec)=0
int16_t network
Network address.
virtual int recv(uint8_t &src, uint8_t &port, void *buf, size_t len, uint32_t ms=0L)=0
uint8_t device_address() const
virtual int link_quality_indicator()
int16_t network_address() const
virtual int broadcast(uint8_t port, const void *buf, size_t len)
virtual bool is_broadcast()
virtual int broadcast(uint8_t port, const iovec_t *vec)
static const uint8_t BROADCAST
Driver(int16_t network, uint8_t device)
virtual void wakeup_on_radio()
addr_t(int16_t net, uint8_t dev)
virtual int input_power_level()
void iovec_arg(iovec_t *&vp, const void *buf, size_t size)
void iovec_end(iovec_t *&vp)