#include <Wireless.hh>
|
| Driver (int16_t network, uint8_t device) |
|
uint8_t | channel () const |
|
int16_t | network_address () const |
|
uint8_t | device_address () const |
|
void | address (int16_t net, uint8_t dev) |
|
void | channel (uint8_t channel) |
|
virtual bool | begin (const void *config=NULL)=0 |
|
virtual bool | end () |
|
virtual void | powerup () |
|
virtual void | powerdown () |
|
virtual void | wakeup_on_radio () |
|
virtual bool | available () |
|
virtual bool | room () |
|
virtual int | send (uint8_t dest, uint8_t port, const iovec_t *vec)=0 |
|
virtual int | send (uint8_t dest, uint8_t port, const void *buf, size_t len) |
|
virtual int | broadcast (uint8_t port, const iovec_t *vec) |
|
virtual int | broadcast (uint8_t port, const void *buf, size_t len) |
|
virtual int | recv (uint8_t &src, uint8_t &port, void *buf, size_t len, uint32_t ms=0L)=0 |
|
virtual bool | is_broadcast () |
|
virtual void | output_power_level (int8_t dBm) |
|
virtual int | input_power_level () |
|
virtual int | link_quality_indicator () |
|
Common Wireless device driver interface.
Definition at line 35 of file Wireless.hh.
Wireless::Driver::Driver |
( |
int16_t |
network, |
|
|
uint8_t |
device |
|
) |
| |
|
inline |
Construct Wireless device driver with given network and device address.
- Parameters
-
[in] | network | address. |
[in] | device | address. |
Definition at line 66 of file Wireless.hh.
void Wireless::Driver::address |
( |
int16_t |
net, |
|
|
uint8_t |
dev |
|
) |
| |
|
inline |
Set network and device address. Do not use the broadcast address(0). Should be used before calling begin().
- Parameters
-
[in] | net | network address. |
[in] | dev | device address. |
Definition at line 106 of file Wireless.hh.
virtual bool Wireless::Driver::available |
( |
| ) |
|
|
inlinevirtual |
Return true(1) if a message is available otherwise false(0).
- Returns
- bool.
Reimplemented in VWI, and NRF24L01P.
Definition at line 165 of file Wireless.hh.
virtual bool Wireless::Driver::begin |
( |
const void * |
config = NULL | ) |
|
|
pure virtual |
Start the Wireless device driver. Return true(1) if successful otherwise false(0). Must be implemented by sub-class.
- Parameters
-
[in] | config | configuration vector (default NULL). |
- Returns
- bool.
Implemented in VWI, NRF24L01P, CC1101, and RFM69.
virtual int Wireless::Driver::broadcast |
( |
uint8_t |
port, |
|
|
const iovec_t * |
vec |
|
) |
| |
|
inlinevirtual |
Broadcast message in given null terminated io vector. Returns number of bytes sent if successful otherwise a negative error code.
- Parameters
-
[in] | port | device port (or message type). |
[in] | vec | null termianted io vector. |
- Returns
- number of bytes send or negative error code.
Definition at line 220 of file Wireless.hh.
virtual int Wireless::Driver::broadcast |
( |
uint8_t |
port, |
|
|
const void * |
buf, |
|
|
size_t |
len |
|
) |
| |
|
inlinevirtual |
Boardcast message in given buffer, with given number of bytes. Returns number of bytes sent if successful otherwise a negative error code.
- Parameters
-
[in] | port | device port (or message type). |
[in] | buf | buffer to transmit. |
[in] | len | number of bytes in buffer. |
- Returns
- number of bytes send or negative error code.
Definition at line 235 of file Wireless.hh.
uint8_t Wireless::Driver::channel |
( |
| ) |
const |
|
inline |
Get driver channel.
- Returns
- channel.
Definition at line 77 of file Wireless.hh.
void Wireless::Driver::channel |
( |
uint8_t |
channel | ) |
|
|
inline |
Set device transmission channel. Should be used before calling begin().
- Parameters
-
Definition at line 117 of file Wireless.hh.
uint8_t Wireless::Driver::device_address |
( |
| ) |
const |
|
inline |
Get driver device address.
- Returns
- device address.
Definition at line 95 of file Wireless.hh.
virtual bool Wireless::Driver::end |
( |
| ) |
|
|
inlinevirtual |
Shut down the device driver. Return true(1) if successful otherwise false(0).
- Returns
- bool.
Reimplemented in VWI, NRF24L01P, CC1101, and RFM69.
Definition at line 137 of file Wireless.hh.
virtual int Wireless::Driver::input_power_level |
( |
| ) |
|
|
inlinevirtual |
Return estimated input power level (dBm). Default zero(0).
- Returns
- power level in dBm.
Reimplemented in CC1101, and RFM69.
Definition at line 282 of file Wireless.hh.
virtual bool Wireless::Driver::is_broadcast |
( |
| ) |
|
|
inlinevirtual |
Return true(1) if the latest received message was a broadcast otherwise false(0).
Definition at line 262 of file Wireless.hh.
virtual int Wireless::Driver::link_quality_indicator |
( |
| ) |
|
|
inlinevirtual |
Return link quality indicator. Default zero(0).
- Returns
- quality indicator.
Reimplemented in VWI, and CC1101.
Definition at line 292 of file Wireless.hh.
int16_t Wireless::Driver::network_address |
( |
| ) |
const |
|
inline |
Get driver network address.
- Returns
- network address.
Definition at line 86 of file Wireless.hh.
virtual void Wireless::Driver::output_power_level |
( |
int8_t |
dBm | ) |
|
|
inlinevirtual |
virtual void Wireless::Driver::powerdown |
( |
| ) |
|
|
inlinevirtual |
virtual void Wireless::Driver::powerup |
( |
| ) |
|
|
inlinevirtual |
virtual int Wireless::Driver::recv |
( |
uint8_t & |
src, |
|
|
uint8_t & |
port, |
|
|
void * |
buf, |
|
|
size_t |
len, |
|
|
uint32_t |
ms = 0L |
|
) |
| |
|
pure virtual |
Receive message and store into given buffer with given maximum length. The source network address is returned in the parameter src. Returns the number of received bytes or a negative error code. Must be implemented by sub-class.
- Parameters
-
[out] | src | source network address. |
[out] | port | device port (or message type). |
[in] | buf | buffer to store incoming message. |
[in] | len | maximum number of bytes to receive. |
[in] | ms | maximum time out period. |
- Returns
- number of bytes received or negative error code.
Implemented in VWI, NRF24L01P, CC1101, and RFM69.
virtual bool Wireless::Driver::room |
( |
| ) |
|
|
inlinevirtual |
Return true(1) if there is room to send on the device otherwise false(0).
- Returns
- bool.
Definition at line 176 of file Wireless.hh.
virtual int Wireless::Driver::send |
( |
uint8_t |
dest, |
|
|
uint8_t |
port, |
|
|
const iovec_t * |
vec |
|
) |
| |
|
pure virtual |
Send message in given null terminated io vector. Returns number of bytes sent if successful otherwise a negative error code. Must be implemented by sub-class.
- Parameters
-
[in] | dest | destination network address. |
[in] | port | device port (or message type). |
[in] | vec | null termianted io vector. |
- Returns
- number of bytes send or negative error code.
Implemented in VWI, NRF24L01P, CC1101, and RFM69.
virtual int Wireless::Driver::send |
( |
uint8_t |
dest, |
|
|
uint8_t |
port, |
|
|
const void * |
buf, |
|
|
size_t |
len |
|
) |
| |
|
inlinevirtual |
Send message in given buffer, with given number of bytes. Returns number of bytes sent if successful otherwise a negative error code.
- Parameters
-
[in] | dest | destination network address. |
[in] | port | device port (or message type). |
[in] | buf | buffer to transmit. |
[in] | len | number of bytes in buffer. |
- Returns
- number of bytes send or negative error code.
Reimplemented in VWI, NRF24L01P, CC1101, and RFM69.
Definition at line 203 of file Wireless.hh.
virtual void Wireless::Driver::wakeup_on_radio |
( |
| ) |
|
|
inlinevirtual |
const uint8_t Wireless::Driver::BROADCAST = 0x00 |
|
static |
Broadcast device address.
Definition at line 58 of file Wireless.hh.
addr_t Wireless::Driver::m_addr |
|
protected |
Current network and device address.
Definition at line 299 of file Wireless.hh.
volatile bool Wireless::Driver::m_avail |
|
protected |
Message available. May be set by ISR.
Definition at line 300 of file Wireless.hh.
uint8_t Wireless::Driver::m_channel |
|
protected |
Current channel (device dependent.
Definition at line 298 of file Wireless.hh.
uint8_t Wireless::Driver::m_dest |
|
protected |
Latest message destination device address.
Definition at line 301 of file Wireless.hh.
The documentation for this class was generated from the following file: