RF24Ethernet - TCP/IP over RF24Network v2.0.3
TMRh20 - Pushing the practical limits of RF24 modules
Loading...
Searching...
No Matches
RF24EthernetClass Class Reference

#include <RF24Ethernet.h>

Collaboration diagram for RF24EthernetClass:

Classes

struct  EthQueue

Public Types

typedef uint32_t err_t

Public Member Functions

 RF24EthernetClass (RF24 &_radio, RF24Network &_network, RF24Mesh &_mesh)
 RF24EthernetClass ()
void use_device ()
void begin (IP_ADDR myIP, IP_ADDR subnet)
void begin (IPAddress ip)
void begin (IPAddress ip, IPAddress dns)
void begin (IPAddress ip, IPAddress dns, IPAddress gateway)
void begin (IPAddress ip, IPAddress dns, IPAddress gateway, IPAddress subnet)
void set_gateway (IPAddress gwIP)
void listen (uint16_t port)
void setMac (uint16_t address)
void setChannel (uint8_t channel)
int available ()
IPAddress localIP ()
IPAddress subnetMask ()
IPAddress gatewayIP ()
IPAddress dnsServerIP ()
void update ()

Static Public Member Functions

static bool isUnicast (const uint8_t frame)
static void initRXQueue (EthQueue *RXQueue)
static void writeRXQueue (EthQueue *RXQueue, const uint8_t *ethFrame, uint16_t lenEthFrame)

Public Attributes

uint32_t networkCorruption
RF24Network & network
RF24Mesh & mesh

Static Public Attributes

static bool useCoreLocking
static constexpr unsigned MAX_FRAME_SIZE = MAX_PAYLOAD_SIZE
static constexpr unsigned MIN_FRAME_SIZE = 60
static constexpr unsigned MAX_RX_QUEUE = 2
static constexpr uint32_t NetIF_Speed_BPS = 1000000
static netif myNetif
static EthQueue RXQueue

Friends

class RF24Server
class RF24Client
class RF24UDP

Detailed Description

Member Typedef Documentation

◆ err_t

typedef uint32_t RF24EthernetClass::err_t

Definition at line 243 of file RF24Ethernet.h.

Constructor & Destructor Documentation

◆ RF24EthernetClass() [1/2]

RF24EthernetClass::RF24EthernetClass ( RF24 & _radio,
RF24Network & _network,
RF24Mesh & _mesh )

Constructor to set up the Ethernet layer. Requires the radio and network to be configured by the user this allows users to set custom settings at the radio or network level

Definition at line 203 of file RF24Ethernet.cpp.

References RF24Client::gState, mesh, and network.

◆ RF24EthernetClass() [2/2]

RF24EthernetClass::RF24EthernetClass ( )

Basic constructor

Member Function Documentation

◆ use_device()

void RF24EthernetClass::use_device ( )
Note
Deprecated, maintained for backwards compatibility with old examples

This function is no longer needed, and does nothing

Definition at line 241 of file RF24Ethernet.cpp.

◆ begin() [1/5]

void RF24EthernetClass::begin ( IP_ADDR myIP,
IP_ADDR subnet )

Configure the IP address and subnet mask of the node. This is independent of the RF24Network layer, so the IP and subnet only have to conform to standard IP routing rules within your network

Referenced by begin(), begin(), and begin().

◆ begin() [2/5]

void RF24EthernetClass::begin ( IPAddress ip)

Configure the IP address and subnet mask of the node. This is independent of the RF24Network layer, so the IP and subnet only have to conform to standard IP routing rules within your network

Definition at line 281 of file RF24Ethernet.cpp.

References begin().

◆ begin() [3/5]

void RF24EthernetClass::begin ( IPAddress ip,
IPAddress dns )

Definition at line 289 of file RF24Ethernet.cpp.

References begin().

◆ begin() [4/5]

void RF24EthernetClass::begin ( IPAddress ip,
IPAddress dns,
IPAddress gateway )

Definition at line 298 of file RF24Ethernet.cpp.

References begin().

◆ begin() [5/5]

void RF24EthernetClass::begin ( IPAddress ip,
IPAddress dns,
IPAddress gateway,
IPAddress subnet )

Definition at line 306 of file RF24Ethernet.cpp.

◆ set_gateway()

void RF24EthernetClass::set_gateway ( IPAddress gwIP)

Configure the gateway IP address. This is generally going to be your master node with RF24Network address 00.

Definition at line 388 of file RF24Ethernet.cpp.

References Ethernet, and useCoreLocking.

◆ listen()

void RF24EthernetClass::listen ( uint16_t port)

Listen to a specified port - This will likely be changed to closer match the Arduino Ethernet API with server.begin();

Definition at line 413 of file RF24Ethernet.cpp.

References RF24Client::error_callback(), RF24Client::gState, HTONS, IF_RF24ETHERNET_DEBUG_CLIENT, and useCoreLocking.

◆ setMac()

void RF24EthernetClass::setMac ( uint16_t address)

Sets the MAC address of the RF24 module, which is an RF24Network address Specify an Octal address to assign to this node, which will be used as the Ethernet mac address If setting up only a few nodes, use 01 to 05 Please reference the RF24Network documentation for information on setting up a static network RF24Mesh will be integrated to provide this automatically

Definition at line 248 of file RF24Ethernet.cpp.

References network.

◆ setChannel()

void RF24EthernetClass::setChannel ( uint8_t channel)

Sets the Radio channel/frequency to use (0-127)

Definition at line 271 of file RF24Ethernet.cpp.

References network.

◆ available()

int RF24EthernetClass::available ( )

Indicates whether data is available.

◆ localIP()

IPAddress RF24EthernetClass::localIP ( )

Returns the local IP address

Definition at line 452 of file RF24Ethernet.cpp.

References myNetif.

◆ subnetMask()

IPAddress RF24EthernetClass::subnetMask ( )

Returns the subnet mask

Definition at line 470 of file RF24Ethernet.cpp.

References myNetif.

◆ gatewayIP()

IPAddress RF24EthernetClass::gatewayIP ( )

Returns the gateway IP address

Definition at line 488 of file RF24Ethernet.cpp.

References myNetif.

◆ dnsServerIP()

IPAddress RF24EthernetClass::dnsServerIP ( )

Returns the DNS server IP address

Definition at line 506 of file RF24Ethernet.cpp.

◆ update()

void RF24EthernetClass::update ( )

Keeps the TCP/IP stack running & processing incoming data

Definition at line 234 of file RF24Ethernet.cpp.

References Ethernet.

◆ isUnicast()

bool RF24EthernetClass::isUnicast ( const uint8_t frame)
static

Definition at line 82 of file RF24Ethernet.cpp.

◆ initRXQueue()

void RF24EthernetClass::initRXQueue ( EthQueue * RXQueue)
static

Used internally to initialize incoming data queue

Definition at line 32 of file RF24Ethernet.cpp.

References RXQueue.

◆ writeRXQueue()

void RF24EthernetClass::writeRXQueue ( EthQueue * RXQueue,
const uint8_t * ethFrame,
uint16_t lenEthFrame )
static

Used internally to write to the internal data queue

Definition at line 41 of file RF24Ethernet.cpp.

References MAX_FRAME_SIZE, MAX_RX_QUEUE, and RXQueue.

◆ RF24Server

friend class RF24Server
friend

Definition at line 291 of file RF24Ethernet.h.

References RF24Server.

Referenced by RF24Server.

◆ RF24Client

friend class RF24Client
friend

Definition at line 292 of file RF24Ethernet.h.

References RF24Client.

Referenced by RF24Client.

◆ RF24UDP

friend class RF24UDP
friend

Definition at line 293 of file RF24Ethernet.h.

References RF24UDP.

Referenced by RF24UDP.

Member Data Documentation

◆ networkCorruption

uint32_t RF24EthernetClass::networkCorruption

Definition at line 211 of file RF24Ethernet.h.

◆ network

RF24Network& RF24EthernetClass::network

Definition at line 214 of file RF24Ethernet.h.

Referenced by RF24EthernetClass(), setChannel(), and setMac().

◆ mesh

RF24Mesh& RF24EthernetClass::mesh

Definition at line 216 of file RF24Ethernet.h.

Referenced by RF24EthernetClass().

◆ useCoreLocking

bool RF24EthernetClass::useCoreLocking
static

Definition at line 227 of file RF24Ethernet.h.

Referenced by listen(), and set_gateway().

◆ MAX_FRAME_SIZE

unsigned RF24EthernetClass::MAX_FRAME_SIZE = MAX_PAYLOAD_SIZE
staticconstexpr

Definition at line 228 of file RF24Ethernet.h.

Referenced by RF24EthernetClass::EthQueue::__attribute__(), and writeRXQueue().

◆ MIN_FRAME_SIZE

unsigned RF24EthernetClass::MIN_FRAME_SIZE = 60
staticconstexpr

Definition at line 229 of file RF24Ethernet.h.

◆ MAX_RX_QUEUE

unsigned RF24EthernetClass::MAX_RX_QUEUE = 2
staticconstexpr

Definition at line 230 of file RF24Ethernet.h.

Referenced by RF24EthernetClass::EthQueue::__attribute__(), and writeRXQueue().

◆ NetIF_Speed_BPS

uint32_t RF24EthernetClass::NetIF_Speed_BPS = 1000000
staticconstexpr

Definition at line 231 of file RF24Ethernet.h.

◆ myNetif

netif RF24EthernetClass::myNetif
static

Definition at line 232 of file RF24Ethernet.h.

Referenced by gatewayIP(), localIP(), and subnetMask().

◆ RXQueue

RF24EthernetClass::EthQueue RF24EthernetClass::RXQueue
static

Definition at line 241 of file RF24Ethernet.h.

Referenced by initRXQueue(), and writeRXQueue().