10 #include <RF22ReliableDatagram.h>
13 #define RF22_DEFAULT_MAX_HOPS 30
16 #define RF22_ROUTING_TABLE_SIZE 10
19 #define RF22_ROUTER_ERROR_NONE 0
20 #define RF22_ROUTER_ERROR_INVALID_LENGTH 1
21 #define RF22_ROUTER_ERROR_NO_ROUTE 2
22 #define RF22_ROUTER_ERROR_TIMEOUT 3
23 #define RF22_ROUTER_ERROR_NO_REPLY 4
24 #define RF22_ROUTER_ERROR_UNABLE_TO_DELIVER 5
28 #define RF22_ROUTER_MAX_MESSAGE_LEN (RF22_MAX_MESSAGE_LEN - sizeof(RF22Router::RoutedMessageHeader))
152 uint8_t data[RF22_ROUTER_MAX_MESSAGE_LEN];
176 RF22Router(uint8_t thisAddress = 0, uint8_t slaveSelectPin = SS, uint8_t interrupt = 0);
195 void addRouteTo(uint8_t dest, uint8_t next_hop, uint8_t state =
Valid);
233 uint8_t
sendtoWait(uint8_t* buf, uint8_t len, uint8_t dest);
247 uint8_t
sendtoWait(uint8_t* buf, uint8_t len, uint8_t dest, uint8_t source);
269 boolean recvfromAck(uint8_t* buf, uint8_t* len, uint8_t* source = NULL, uint8_t* dest = NULL, uint8_t*
id = NULL, uint8_t* flags = NULL);
283 boolean recvfromAckTimeout(uint8_t* buf, uint8_t* len, uint16_t timeout, uint8_t* source = NULL, uint8_t* dest = NULL, uint8_t*
id = NULL, uint8_t* flags = NULL);
RF22Router(uint8_t thisAddress=0, uint8_t slaveSelectPin=SS, uint8_t interrupt=0)
Definition: RF22Router.cpp:21
void setMaxHops(uint8_t max_hops)
Definition: RF22Router.cpp:39
uint8_t sendtoWait(uint8_t *buf, uint8_t len, uint8_t dest)
Definition: RF22Router.cpp:155
virtual uint8_t route(RoutedMessage *message, uint8_t messageLen)
Definition: RF22Router.cpp:179
void deleteRoute(uint8_t index)
Definition: RF22Router.cpp:98
void retireOldestRoute()
Definition: RF22Router.cpp:140
void printRoutingTable()
Definition: RF22Router.cpp:107
boolean recvfromAck(uint8_t *buf, uint8_t *len, uint8_t *source=NULL, uint8_t *dest=NULL, uint8_t *id=NULL, uint8_t *flags=NULL)
Definition: RF22Router.cpp:205
void clearRoutingTable()
Definition: RF22Router.cpp:147
uint8_t _lastE2ESequenceNumber
Definition: RF22Router.h:307
Defines the structure of a RF22Router message.
Definition: RF22Router.h:149
virtual void peekAtMessage(RoutedMessage *message, uint8_t messageLen)
Definition: RF22Router.cpp:199
Route is valid.
Definition: RF22Router.h:160
RoutedMessageHeader header
end-to-end delivery header
Definition: RF22Router.h:151
boolean deleteRouteTo(uint8_t dest)
Definition: RF22Router.cpp:125
uint8_t next_hop
Send via this next hop address.
Definition: RF22Router.h:167
uint8_t state
State of this route, one of RouteState.
Definition: RF22Router.h:168
uint8_t _max_hops
Definition: RF22Router.h:311
boolean init()
Definition: RF22Router.cpp:30
boolean recvfromAckTimeout(uint8_t *buf, uint8_t *len, uint16_t timeout, uint8_t *source=NULL, uint8_t *dest=NULL, uint8_t *id=NULL, uint8_t *flags=NULL)
Definition: RF22Router.cpp:292
RouteState
Values for the possible states for routes.
Definition: RF22Router.h:156
void addRouteTo(uint8_t dest, uint8_t next_hop, uint8_t state=Valid)
Definition: RF22Router.cpp:45
uint8_t dest
Destination node address.
Definition: RF22Router.h:166
No valid route is known.
Definition: RF22Router.h:158
RF22 subclass for sending addressed, acknowledged, retransmitted datagrams.
Definition: RF22ReliableDatagram.h:41
Discovering a route (not currently used)
Definition: RF22Router.h:159
Defines an entry in the routing table.
Definition: RF22Router.h:164
RoutingTableEntry * getRouteTo(uint8_t dest)
Definition: RF22Router.cpp:88
RF22 subclass for sending addressed, optionally acknowledged datagrams multi-hop routed across a netw...
Definition: RF22Router.h:132