From 53c6156f5cc604e464e10b7beebd9d79c05e6089 Mon Sep 17 00:00:00 2001 From: 2bndy5 <2bndy5@users.noreply.github.com> Date: Tue, 11 Jun 2024 09:20:34 +0000 Subject: [PATCH] deploy: 9fb4e2838a8307e2ee8c2654ee9ca7c4000de689 --- RF24GatewayNodeInt_8cpp-example.html | 17 +- RF24GatewayNode_8cpp-example.html | 19 +- RF24Gateway_8cpp_source.html | 1432 ++++++++--------- RF24Gateway_8h_source.html | 601 ++++--- RF24Gateway_ncursesInt_8cpp-example.html | 19 +- RF24Gateway_ncurses_8cpp-example.html | 23 +- annotated.html | 21 +- bClient_8sh-example.html | 15 +- bdwn.png | Bin 0 -> 147 bytes classESBGateway-members.html | 106 -- classESBGateway.html | 598 ------- classESBMesh.html | 91 -- classESBNetwork.html | 91 -- classRF24Gateway-members.html | 103 ++ classRF24Gateway.html | 607 +++++++ classes.html | 20 +- clipboard.js | 61 - cookie.js | 58 - darkmode_toggle.js | 118 +- dir_49e56c817e5e54854c35e136979f97ca.html | 13 +- doc.png | Bin 0 -> 746 bytes doc.svg | 12 - docd.png | Bin 0 -> 756 bytes docd.svg | 12 - doxygen-custom.css | 104 -- doxygen.css | 316 +--- doxygen.svg | 4 +- doxygen_crawl.html | 61 - dynsections.js | 265 ++- examples.html | 13 +- favicon.ico | Bin 4286 -> 0 bytes folderclosed.png | Bin 0 -> 616 bytes folderclosed.svg | 11 - folderclosedd.svg | 11 - folderopen.png | Bin 0 -> 597 bytes folderopen.svg | 17 - folderopend.svg | 12 - functions.html | 49 +- functions_func.html | 33 +- functions_vars.html | 33 +- index.html | 95 +- md_CONTRIBUTING.html | 17 +- menu.js | 34 +- minus.svg | 8 - minusd.svg | 8 - nodeClient_8js-example.html | 15 +- pages.html | 13 +- plus.svg | 9 - plusd.svg | 9 - pyClient_8py-example.html | 15 +- search/all_0.js | 2 +- search/all_1.js | 5 +- search/all_10.js | 4 - search/all_2.js | 2 +- search/all_3.js | 6 +- search/all_4.js | 10 +- search/all_5.js | 3 +- search/all_6.js | 2 +- search/all_7.js | 5 +- search/all_8.js | 7 +- search/all_9.js | 4 +- search/all_a.js | 3 +- search/all_b.js | 4 - search/all_c.js | 8 - search/all_d.js | 6 - search/all_e.js | 5 - search/all_f.js | 4 - search/classes_0.js | 7 +- search/classes_1.js | 4 - search/close.svg | 19 +- search/functions_0.js | 2 +- search/functions_1.js | 3 +- search/functions_2.js | 3 +- search/functions_3.js | 2 +- search/functions_4.js | 2 +- search/functions_5.js | 4 +- search/functions_6.js | 2 +- search/mag.svg | 19 +- search/mag_d.svg | 19 +- search/mag_sel.svg | 53 +- search/mag_seld.svg | 59 +- search/search.js | 942 ++++++----- search/searchdata.js | 6 +- search/variables_0.js | 2 +- search/variables_1.js | 2 +- search/variables_2.js | 2 +- search/variables_3.js | 2 +- search/variables_4.js | 2 +- search/variables_5.js | 4 +- search/variables_6.js | 4 +- ...uctRF24Gateway_1_1routeStruct-members.html | 25 +- ...l => structRF24Gateway_1_1routeStruct.html | 78 +- tabs.css | 2 +- 93 files changed, 2863 insertions(+), 3675 deletions(-) create mode 100644 bdwn.png delete mode 100644 classESBGateway-members.html delete mode 100644 classESBGateway.html delete mode 100644 classESBMesh.html delete mode 100644 classESBNetwork.html create mode 100644 classRF24Gateway-members.html create mode 100644 classRF24Gateway.html delete mode 100644 clipboard.js delete mode 100644 cookie.js create mode 100644 doc.png delete mode 100644 doc.svg create mode 100644 docd.png delete mode 100644 docd.svg delete mode 100644 doxygen_crawl.html delete mode 100644 favicon.ico create mode 100644 folderclosed.png delete mode 100644 folderclosed.svg delete mode 100644 folderclosedd.svg create mode 100644 folderopen.png delete mode 100644 folderopen.svg delete mode 100644 folderopend.svg delete mode 100644 minus.svg delete mode 100644 minusd.svg delete mode 100644 plus.svg delete mode 100644 plusd.svg delete mode 100644 search/all_10.js delete mode 100644 search/all_b.js delete mode 100644 search/all_c.js delete mode 100644 search/all_d.js delete mode 100644 search/all_e.js delete mode 100644 search/all_f.js delete mode 100644 search/classes_1.js rename structESBGateway_1_1routeStruct-members.html => structRF24Gateway_1_1routeStruct-members.html (60%) rename structESBGateway_1_1routeStruct.html => structRF24Gateway_1_1routeStruct.html (53%) diff --git a/RF24GatewayNodeInt_8cpp-example.html b/RF24GatewayNodeInt_8cpp-example.html index 8a5f281..bd562dc 100644 --- a/RF24GatewayNodeInt_8cpp-example.html +++ b/RF24GatewayNodeInt_8cpp-example.html @@ -3,15 +3,12 @@ - + RF24Gateway - TCP/IP over RF24Network: RF24GatewayNodeInt.cpp - - - @@ -26,7 +23,7 @@ -
RF24Gateway - TCP/IP over RF24Network v2.0.0 +
RF24Gateway - TCP/IP over RF24Network v1.1.0
TMRh20 - Pushing the practical limits of RF24 modules
@@ -35,7 +32,7 @@
- + @@ -90,7 +87,7 @@
RF24 radio(22, 0);
RF24Network network(radio);
RF24Mesh mesh(radio, network);
-
RF24Gateway gw(radio, network, mesh);
+
RF24Gateway gw(radio, network, mesh);
void intHandler()
{
@@ -169,11 +166,11 @@
}
return 0;
}
-
ESBGateway
Definition RF24Gateway.h:66
+
RF24Gateway
Definition: RF24Gateway.h:47
diff --git a/RF24GatewayNode_8cpp-example.html b/RF24GatewayNode_8cpp-example.html index 6bf8b1b..b0c557d 100644 --- a/RF24GatewayNode_8cpp-example.html +++ b/RF24GatewayNode_8cpp-example.html @@ -3,15 +3,12 @@ - + RF24Gateway - TCP/IP over RF24Network: RF24GatewayNode.cpp - - - @@ -26,7 +23,7 @@ -
RF24Gateway - TCP/IP over RF24Network v2.0.0 +
RF24Gateway - TCP/IP over RF24Network v1.1.0
TMRh20 - Pushing the practical limits of RF24 modules
@@ -35,7 +32,7 @@
- + @@ -78,7 +75,7 @@
RF24GatewayNode.cpp
-

A simple example of using RF24Gateway node to forward IP traffic automatically to a network interface, while managing standard RF24Network user payloads independently.

+

A simple example of using RF24Gateway node to forward IP traffic automatically to a network interface, while managing standard RF24Network user payloads independently.

#include <RF24/RF24.h>
#include <RF24Network/RF24Network.h>
#include <RF24Mesh/RF24Mesh.h>
@@ -87,7 +84,7 @@
RF24 radio(22, 0);
RF24Network network(radio);
RF24Mesh mesh(radio, network);
-
RF24Gateway gw(radio, network, mesh);
+
RF24Gateway gw(radio, network, mesh);
uint32_t mesh_timer = 0;
@@ -161,11 +158,11 @@
}
return 0;
}
- +
diff --git a/RF24Gateway_8cpp_source.html b/RF24Gateway_8cpp_source.html index 58b46cb..b73fd48 100644 --- a/RF24Gateway_8cpp_source.html +++ b/RF24Gateway_8cpp_source.html @@ -3,15 +3,12 @@ - + RF24Gateway - TCP/IP over RF24Network: RF24Gateway.cpp Source File - - - @@ -26,7 +23,7 @@ -
RF24Gateway - TCP/IP over RF24Network v2.0.0 +
RF24Gateway - TCP/IP over RF24Network v1.1.0
TMRh20 - Pushing the practical limits of RF24 modules
@@ -35,7 +32,7 @@
- + -
9
10/***************************************************************************************/
11
-
12template<class mesh_t, class network_t, class radio_t>
-
-
13ESBGateway<mesh_t, network_t, radio_t>::ESBGateway(radio_t& _radio, network_t& _network, mesh_t& _mesh) : radio(_radio), network(_network), mesh(_mesh)
-
14{
-
15 gotInterrupt = false;
-
16}
-
-
17
-
18/***************************************************************************************/
-
19
-
20template<class mesh_t, class network_t, class radio_t>
-
-
21void ESBGateway<mesh_t, network_t, radio_t>::begin(uint8_t nodeID, uint8_t _channel, rf24_datarate_e data_rate)
-
22{
-
23 mesh_enabled = true;
-
24 begin(true, mesh_enabled, 0, nodeID, data_rate, _channel);
-
25}
-
+
12RF24Gateway::RF24Gateway(RF24& _radio, RF24Network& _network, RF24Mesh& _mesh) : radio(_radio), network(_network), mesh(_mesh)
+
13{
+
14 gotInterrupt = false;
+
15}
+
16
+
17/***************************************************************************************/
+
18
+
19void RF24Gateway::begin(uint8_t nodeID, uint8_t _channel, rf24_datarate_e data_rate)
+
20{
+
21 mesh_enabled = true;
+
22 begin(true, mesh_enabled, 0, nodeID, data_rate, _channel);
+
23}
+
24
+
25/***************************************************************************************/
26
-
27/***************************************************************************************/
-
28
-
29template<class mesh_t, class network_t, class radio_t>
-
-
30void ESBGateway<mesh_t, network_t, radio_t>::begin(uint16_t address, uint8_t _channel, rf24_datarate_e data_rate, bool meshEnable, uint8_t nodeID)
-
31{
-
32 begin(0, mesh_enabled, address, nodeID, data_rate, _channel);
-
33}
-
-
34
-
35/***************************************************************************************/
-
36
-
37template<class mesh_t, class network_t, class radio_t>
-
38bool ESBGateway<mesh_t, network_t, radio_t>::begin(bool configTUN, bool meshEnable, uint16_t address, uint8_t mesh_nodeID, rf24_datarate_e data_rate, uint8_t _channel)
-
39{
-
40#if (DEBUG_LEVEL >= 1)
-
41 printf("GW Begin\n");
-
42 printf("Config Device address 0%o nodeID %d\n", address, mesh_nodeID);
-
43#endif
-
44 config_TUN = configTUN;
-
45
-
46 /// FIX
-
47
-
48 channel = _channel; // 97;
-
49
-
50 dataRate = data_rate;
-
51
-
52 configDevice(address);
-
53 mesh_enabled = meshEnable;
-
54 thisNodeID = mesh_nodeID;
-
55 thisNodeAddress = address;
-
56
-
57 if (meshEnable) {
-
58 // GW radio channel setting takes precedence over mesh_default_channel
-
59 if (channel == 97 && MESH_DEFAULT_CHANNEL != 97) {
-
60 channel = MESH_DEFAULT_CHANNEL;
+
27void RF24Gateway::begin(uint16_t address, uint8_t _channel, rf24_datarate_e data_rate, bool meshEnable, uint8_t nodeID)
+
28{
+
29 begin(0, mesh_enabled, address, nodeID, data_rate, _channel);
+
30}
+
31
+
32/***************************************************************************************/
+
33
+
34bool RF24Gateway::begin(bool configTUN, bool meshEnable, uint16_t address, uint8_t mesh_nodeID, rf24_datarate_e data_rate, uint8_t _channel)
+
35{
+
36#if (DEBUG_LEVEL >= 1)
+
37 printf("GW Begin\n");
+
38 printf("Config Device address 0%o nodeID %d\n", address, mesh_nodeID);
+
39#endif
+
40 config_TUN = configTUN;
+
41
+
42 /// FIX
+
43
+
44 channel = _channel; // 97;
+
45
+
46 dataRate = data_rate;
+
47
+
48 configDevice(address);
+
49 mesh_enabled = meshEnable;
+
50 thisNodeID = mesh_nodeID;
+
51 thisNodeAddress = address;
+
52
+
53 if (meshEnable) {
+
54 // GW radio channel setting takes precedence over mesh_default_channel
+
55 if (channel == 97 && MESH_DEFAULT_CHANNEL != 97) {
+
56 channel = MESH_DEFAULT_CHANNEL;
+
57 }
+
58
+
59 if (!thisNodeAddress && !mesh_nodeID) {
+
60 mesh.setNodeID(0);
61 }
-
62
-
63 if (!thisNodeAddress && !mesh_nodeID) {
-
64 mesh.setNodeID(0);
-
65 }
-
66 else {
-
67 if (!mesh_nodeID) {
-
68 mesh_nodeID = 253;
-
69 }
-
70 mesh.setNodeID(mesh_nodeID); // Try not to conflict with any low-numbered node-ids
-
71 }
-
72 mesh.begin(channel, data_rate);
-
73 thisNodeAddress = mesh.mesh_address;
-
74 }
-
75 else {
-
76 radio.begin();
-
77 delay(5);
-
78 const uint16_t this_node = address;
-
79 radio.setDataRate(dataRate);
-
80 radio.setChannel(channel);
-
81
-
82 network.begin(/*node address*/ this_node);
-
83 thisNodeAddress = this_node;
-
84 }
-
85 network.multicastRelay = 1;
+
62 else {
+
63 if (!mesh_nodeID) {
+
64 mesh_nodeID = 253;
+
65 }
+
66 mesh.setNodeID(mesh_nodeID); // Try not to conflict with any low-numbered node-ids
+
67 }
+
68 mesh.begin(channel, data_rate);
+
69 thisNodeAddress = mesh.mesh_address;
+
70 }
+
71 else {
+
72 radio.begin();
+
73 delay(5);
+
74 const uint16_t this_node = address;
+
75 radio.setDataRate(dataRate);
+
76 radio.setChannel(channel);
+
77
+
78 network.begin(/*node address*/ this_node);
+
79 thisNodeAddress = this_node;
+
80 }
+
81 network.multicastRelay = 1;
+
82
+
83 //#if (DEBUG_LEVEL >= 1)
+
84 radio.printDetails();
+
85 //#endif
86
-
87 //#if (DEBUG_LEVEL >= 1)
-
88 radio.printDetails();
-
89 //#endif
-
90
-
91 setupSocket();
-
92 loadRoutingTable();
-
93
-
94 return true;
-
95}
-
96
-
97/***************************************************************************************/
-
98
-
99template<class mesh_t, class network_t, class radio_t>
-
100void ESBGateway<mesh_t, network_t, radio_t>::loadRoutingTable()
-
101{
-
102 std::ifstream infile("routing.txt", std::ifstream::in);
-
103 if (!infile) {
-
104 return;
-
105 }
+
87 setupSocket();
+
88 loadRoutingTable();
+
89
+
90 return true;
+
91}
+
92
+
93/***************************************************************************************/
+
94
+
95void RF24Gateway::loadRoutingTable()
+
96{
+
97 std::ifstream infile("routing.txt", std::ifstream::in);
+
98 if (!infile) {
+
99 return;
+
100 }
+
101
+
102 std::string str;
+
103 std::string ip, mask, gw;
+
104 uint16_t count = 0;
+
105 std::string space = " ";
106
-
107 std::string str;
-
108 std::string ip, mask, gw;
-
109 uint16_t count = 0;
-
110 std::string space = " ";
-
111
-
112 while (std::getline(infile, str)) {
-
113 size_t startLen = 0;
-
114 size_t subLen = str.find(space);
-
115 if (subLen != std::string::npos) {
-
116 ip = str.substr(0, subLen);
-
117 }
-
118 else {
-
119 continue;
-
120 }
-
121 startLen = subLen + 1;
-
122 subLen = str.find(space, startLen);
-
123 if (subLen != std::string::npos) {
-
124 subLen -= (startLen);
-
125 mask = str.substr(startLen, subLen);
-
126 }
-
127 else {
-
128 continue;
-
129 }
-
130 startLen = startLen + subLen + 1;
-
131 subLen = str.length() - (startLen);
-
132 gw = str.substr(startLen, subLen);
-
133
-
134 routingStruct[count].ip.s_addr = ntohl(inet_network(ip.c_str()));
-
135 routingStruct[count].mask.s_addr = ntohl(inet_network(mask.c_str()));
-
136 routingStruct[count].gw.s_addr = ntohl(inet_network(gw.c_str()));
-
137
-
138 count++;
-
139 if (count >= 256) {
-
140 break;
-
141 }
-
142 }
-
143 routingTableSize = count;
+
107 while (std::getline(infile, str)) {
+
108 size_t startLen = 0;
+
109 size_t subLen = str.find(space);
+
110 if (subLen != std::string::npos) {
+
111 ip = str.substr(0, subLen);
+
112 }
+
113 else {
+
114 continue;
+
115 }
+
116 startLen = subLen + 1;
+
117 subLen = str.find(space, startLen);
+
118 if (subLen != std::string::npos) {
+
119 subLen -= (startLen);
+
120 mask = str.substr(startLen, subLen);
+
121 }
+
122 else {
+
123 continue;
+
124 }
+
125 startLen = startLen + subLen + 1;
+
126 subLen = str.length() - (startLen);
+
127 gw = str.substr(startLen, subLen);
+
128
+
129 routingStruct[count].ip.s_addr = ntohl(inet_network(ip.c_str()));
+
130 routingStruct[count].mask.s_addr = ntohl(inet_network(mask.c_str()));
+
131 routingStruct[count].gw.s_addr = ntohl(inet_network(gw.c_str()));
+
132
+
133 count++;
+
134 if (count >= 256) {
+
135 break;
+
136 }
+
137 }
+
138 routingTableSize = count;
+
139
+
140 // for(int i=0; i<count; i++){
+
141 // std::cout << inet_ntoa(routingStruct[i].ip) << ";" << inet_ntoa(routingStruct[i].mask) << ";" << inet_ntoa(routingStruct[i].gw) << std::endl;
+
142 // }
+
143}
144
-
145 // for(int i=0; i<count; i++){
-
146 // std::cout << inet_ntoa(routingStruct[i].ip) << ";" << inet_ntoa(routingStruct[i].mask) << ";" << inet_ntoa(routingStruct[i].gw) << std::endl;
-
147 // }
-
148}
-
149
-
150/***************************************************************************************/
+
145/***************************************************************************************/
+
146
+
147bool RF24Gateway::meshEnabled()
+
148{
+
149 return mesh_enabled;
+
150}
151
-
152template<class mesh_t, class network_t, class radio_t>
-
-
153bool ESBGateway<mesh_t, network_t, radio_t>::meshEnabled()
-
154{
-
155 return mesh_enabled;
-
156}
-
-
157
-
158/***************************************************************************************/
-
159
-
160template<class mesh_t, class network_t, class radio_t>
-
161int ESBGateway<mesh_t, network_t, radio_t>::configDevice(uint16_t address)
-
162{
-
163 std::string tunTapDevice = "tun_nrf24";
-
164 strcpy(tunName, tunTapDevice.c_str());
-
165
-
166 int flags;
-
167 if (config_TUN) {
-
168 flags = IFF_TUN | IFF_NO_PI | IFF_MULTI_QUEUE;
-
169 }
-
170 else {
-
171 flags = IFF_TAP | IFF_NO_PI | IFF_MULTI_QUEUE;
-
172 }
-
173 tunFd = allocateTunDevice(tunName, flags, address);
-
174#if DEBUG_LEVEL >= 1
-
175 if (tunFd >= 0) {
-
176 std::cout << "RF24Gw: Successfully attached to tun/tap device " << tunTapDevice << std::endl;
-
177 }
-
178 else {
-
179 std::cerr << "RF24Gw: Error allocating tun/tap interface: " << tunFd << std::endl;
-
180 exit(1);
-
181 }
-
182#endif
-
183 return tunFd;
-
184}
+
152/***************************************************************************************/
+
153
+
154int RF24Gateway::configDevice(uint16_t address)
+
155{
+
156 std::string tunTapDevice = "tun_nrf24";
+
157 strcpy(tunName, tunTapDevice.c_str());
+
158
+
159 int flags;
+
160 if (config_TUN) {
+
161 flags = IFF_TUN | IFF_NO_PI | IFF_MULTI_QUEUE;
+
162 }
+
163 else {
+
164 flags = IFF_TAP | IFF_NO_PI | IFF_MULTI_QUEUE;
+
165 }
+
166 tunFd = allocateTunDevice(tunName, flags, address);
+
167#if DEBUG_LEVEL >= 1
+
168 if (tunFd >= 0) {
+
169 std::cout << "RF24Gw: Successfully attached to tun/tap device " << tunTapDevice << std::endl;
+
170 }
+
171 else {
+
172 std::cerr << "RF24Gw: Error allocating tun/tap interface: " << tunFd << std::endl;
+
173 exit(1);
+
174 }
+
175#endif
+
176 return tunFd;
+
177}
+
178
+
179/***************************************************************************************/
+
180
+
181int RF24Gateway::allocateTunDevice(char* dev, int flags, uint16_t address)
+
182{
+
183 struct ifreq ifr;
+
184 int fd;
185
-
186/***************************************************************************************/
-
187
-
188template<class mesh_t, class network_t, class radio_t>
-
189int ESBGateway<mesh_t, network_t, radio_t>::allocateTunDevice(char* dev, int flags, uint16_t address)
-
190{
-
191 struct ifreq ifr;
-
192 int fd;
-
193
-
194 // open the device
-
195 if ((fd = open("/dev/net/tun", O_RDWR)) < 0) {
-
196 return fd;
+
186 // open the device
+
187 if ((fd = open("/dev/net/tun", O_RDWR)) < 0) {
+
188 return fd;
+
189 }
+
190
+
191 memset(&ifr, 0, sizeof(ifr));
+
192
+
193 ifr.ifr_flags = flags; // IFF_TUN or IFF_TAP, plus maybe IFF_NO_PI
+
194
+
195 if (*dev) {
+
196 strncpy(ifr.ifr_name, dev, IFNAMSIZ);
197 }
198
-
199 memset(&ifr, 0, sizeof(ifr));
-
200
-
201 ifr.ifr_flags = flags; // IFF_TUN or IFF_TAP, plus maybe IFF_NO_PI
-
202
-
203 if (*dev) {
-
204 strncpy(ifr.ifr_name, dev, IFNAMSIZ);
-
205 }
-
206
-
207 // Create device
-
208 if (ioctl(fd, TUNSETIFF, (void*)&ifr) < 0) {
-
209 // close(fd);
-
210 //#if (DEBUG_LEVEL >= 1)
-
211 std::cerr << "RF24Gw: Error: enabling TUNSETIFF" << std::endl;
-
212 std::cerr << "RF24Gw: If changing from TAP/TUN, run 'sudo ip link delete tun_nrf24' to remove the interface" << std::endl;
-
213 return -1;
-
214 //#endif
+
199 // Create device
+
200 if (ioctl(fd, TUNSETIFF, (void*)&ifr) < 0) {
+
201 // close(fd);
+
202 //#if (DEBUG_LEVEL >= 1)
+
203 std::cerr << "RF24Gw: Error: enabling TUNSETIFF" << std::endl;
+
204 std::cerr << "RF24Gw: If changing from TAP/TUN, run 'sudo ip link delete tun_nrf24' to remove the interface" << std::endl;
+
205 return -1;
+
206 //#endif
+
207 }
+
208
+
209 // Make persistent
+
210 if (ioctl(fd, TUNSETPERSIST, 1) < 0) {
+
211#if (DEBUG_LEVEL >= 1)
+
212 std::cerr << "RF24Gw: Error: enabling TUNSETPERSIST" << std::endl;
+
213#endif
+
214 return -1;
215 }
216
-
217 // Make persistent
-
218 if (ioctl(fd, TUNSETPERSIST, 1) < 0) {
-
219#if (DEBUG_LEVEL >= 1)
-
220 std::cerr << "RF24Gw: Error: enabling TUNSETPERSIST" << std::endl;
-
221#endif
-
222 return -1;
-
223 }
-
224
-
225 if (!config_TUN) {
-
226 struct sockaddr sap;
-
227 sap.sa_family = ARPHRD_ETHER;
-
228 ((char*)sap.sa_data)[4] = address;
-
229 ((char*)sap.sa_data)[5] = address >> 8;
-
230 ((char*)sap.sa_data)[0] = 0x52;
-
231 ((char*)sap.sa_data)[1] = 0x46;
-
232 ((char*)sap.sa_data)[2] = 0x32;
-
233 ((char*)sap.sa_data)[3] = 0x34;
-
234
-
235 // printf("Address 0%o first %u last %u\n",address,sap.sa_data[0],sap.sa_data[1]);
-
236 memcpy((char*)&ifr.ifr_hwaddr, (char*)&sap, sizeof(struct sockaddr));
-
237
-
238 if (ioctl(fd, SIOCSIFHWADDR, &ifr) < 0) {
-
239#if DEBUG_LEVEL >= 1
-
240 fprintf(stderr, "RF24Gw: Failed to set MAC address\n");
-
241#endif
-
242 }
-
243 }
-
244
-
245 strcpy(dev, ifr.ifr_name);
-
246 return fd;
-
247}
-
248
-
249/***************************************************************************************/
-
250
-
251template<class mesh_t, class network_t, class radio_t>
-
-
252int ESBGateway<mesh_t, network_t, radio_t>::setIP(char* ip_addr, char* mask)
-
253{
-
254 struct ifreq ifr;
-
255 struct sockaddr_in sin;
-
256 int sockfd = socket(AF_INET, SOCK_DGRAM, 0);
-
257 if (sockfd == -1) {
-
258 fprintf(stderr, "Could not get socket.\n");
-
259 return -1;
-
260 }
-
261
-
262 sin.sin_family = AF_INET;
-
263 // inet_aton(ip_addr,&sin.sin_addr.s_addr);
-
264 inet_aton(ip_addr, &sin.sin_addr);
-
265 strncpy(ifr.ifr_name, tunName, IFNAMSIZ);
-
266
-
267 if (ioctl(sockfd, SIOCGIFFLAGS, &ifr) < 0) {
-
268 fprintf(stderr, "ifdown: shutdown ");
-
269 perror(ifr.ifr_name);
-
270 return -1;
-
271 }
-
272
-
273#ifdef ifr_flags
-
274 #define IRFFLAGS ifr_flags
-
275#else /* Present on kFreeBSD */
-
276 #define IRFFLAGS ifr_flagshigh
-
277#endif
-
278
-
279 if (!(ifr.IRFFLAGS & IFF_UP)) {
-
280 // fprintf(stdout, "Device is currently down..setting up.-- %u\n", ifr.IRFFLAGS);
-
281 ifr.IRFFLAGS |= IFF_UP;
-
282 if (ioctl(sockfd, SIOCSIFFLAGS, &ifr) < 0) {
-
283 fprintf(stderr, "ifup: failed ");
-
284 perror(ifr.ifr_name);
-
285 return -1;
-
286 }
+
217 if (!config_TUN) {
+
218 struct sockaddr sap;
+
219 sap.sa_family = ARPHRD_ETHER;
+
220 ((char*)sap.sa_data)[4] = address;
+
221 ((char*)sap.sa_data)[5] = address >> 8;
+
222 ((char*)sap.sa_data)[0] = 0x52;
+
223 ((char*)sap.sa_data)[1] = 0x46;
+
224 ((char*)sap.sa_data)[2] = 0x32;
+
225 ((char*)sap.sa_data)[3] = 0x34;
+
226
+
227 // printf("Address 0%o first %u last %u\n",address,sap.sa_data[0],sap.sa_data[1]);
+
228 memcpy((char*)&ifr.ifr_hwaddr, (char*)&sap, sizeof(struct sockaddr));
+
229
+
230 if (ioctl(fd, SIOCSIFHWADDR, &ifr) < 0) {
+
231#if DEBUG_LEVEL >= 1
+
232 fprintf(stderr, "RF24Gw: Failed to set MAC address\n");
+
233#endif
+
234 }
+
235 }
+
236
+
237 strcpy(dev, ifr.ifr_name);
+
238 return fd;
+
239}
+
240
+
241/***************************************************************************************/
+
242
+
243int RF24Gateway::setIP(char* ip_addr, char* mask)
+
244{
+
245 struct ifreq ifr;
+
246 struct sockaddr_in sin;
+
247 int sockfd = socket(AF_INET, SOCK_DGRAM, 0);
+
248 if (sockfd == -1) {
+
249 fprintf(stderr, "Could not get socket.\n");
+
250 return -1;
+
251 }
+
252
+
253 sin.sin_family = AF_INET;
+
254 // inet_aton(ip_addr,&sin.sin_addr.s_addr);
+
255 inet_aton(ip_addr, &sin.sin_addr);
+
256 strncpy(ifr.ifr_name, tunName, IFNAMSIZ);
+
257
+
258 if (ioctl(sockfd, SIOCGIFFLAGS, &ifr) < 0) {
+
259 fprintf(stderr, "ifdown: shutdown ");
+
260 perror(ifr.ifr_name);
+
261 return -1;
+
262 }
+
263
+
264#ifdef ifr_flags
+
265 #define IRFFLAGS ifr_flags
+
266#else /* Present on kFreeBSD */
+
267 #define IRFFLAGS ifr_flagshigh
+
268#endif
+
269
+
270 if (!(ifr.IRFFLAGS & IFF_UP)) {
+
271 // fprintf(stdout, "Device is currently down..setting up.-- %u\n", ifr.IRFFLAGS);
+
272 ifr.IRFFLAGS |= IFF_UP;
+
273 if (ioctl(sockfd, SIOCSIFFLAGS, &ifr) < 0) {
+
274 fprintf(stderr, "ifup: failed ");
+
275 perror(ifr.ifr_name);
+
276 return -1;
+
277 }
+
278 }
+
279
+
280 memcpy(&ifr.ifr_addr, &sin, sizeof(struct sockaddr));
+
281
+
282 // Set interface address
+
283 if (ioctl(sockfd, SIOCSIFADDR, &ifr) < 0) {
+
284 fprintf(stderr, "Cannot set IP address. ");
+
285 perror(ifr.ifr_name);
+
286 return -1;
287 }
288
-
289 memcpy(&ifr.ifr_addr, &sin, sizeof(struct sockaddr));
-
290
-
291 // Set interface address
-
292 if (ioctl(sockfd, SIOCSIFADDR, &ifr) < 0) {
-
293 fprintf(stderr, "Cannot set IP address. ");
+
289 inet_aton(mask, &sin.sin_addr);
+
290 memcpy(&ifr.ifr_addr, &sin, sizeof(struct sockaddr));
+
291
+
292 if (ioctl(sockfd, SIOCSIFNETMASK, &ifr) < 0) {
+
293 fprintf(stderr, "Cannot define subnet mask for this device");
294 perror(ifr.ifr_name);
295 return -1;
296 }
297
-
298 inet_aton(mask, &sin.sin_addr);
-
299 memcpy(&ifr.ifr_addr, &sin, sizeof(struct sockaddr));
-
300
-
301 if (ioctl(sockfd, SIOCSIFNETMASK, &ifr) < 0) {
-
302 fprintf(stderr, "Cannot define subnet mask for this device");
-
303 perror(ifr.ifr_name);
-
304 return -1;
-
305 }
-
306
-
307#undef IRFFLAGS
-
308 return 0;
-
309}
-
-
310
-
311/***************************************************************************************/
+
298#undef IRFFLAGS
+
299 return 0;
+
300}
+
301
+
302/***************************************************************************************/
+
303void RF24Gateway::interrupts(bool enable)
+
304{
+
305 // No longer required
+
306}
+
307
+
308/***************************************************************************************/
+
309
+
310void RF24Gateway::update(bool interrupts)
+
311{
312
-
313template<class mesh_t, class network_t, class radio_t>
-
-
314void ESBGateway<mesh_t, network_t, radio_t>::interrupts(bool enable)
-
315{
-
316 // No longer required
-
317}
-
-
318
-
319/***************************************************************************************/
-
320
-
321template<class mesh_t, class network_t, class radio_t>
-
-
322void ESBGateway<mesh_t, network_t, radio_t>::update(bool interrupts)
-
323{
-
324
-
325 if (interrupts) {
-
326 gotInterrupt = true;
-
327 }
-
328 else {
-
329 handleRadioIn();
-
330 handleTX();
-
331 handleRX();
-
332 handleRadioOut();
+
313 if (interrupts) {
+
314 gotInterrupt = true;
+
315 }
+
316 else {
+
317 handleRadioIn();
+
318 handleTX();
+
319 handleRX();
+
320 handleRadioOut();
+
321 }
+
322}
+
323
+
324/***************************************************************************************/
+
325
+
326void RF24Gateway::poll(uint32_t waitDelay)
+
327{
+
328
+
329 if (gotInterrupt) {
+
330 gotInterrupt = false;
+
331 handleRadioIn();
+
332 handleTX();
333 }
-
334}
-
-
335
-
336/***************************************************************************************/
-
337
-
338template<class mesh_t, class network_t, class radio_t>
-
-
339void ESBGateway<mesh_t, network_t, radio_t>::poll(uint32_t waitDelay)
-
340{
-
341
-
342 if (gotInterrupt) {
-
343 gotInterrupt = false;
-
344 handleRadioIn();
-
345 handleTX();
-
346 }
-
347 else if (radio.rxFifoFull()) {
-
348 fifoCleared = true;
-
349 handleRadioIn();
-
350 handleRadioOut();
-
351 }
-
352 else {
-
353 delay(waitDelay);
-
354 }
-
355 handleRX();
-
356 handleRadioOut();
-
357}
-
-
358
-
359/***************************************************************************************/
+
334 else if (radio.rxFifoFull()) {
+
335 fifoCleared = true;
+
336 handleRadioIn();
+
337 handleRadioOut();
+
338 }
+
339 else {
+
340 delay(waitDelay);
+
341 }
+
342 handleRX();
+
343 handleRadioOut();
+
344}
+
345/***************************************************************************************/
+
346
+
347void RF24Gateway::handleRadioIn()
+
348{
+
349 if (mesh_enabled) {
+
350 while (mesh.update()) {
+
351 if (!thisNodeAddress) {
+
352 mesh.DHCP();
+
353 }
+
354 }
+
355 }
+
356 else {
+
357 while (network.update()) {
+
358 }
+
359 }
360
-
361template<class mesh_t, class network_t, class radio_t>
-
362void ESBGateway<mesh_t, network_t, radio_t>::handleRadioIn()
-
363{
-
364 if (mesh_enabled) {
-
365 while (mesh.update()) {
-
366 if (!thisNodeAddress) {
-
367 mesh.DHCP();
-
368 }
-
369 }
-
370 }
-
371 else {
-
372 while (network.update()) {
-
373 }
-
374 }
-
375
-
376 RF24NetworkFrame f;
-
377 while (network.external_queue.size() > 0) {
-
378 f = network.external_queue.front();
-
379
-
380 msgStruct msg;
-
381
-
382 unsigned int bytesRead = f.message_size;
-
383
-
384 if (bytesRead > 0) {
-
385 memcpy(&msg.message, &f.message_buffer, bytesRead);
-
386 msg.size = bytesRead;
-
387
-
388#if (DEBUG_LEVEL >= 1)
-
389 std::cout << "Radio: Received " << bytesRead << " bytes ... " << std::endl;
-
390#endif
-
391#if (DEBUG_LEVEL >= 3)
-
392 // printPayload(msg.getPayloadStr(),"radio RX");
-
393 std::cout << "TunRead: " << std::endl;
-
394 for (size_t i = 0; i < msg.size; i++) {
-
395 // std::cout << std::hex << buffer[i];
-
396 printf(":%0x :", msg.message[i]);
-
397 }
-
398 std::cout << std::endl;
-
399
-
400#endif
-
401
-
402 rxQueue.push(msg);
-
403 }
-
404 else {
-
405 // std::cerr << "Radio: Error reading data from radio. Read '" << bytesRead << "' Bytes." << std::endl;
-
406 }
-
407 network.external_queue.pop();
-
408 }
-
409}
-
410
-
411/***************************************************************************************/
-
412
-
413template<class mesh_t, class network_t, class radio_t>
-
414struct in_addr ESBGateway<mesh_t, network_t, radio_t>::getLocalIP()
-
415{
-
416 struct ifaddrs *ifap, *ifa;
-
417 int family, s, n;
-
418 char host[NI_MAXHOST];
-
419 struct in_addr myNet;
-
420
-
421 getifaddrs(&ifap);
-
422 for (ifa = ifap, n = 0; ifa != NULL; ifa = ifa->ifa_next, n++) {
-
423 if (std::string("tun_nrf24").compare(ifa->ifa_name) != 0 || ifa->ifa_addr == NULL) {
-
424 if (ifa->ifa_next == NULL) {
-
425 break;
-
426 }
-
427 else {
-
428 continue;
-
429 }
-
430 }
+
361 RF24NetworkFrame f;
+
362 while (network.external_queue.size() > 0) {
+
363 f = network.external_queue.front();
+
364
+
365 msgStruct msg;
+
366
+
367 unsigned int bytesRead = f.message_size;
+
368
+
369 if (bytesRead > 0) {
+
370 memcpy(&msg.message, &f.message_buffer, bytesRead);
+
371 msg.size = bytesRead;
+
372
+
373#if (DEBUG_LEVEL >= 1)
+
374 std::cout << "Radio: Received " << bytesRead << " bytes ... " << std::endl;
+
375#endif
+
376#if (DEBUG_LEVEL >= 3)
+
377 // printPayload(msg.getPayloadStr(),"radio RX");
+
378 std::cout << "TunRead: " << std::endl;
+
379 for (size_t i = 0; i < msg.size; i++) {
+
380 // std::cout << std::hex << buffer[i];
+
381 printf(":%0x :", msg.message[i]);
+
382 }
+
383 std::cout << std::endl;
+
384
+
385#endif
+
386
+
387 rxQueue.push(msg);
+
388 }
+
389 else {
+
390 // std::cerr << "Radio: Error reading data from radio. Read '" << bytesRead << "' Bytes." << std::endl;
+
391 }
+
392 network.external_queue.pop();
+
393 }
+
394}
+
395
+
396/***************************************************************************************/
+
397
+
398struct in_addr RF24Gateway::getLocalIP()
+
399{
+
400 struct ifaddrs *ifap, *ifa;
+
401 int family, s, n;
+
402 char host[NI_MAXHOST];
+
403 struct in_addr myNet;
+
404
+
405 getifaddrs(&ifap);
+
406 for (ifa = ifap, n = 0; ifa != NULL; ifa = ifa->ifa_next, n++) {
+
407 if (std::string("tun_nrf24").compare(ifa->ifa_name) != 0 || ifa->ifa_addr == NULL) {
+
408 if (ifa->ifa_next == NULL) {
+
409 break;
+
410 }
+
411 else {
+
412 continue;
+
413 }
+
414 }
+
415
+
416 family = ifa->ifa_addr->sa_family;
+
417
+
418 // This is an IPv4 interface, get the IP
+
419 if (family == AF_INET) {
+
420 s = getnameinfo(ifa->ifa_addr, sizeof(struct sockaddr_in), host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST);
+
421 if (s == 0) {
+
422 myNet.s_addr = ntohl(inet_network(host));
+
423 freeifaddrs(ifap);
+
424 return myNet;
+
425 }
+
426 }
+
427 }
+
428 freeifaddrs(ifap);
+
429 return myNet;
+
430}
431
-
432 family = ifa->ifa_addr->sa_family;
+
432/***************************************************************************************/
433
-
434 // This is an IPv4 interface, get the IP
-
435 if (family == AF_INET) {
-
436 s = getnameinfo(ifa->ifa_addr, sizeof(struct sockaddr_in), host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST);
-
437 if (s == 0) {
-
438 myNet.s_addr = ntohl(inet_network(host));
-
439 freeifaddrs(ifap);
-
440 return myNet;
-
441 }
-
442 }
-
443 }
-
444 freeifaddrs(ifap);
-
445 return myNet;
-
446}
+
434void RF24Gateway::handleRadioOut()
+
435{
+
436 bool ok = 0;
+
437
+
438 while (!txQueue.empty() && network.external_queue.size() == 0) {
+
439
+
440 msgStruct* msgTx = &txQueue.front();
+
441
+
442#if (DEBUG_LEVEL >= 1)
+
443 std::cout << "Radio: Sending " << msgTx->size << " bytes ... ";
+
444 std::cout << std::endl;
+
445#endif
+
446#if (DEBUG_LEVEL >= 3)
447
-
448/***************************************************************************************/
-
449
-
450template<class mesh_t, class network_t, class radio_t>
-
451void ESBGateway<mesh_t, network_t, radio_t>::handleRadioOut()
-
452{
-
453 bool ok = 0;
-
454
-
455 while (!txQueue.empty() && network.external_queue.size() == 0) {
-
456
-
457 msgStruct* msgTx = &txQueue.front();
-
458
-
459#if (DEBUG_LEVEL >= 1)
-
460 std::cout << "Radio: Sending " << msgTx->size << " bytes ... ";
-
461 std::cout << std::endl;
-
462#endif
-
463#if (DEBUG_LEVEL >= 3)
-
464
-
465 // PrintDebug == 1 does not have an endline.
-
466 // printPayload(msg.getPayloadStr(),"radio TX");
-
467#endif
-
468
-
469 std::uint8_t* tmp = msgTx->message;
-
470
-
471 if (!config_TUN) { // TAP can use RF24Mesh for address assignment, but will still use ARP for address resolution
-
472
-
473 uint32_t RF24_STR = 0x34324652; // Identifies the mac as an RF24 mac
-
474 uint32_t ARP_BC = 0xFFFFFFFF; // Broadcast address
-
475 struct macStruct
-
476 {
-
477 uint32_t rf24_Verification;
-
478 uint16_t rf24_Addr;
-
479 };
-
480
-
481 macStruct macData;
-
482 memcpy(&macData.rf24_Addr, tmp + 4, 2);
-
483 memcpy(&macData.rf24_Verification, tmp, 4);
-
484
-
485 if (macData.rf24_Verification == RF24_STR) {
-
486 const uint16_t other_node = macData.rf24_Addr;
-
487 RF24NetworkHeader header(/*to node*/ other_node, EXTERNAL_DATA_TYPE);
-
488 ok = network.write(header, &msgTx->message, msgTx->size);
-
489 }
-
490 else if (macData.rf24_Verification == ARP_BC) {
-
491 RF24NetworkHeader header(/*to node*/ 00, EXTERNAL_DATA_TYPE); // Set to master node, will be modified by RF24Network if multi-casting
-
492 if (msgTx->size <= 42) {
-
493 if (thisNodeAddress == 00) { // Master Node
-
494
-
495 uint32_t arp_timeout = millis();
-
496
-
497 ok = network.multicast(header, &msgTx->message, msgTx->size, 1); // Send to Level 1
-
498 while (millis() - arp_timeout < 5) {
-
499 network.update();
-
500 }
-
501 network.multicast(header, &msgTx->message, msgTx->size, 1); // Send to Level 1
-
502 arp_timeout = millis();
-
503 while (millis() - arp_timeout < 15) {
-
504 network.update();
-
505 }
-
506 network.multicast(header, &msgTx->message, msgTx->size, 1); // Send to Level 1
-
507 }
-
508 else {
-
509 ok = network.write(header, &msgTx->message, msgTx->size);
-
510 }
-
511 }
-
512 }
-
513 }
-
514 else { // TUN always needs to use RF24Mesh for address assignment AND resolution
-
515
-
516 uint8_t lastOctet = tmp[19];
-
517 int16_t meshAddr;
-
518
-
519 RF24NetworkHeader header(00, EXTERNAL_DATA_TYPE);
-
520 bool sendData = false;
-
521
-
522 struct in_addr ipDestination;
-
523 memcpy(&ipDestination.s_addr, &tmp[16], 4);
-
524
-
525 if ((getLocalIP().s_addr & 0x00FFFFFF) == (ipDestination.s_addr & 0x00FFFFFF)) { // Is inside the RF24Mesh network
-
526 if ((meshAddr = mesh.getAddress(lastOctet)) > 0) {
-
527 header.to_node = meshAddr;
-
528 sendData = true;
-
529 }
-
530 else {
-
531 if (thisNodeID > 0) { // If IP is in mesh range, address lookup fails, and this is not master,
-
532 sendData = true; // send to 00 anyway in case destination is master, or the lookup just failed
-
533 }
-
534 // printf("Could not find matching mesh nodeID for IP ending in %d\n",lastOctet);
-
535 }
-
536 }
-
537 else if (thisNodeID > 0) { // If not master, send to master for routing etc. if target not within mesh
-
538 sendData = true;
-
539 }
-
540 else if (routingTableSize > 0) {
-
541 for (int i = 0; i < routingTableSize; i++) {
-
542 struct in_addr network;
-
543 network.s_addr = routingStruct[i].ip.s_addr & routingStruct[i].mask.s_addr;
-
544 struct in_addr destNet;
-
545 destNet.s_addr = ipDestination.s_addr & routingStruct[i].mask.s_addr;
-
546 // printf("network %s destNet: %s\n",inet_ntoa(network),inet_ntoa(destNet));
-
547 if (destNet.s_addr == network.s_addr) {
-
548 uint8_t toNode = routingStruct[i].gw.s_addr >> 24;
-
549 int16_t netAddr = 0;
-
550 if ((netAddr = mesh.getAddress(toNode)) > 0) {
-
551 header.to_node = netAddr;
-
552 sendData = true;
-
553 break;
-
554 }
-
555 }
-
556 }
-
557 }
+
448 // PrintDebug == 1 does not have an endline.
+
449 // printPayload(msg.getPayloadStr(),"radio TX");
+
450#endif
+
451
+
452 std::uint8_t* tmp = msgTx->message;
+
453
+
454 if (!config_TUN) { // TAP can use RF24Mesh for address assignment, but will still use ARP for address resolution
+
455
+
456 uint32_t RF24_STR = 0x34324652; // Identifies the mac as an RF24 mac
+
457 uint32_t ARP_BC = 0xFFFFFFFF; // Broadcast address
+
458 struct macStruct
+
459 {
+
460 uint32_t rf24_Verification;
+
461 uint16_t rf24_Addr;
+
462 };
+
463
+
464 macStruct macData;
+
465 memcpy(&macData.rf24_Addr, tmp + 4, 2);
+
466 memcpy(&macData.rf24_Verification, tmp, 4);
+
467
+
468 if (macData.rf24_Verification == RF24_STR) {
+
469 const uint16_t other_node = macData.rf24_Addr;
+
470 RF24NetworkHeader header(/*to node*/ other_node, EXTERNAL_DATA_TYPE);
+
471 ok = network.write(header, &msgTx->message, msgTx->size);
+
472 }
+
473 else if (macData.rf24_Verification == ARP_BC) {
+
474 RF24NetworkHeader header(/*to node*/ 00, EXTERNAL_DATA_TYPE); // Set to master node, will be modified by RF24Network if multi-casting
+
475 if (msgTx->size <= 42) {
+
476 if (thisNodeAddress == 00) { // Master Node
+
477
+
478 uint32_t arp_timeout = millis();
+
479
+
480 ok = network.multicast(header, &msgTx->message, msgTx->size, 1); // Send to Level 1
+
481 while (millis() - arp_timeout < 5) {
+
482 network.update();
+
483 }
+
484 network.multicast(header, &msgTx->message, msgTx->size, 1); // Send to Level 1
+
485 arp_timeout = millis();
+
486 while (millis() - arp_timeout < 15) {
+
487 network.update();
+
488 }
+
489 network.multicast(header, &msgTx->message, msgTx->size, 1); // Send to Level 1
+
490 }
+
491 else {
+
492 ok = network.write(header, &msgTx->message, msgTx->size);
+
493 }
+
494 }
+
495 }
+
496 }
+
497 else { // TUN always needs to use RF24Mesh for address assignment AND resolution
+
498
+
499 uint8_t lastOctet = tmp[19];
+
500 int16_t meshAddr;
+
501
+
502 RF24NetworkHeader header(00, EXTERNAL_DATA_TYPE);
+
503 bool sendData = false;
+
504
+
505 struct in_addr ipDestination;
+
506 memcpy(&ipDestination.s_addr, &tmp[16], 4);
+
507
+
508 if ((getLocalIP().s_addr & 0x00FFFFFF) == (ipDestination.s_addr & 0x00FFFFFF)) { // Is inside the RF24Mesh network
+
509 if ((meshAddr = mesh.getAddress(lastOctet)) > 0) {
+
510 header.to_node = meshAddr;
+
511 sendData = true;
+
512 }
+
513 else {
+
514 if (thisNodeID > 0) { // If IP is in mesh range, address lookup fails, and this is not master,
+
515 sendData = true; // send to 00 anyway in case destination is master, or the lookup just failed
+
516 }
+
517 // printf("Could not find matching mesh nodeID for IP ending in %d\n",lastOctet);
+
518 }
+
519 }
+
520 else if (thisNodeID > 0) { // If not master, send to master for routing etc. if target not within mesh
+
521 sendData = true;
+
522 }
+
523 else if (routingTableSize > 0) {
+
524 for (int i = 0; i < routingTableSize; i++) {
+
525 struct in_addr network;
+
526 network.s_addr = routingStruct[i].ip.s_addr & routingStruct[i].mask.s_addr;
+
527 struct in_addr destNet;
+
528 destNet.s_addr = ipDestination.s_addr & routingStruct[i].mask.s_addr;
+
529 // printf("network %s destNet: %s\n",inet_ntoa(network),inet_ntoa(destNet));
+
530 if (destNet.s_addr == network.s_addr) {
+
531 uint8_t toNode = routingStruct[i].gw.s_addr >> 24;
+
532 int16_t netAddr = 0;
+
533 if ((netAddr = mesh.getAddress(toNode)) > 0) {
+
534 header.to_node = netAddr;
+
535 sendData = true;
+
536 break;
+
537 }
+
538 }
+
539 }
+
540 }
+
541
+
542 if (sendData) {
+
543 ok = network.write(header, msgTx->message, msgTx->size);
+
544 // std::cout << "SendData " << header.to_node << std::endl;
+
545 }
+
546 }
+
547 // delay( rf24_min(msgTx->size/48,20));
+
548 txQueue.pop();
+
549
+
550 // printf("Addr: 0%#x\n",macData.rf24_Addr);
+
551 // printf("Verif: 0%#x\n",macData.rf24_Verification);
+
552 if (ok) {
+
553 // std::cout << "ok." << std::endl;
+
554 }
+
555 else {
+
556 // std::cerr << "failed." << std::endl;
+
557 }
558
-
559 if (sendData) {
-
560 ok = network.write(header, msgTx->message, msgTx->size);
-
561 // std::cout << "SendData " << header.to_node << std::endl;
-
562 }
-
563 }
-
564 // delay( rf24_min(msgTx->size/48,20));
-
565 txQueue.pop();
-
566
-
567 // printf("Addr: 0%#x\n",macData.rf24_Addr);
-
568 // printf("Verif: 0%#x\n",macData.rf24_Verification);
-
569 if (ok) {
-
570 // std::cout << "ok." << std::endl;
-
571 }
-
572 else {
-
573 // std::cerr << "failed." << std::endl;
-
574 }
-
575
-
576 } // End Tx
-
577}
-
578
-
579/***************************************************************************************/
+
559 } // End Tx
+
560}
+
561
+
562/***************************************************************************************/
+
563
+
564void RF24Gateway::handleRX(uint32_t waitDelay)
+
565{
+
566 fd_set socketSet;
+
567 struct timeval selectTimeout;
+
568 uint8_t buffer[MAX_PAYLOAD_SIZE];
+
569 int nread;
+
570
+
571 FD_ZERO(&socketSet);
+
572 FD_SET(tunFd, &socketSet);
+
573
+
574 selectTimeout.tv_sec = 0;
+
575 selectTimeout.tv_usec = waitDelay * 1000;
+
576
+
577 if (select(tunFd + 1, &socketSet, NULL, NULL, &selectTimeout) != 0) {
+
578 if (FD_ISSET(tunFd, &socketSet)) {
+
579 if ((nread = read(tunFd, buffer, MAX_PAYLOAD_SIZE)) >= 0) {
580
-
581template<class mesh_t, class network_t, class radio_t>
-
582void ESBGateway<mesh_t, network_t, radio_t>::handleRX(uint32_t waitDelay)
-
583{
-
584 fd_set socketSet;
-
585 struct timeval selectTimeout;
-
586 uint8_t buffer[MAX_PAYLOAD_SIZE];
-
587 int nread;
-
588
-
589 FD_ZERO(&socketSet);
-
590 FD_SET(tunFd, &socketSet);
-
591
-
592 selectTimeout.tv_sec = 0;
-
593 selectTimeout.tv_usec = waitDelay * 1000;
-
594
-
595 if (select(tunFd + 1, &socketSet, NULL, NULL, &selectTimeout) != 0) {
-
596 if (FD_ISSET(tunFd, &socketSet)) {
-
597 if ((nread = read(tunFd, buffer, MAX_PAYLOAD_SIZE)) >= 0) {
-
598
-
599#if (DEBUG_LEVEL >= 1)
-
600 std::cout << "Tun: Successfully read " << nread << " bytes from tun device" << std::endl;
-
601#endif
-
602#if (DEBUG_LEVEL >= 3)
-
603 std::cout << "TunRead: " << std::endl;
-
604 for (int i = 0; i < nread; i++)
-
605 {
-
606 printf(":%0x :", buffer[i]);
-
607 }
-
608 std::cout << std::endl;
-
609#endif
-
610 msgStruct msg;
-
611 memcpy(&msg.message, &buffer, nread);
-
612 msg.size = nread;
-
613 if (txQueue.size() < 10) {
-
614 txQueue.push(msg);
-
615 }
-
616 else {
-
617 droppedIncoming++;
-
618 }
-
619 }
-
620 else {
-
621#if (DEBUG_LEVEL >= 1)
-
622 std::cerr << "Tun: Error while reading from tun/tap interface." << std::endl;
-
623#endif
-
624 }
-
625 }
-
626 }
-
627}
+
581#if (DEBUG_LEVEL >= 1)
+
582 std::cout << "Tun: Successfully read " << nread << " bytes from tun device" << std::endl;
+
583#endif
+
584#if (DEBUG_LEVEL >= 3)
+
585 std::cout << "TunRead: " << std::endl;
+
586 for (int i = 0; i < nread; i++)
+
587 {
+
588 printf(":%0x :", buffer[i]);
+
589 }
+
590 std::cout << std::endl;
+
591#endif
+
592 msgStruct msg;
+
593 memcpy(&msg.message, &buffer, nread);
+
594 msg.size = nread;
+
595 if (txQueue.size() < 10) {
+
596 txQueue.push(msg);
+
597 }
+
598 else {
+
599 droppedIncoming++;
+
600 }
+
601 }
+
602 else {
+
603#if (DEBUG_LEVEL >= 1)
+
604 std::cerr << "Tun: Error while reading from tun/tap interface." << std::endl;
+
605#endif
+
606 }
+
607 }
+
608 }
+
609}
+
610
+
611/***************************************************************************************/
+
612
+
613void RF24Gateway::handleTX()
+
614{
+
615
+
616 if (rxQueue.size() < 1)
+
617 {
+
618 return;
+
619 }
+
620 msgStruct* msg = &rxQueue.front();
+
621
+
622 if (msg->size > MAX_PAYLOAD_SIZE)
+
623 {
+
624 // printf("*****WTF OVER *****");
+
625 rxQueue.pop();
+
626 return;
+
627 }
628
-
629/***************************************************************************************/
-
630
-
631template<class mesh_t, class network_t, class radio_t>
-
632void ESBGateway<mesh_t, network_t, radio_t>::handleTX()
-
633{
-
634
-
635 if (rxQueue.size() < 1)
-
636 {
-
637 return;
-
638 }
-
639 msgStruct* msg = &rxQueue.front();
-
640
-
641 if (msg->size > MAX_PAYLOAD_SIZE)
-
642 {
-
643 // printf("*****WTF OVER *****");
-
644 rxQueue.pop();
-
645 return;
-
646 }
-
647
-
648 if (msg->size > 0)
-
649 {
-
650
-
651 size_t writtenBytes = write(tunFd, &msg->message, msg->size);
-
652 if (writtenBytes != msg->size)
-
653 {
-
654// std::cerr << "Tun: Less bytes written to tun/tap device then requested." << std::endl;
-
655#if DEBUG_LEVEL >= 1
-
656 printf("Tun: Less bytes written %d to tun/tap device then requested %d.", writtenBytes, msg->size);
-
657#endif
-
658 }
-
659 else
-
660 {
-
661#if (DEBUG_LEVEL >= 1)
-
662 std::cout << "Tun: Successfully wrote " << writtenBytes << " bytes to tun device" << std::endl;
-
663#endif
-
664 }
+
629 if (msg->size > 0)
+
630 {
+
631
+
632 size_t writtenBytes = write(tunFd, &msg->message, msg->size);
+
633 if (writtenBytes != msg->size)
+
634 {
+
635// std::cerr << "Tun: Less bytes written to tun/tap device then requested." << std::endl;
+
636#if DEBUG_LEVEL >= 1
+
637 printf("Tun: Less bytes written %d to tun/tap device then requested %d.", writtenBytes, msg->size);
+
638#endif
+
639 }
+
640 else
+
641 {
+
642#if (DEBUG_LEVEL >= 1)
+
643 std::cout << "Tun: Successfully wrote " << writtenBytes << " bytes to tun device" << std::endl;
+
644#endif
+
645 }
+
646
+
647#if (DEBUG_LEVEL >= 3)
+
648 // printPayload(msg.message,"tun write");
+
649 std::cout << "TunRead: " << std::endl;
+
650 for (size_t i = 0; i < msg->size; i++) {
+
651 // printf(":%0x :",msg->message[i]);
+
652 }
+
653 std::cout << std::endl;
+
654#endif
+
655 }
+
656
+
657 rxQueue.pop();
+
658}
+
659
+
660/***************************************************************************************/
+
661
+
662void printPayload(std::string buffer, std::string debugMsg = "")
+
663{
+
664}
665
-
666#if (DEBUG_LEVEL >= 3)
-
667 // printPayload(msg.message,"tun write");
-
668 std::cout << "TunRead: " << std::endl;
-
669 for (size_t i = 0; i < msg->size; i++) {
-
670 // printf(":%0x :",msg->message[i]);
-
671 }
-
672 std::cout << std::endl;
-
673#endif
-
674 }
-
675
-
676 rxQueue.pop();
-
677}
+
666/***************************************************************************************/
+
667
+
668void printPayload(char* buffer, int nread, std::string debugMsg = "")
+
669{
+
670}
+
671
+
672/***************************************************************************************/
+
673
+
674void RF24Gateway::setupSocket()
+
675{
+
676 int ret;
+
677 const char* myAddr = "127.0.0.1";
678
-
679/***************************************************************************************
-
680
-
681template<class mesh_t, class network_t, class radio_t>
-
682void ESBGateway<mesh_t, network_t, radio_t>::printPayload(std::string buffer, std::string debugMsg)
-
683{
-
684}
-
685
-
686/***************************************************************************************
-
687
-
688template<class mesh_t, class network_t, class radio_t>
-
689void ESBGateway<mesh_t, network_t, radio_t>::printPayload(char* buffer, int nread, std::string debugMsg)
-
690{
-
691}
-
692
-
693/***************************************************************************************/
-
694
-
695template<class mesh_t, class network_t, class radio_t>
-
696void ESBGateway<mesh_t, network_t, radio_t>::setupSocket()
+
679 addr.sin_family = AF_INET;
+
680 ret = inet_aton(myAddr, &addr.sin_addr);
+
681 if (ret == 0) {
+
682 perror("inet_aton");
+
683 exit(1);
+
684 }
+
685 addr.sin_port = htons(32001);
+
686 // buf = "Hello UDP";
+
687 s = socket(PF_INET, SOCK_DGRAM, 0);
+
688 if (s == -1) {
+
689 perror("socket");
+
690 exit(1);
+
691 }
+
692}
+
693
+
694/***************************************************************************************/
+
695
+
696void RF24Gateway::sendUDP(uint8_t nodeID, RF24NetworkFrame frame)
697{
-
698 int ret;
-
699 const char* myAddr = "127.0.0.1";
+
698
+
699 uint8_t buffer[MAX_PAYLOAD_SIZE + 11];
700
-
701 addr.sin_family = AF_INET;
-
702 ret = inet_aton(myAddr, &addr.sin_addr);
-
703 if (ret == 0) {
-
704 perror("inet_aton");
-
705 exit(1);
-
706 }
-
707 addr.sin_port = htons(32001);
-
708 // buf = "Hello UDP";
-
709 s = socket(PF_INET, SOCK_DGRAM, 0);
-
710 if (s == -1) {
-
711 perror("socket");
-
712 exit(1);
-
713 }
-
714}
-
715
-
716/***************************************************************************************/
-
717
-
718template<class mesh_t, class network_t, class radio_t>
-
-
719void ESBGateway<mesh_t, network_t, radio_t>::sendUDP(uint8_t nodeID, RF24NetworkFrame frame)
-
720{
-
721
-
722 uint8_t buffer[MAX_PAYLOAD_SIZE + 11];
-
723
-
724 memcpy(&buffer[0], &nodeID, 1);
-
725 memcpy(&buffer[1], &frame.header, 8);
-
726 memcpy(&buffer[9], &frame.message_size, 2);
-
727 memcpy(&buffer[11], &frame.message_buffer, frame.message_size);
-
728
-
729 int ret = sendto(s, &buffer, frame.message_size + 11, 0, (struct sockaddr*)&addr, sizeof(addr));
-
730 if (ret == -1)
-
731 {
-
732 perror("sendto");
-
733 exit(1);
-
734 }
-
735}
-
-
736
-
737// ensure the compiler is aware of the possible datatype for the template class
-
738template class ESBGateway<ESBMesh<ESBNetwork<RF24>, RF24>, ESBNetwork<RF24>, RF24>;
-
ESBGateway
Definition RF24Gateway.h:66
-
ESBGateway::meshEnabled
bool meshEnabled()
Definition RF24Gateway.cpp:153
-
ESBGateway::setIP
int setIP(char *ip_addr, char *mask)
Definition RF24Gateway.cpp:252
-
ESBGateway::interrupts
void interrupts(bool enable=1)
Definition RF24Gateway.cpp:314
-
ESBGateway::poll
void poll(uint32_t waitDelay=3)
Definition RF24Gateway.cpp:339
-
ESBGateway::ESBGateway
ESBGateway(radio_t &_radio, network_t &_network, mesh_t &_mesh)
Definition RF24Gateway.cpp:13
-
ESBGateway::begin
void begin(uint8_t nodeID=0, uint8_t channel=97, rf24_datarate_e data_rate=RF24_1MBPS)
Definition RF24Gateway.cpp:21
-
ESBGateway::update
void update(bool interrupts=0)
Definition RF24Gateway.cpp:322
-
ESBGateway::sendUDP
void sendUDP(uint8_t nodeID, RF24NetworkFrame frame)
Definition RF24Gateway.cpp:719
-
ESBNetwork
Definition RF24Gateway.h:45
+
701 memcpy(&buffer[0], &nodeID, 1);
+
702 memcpy(&buffer[1], &frame.header, 8);
+
703 memcpy(&buffer[9], &frame.message_size, 2);
+
704 memcpy(&buffer[11], &frame.message_buffer, frame.message_size);
+
705
+
706 int ret = sendto(s, &buffer, frame.message_size + 11, 0, (struct sockaddr*)&addr, sizeof(addr));
+
707 if (ret == -1)
+
708 {
+
709 perror("sendto");
+
710 exit(1);
+
711 }
+
712}
+
RF24Gateway
Definition: RF24Gateway.h:47
+
RF24Gateway::thisNodeAddress
uint16_t thisNodeAddress
Definition: RF24Gateway.h:134
+
RF24Gateway::setIP
int setIP(char *ip_addr, char *mask)
Definition: RF24Gateway.cpp:243
+
RF24Gateway::interrupts
void interrupts(bool enable=1)
Definition: RF24Gateway.cpp:303
+
RF24Gateway::thisNodeID
uint8_t thisNodeID
Definition: RF24Gateway.h:135
+
RF24Gateway::meshEnabled
bool meshEnabled()
Definition: RF24Gateway.cpp:147
+
RF24Gateway::routingTableSize
uint8_t routingTableSize
Definition: RF24Gateway.h:199
+
RF24Gateway::begin
void begin(uint8_t nodeID=0, uint8_t channel=97, rf24_datarate_e data_rate=RF24_1MBPS)
Definition: RF24Gateway.cpp:19
+
RF24Gateway::sendUDP
void sendUDP(uint8_t nodeID, RF24NetworkFrame frame)
Definition: RF24Gateway.cpp:696
+
RF24Gateway::update
void update(bool interrupts=0)
Definition: RF24Gateway.cpp:310
+
RF24Gateway::RF24Gateway
RF24Gateway(RF24 &_radio, RF24Network &_network, RF24Mesh &_mesh)
Definition: RF24Gateway.cpp:12
+
RF24Gateway::routingStruct
routeStruct routingStruct[256]
Definition: RF24Gateway.h:194
+
RF24Gateway::fifoCleared
bool fifoCleared
Definition: RF24Gateway.h:139
+
RF24Gateway::config_TUN
bool config_TUN
Definition: RF24Gateway.h:138
+
RF24Gateway::poll
void poll(uint32_t waitDelay=3)
Definition: RF24Gateway.cpp:326
+
RF24Gateway::routeStruct::mask
struct in_addr mask
Definition: RF24Gateway.h:187
+
RF24Gateway::routeStruct::gw
struct in_addr gw
Definition: RF24Gateway.h:188
+
RF24Gateway::routeStruct::ip
struct in_addr ip
Definition: RF24Gateway.h:186
diff --git a/RF24Gateway_8h_source.html b/RF24Gateway_8h_source.html index 6cf07ca..1fec5db 100644 --- a/RF24Gateway_8h_source.html +++ b/RF24Gateway_8h_source.html @@ -3,15 +3,12 @@ - + RF24Gateway - TCP/IP over RF24Network: RF24Gateway.h Source File - - - @@ -26,7 +23,7 @@ -
RF24Gateway - TCP/IP over RF24Network v2.0.0 +
RF24Gateway - TCP/IP over RF24Network v1.1.0
TMRh20 - Pushing the practical limits of RF24 modules
@@ -35,7 +32,7 @@
- + -
40#define BACKLOG 10 /* Passed to listen() */
41
42class RF24;
-
43
-
44template<class radio_t>
-
45class ESBNetwork;
-
46
-
47template<class network_t, class radio_t>
-
48class ESBMesh;
-
49
-
50/**
-
51 * @tparam mesh_t The `mesh` object's type. Defaults to `RF24Mesh` for legacy behavior.
-
52 * This new abstraction is really meant for using the nRF52840 SoC as a drop-in replacement
-
53 * for the nRF24L01 radio. For more detail, see the
-
54 * [nrf_to_nrf Arduino library](https://github.com/TMRh20/nrf_to_nrf).
-
55 * @tparam network_t The `network` object's type. Defaults to `RF24Network` for legacy behavior.
-
56 * This new abstraction is really meant for using the nRF52840 SoC as a drop-in replacement
-
57 * for the nRF24L01 radio. For more detail, see the
-
58 * [nrf_to_nrf Arduino library](https://github.com/TMRh20/nrf_to_nrf).
-
59 * @tparam radio_t The `radio` object's type. Defaults to `RF24` for legacy behavior.
-
60 * This new abstraction is really meant for using the nRF52840 SoC as a drop-in replacement
-
61 * for the nRF24L01 radio. For more detail, see the
-
62 * [nrf_to_nrf Arduino library](https://github.com/TMRh20/nrf_to_nrf).
-
63 */
-
64template<class mesh_t = ESBMesh<ESBNetwork<RF24>, RF24>, class network_t = ESBNetwork<RF24>, class radio_t = RF24>
-
-
65class ESBGateway
-
66{
-
67
-
68 /**
-
69 * @name RF24Gateway (RPi/Linux)
-
70 *
-
71 * RF24Gateway library for devices with an IP stack
-
72 */
-
73 /**@{*/
-
74
-
75public:
-
76 /**
-
77 * ESBGateway constructor.
-
78 * @code
-
79 * RF24 radio(7,8);
-
80 * RF24Network network(radio);
-
81 * RF24Mesh mesh(radio,network);
-
82 * RF24Gateway gateway(radio,network,mesh);
-
83 * @endcode
-
84 */
-
85 ESBGateway(radio_t& _radio, network_t& _network, mesh_t& _mesh);
-
86
-
87 /**
-
88 * Begin function for use with RF24Mesh (TUN interface)
-
89 *
-
90 * @param nodeID The RF24Mesh nodeID to use
-
91 * @param channel The radio channel to use (1-127)
-
92 * @param data_rate The RF24 datarate to use (RF24_250KBPS, RF24_1MBPS, RF24_2MBPS)
-
93 *
-
94 * @code gw.begin(); //Start the gateway using RF24Mesh, with nodeID 0 (Master) @endcode
-
95 * @code uint8_t nodeID; gw.begin(nodeID); //Start the gateway using RF24Mesh, with nodeID 1 (Child node) @endcode
+
43class RF24Network;
+
44class RF24Mesh;
+
45
+
46class RF24Gateway
+
47{
+
48
+
49 /**
+
50 * @name RF24Gateway (RPi/Linux)
+
51 *
+
52 * RF24Gateway library for devices with an IP stack
+
53 */
+
54 /**@{*/
+
55
+
56public:
+
57 /**
+
58 * RF24Gateway constructor.
+
59 */
+
60 RF24Gateway(RF24& _radio, RF24Network& _network, RF24Mesh& _mesh);
+
61
+
62 /**
+
63 * Begin function for use with RF24Mesh (TUN interface)
+
64 *
+
65 * @param nodeID The RF24Mesh nodeID to use
+
66 * @param channel The radio channel to use (1-127)
+
67 * @param data_rate The RF24 datarate to use (RF24_250KBPS, RF24_1MBPS, RF24_2MBPS)
+
68 *
+
69 * @code gw.begin(); //Start the gateway using RF24Mesh, with nodeID 0 (Master) @endcode
+
70 * @code uint8_t nodeID; gw.begin(nodeID); //Start the gateway using RF24Mesh, with nodeID 1 (Child node) @endcode
+
71 */
+
72 void begin(uint8_t nodeID = 0, uint8_t channel = 97, rf24_datarate_e data_rate = RF24_1MBPS);
+
73
+
74 /**
+
75 * Begin function for use with a TAP (Ethernet) interface. RF24Mesh can be used for address assignment, but
+
76 * ARP will be used to perform the lookups.
+
77 *
+
78 * @param address The RF24Network address to use
+
79 * @param channel The radio channel (0-127) to use
+
80 * @param data_rate The RF24 datarate to use (RF24_250KBPS, RF24_1MBPS, RF24_2MBPS)
+
81 * @param meshEnable Whether to use RF24Mesh for address assignment
+
82 * @param nodeID The RF24Mesh nodeID to use **if** meshEnable has been set to true
+
83 *
+
84 * @code uint16_t address=00; gw.begin(address); //Start the gateway without using RF24Mesh, with RF24Network address 00 (Master) @endcode
+
85 * @code uint16_t address=01; gw.begin(address); //Start the gateway without using RF24Mesh, with RF24Network address 01 (Child) @endcode
+
86 */
+
87 void begin(uint16_t address, uint8_t channel = 97, rf24_datarate_e data_rate = RF24_1MBPS, bool meshEnable = 0, uint8_t nodeID = 0);
+
88
+
89 /**
+
90 * Once the Gateway has been started via begin() , call setIP to configure the IP and
+
91 * subnet mask.
+
92 *
+
93 * @param ip_addr A character array containing the numeric IP address ie: 192.168.1.1
+
94 * @param mask A character array containing the subnet mask ie: 255.255.255.0
+
95 * @return -1 if failed, 0 on success
96 */
-
97 void begin(uint8_t nodeID = 0, uint8_t channel = 97, rf24_datarate_e data_rate = RF24_1MBPS);
+
97 int setIP(char* ip_addr, char* mask);
98
99 /**
-
100 * Begin function for use with a TAP (Ethernet) interface. RF24Mesh can be used for address assignment, but
-
101 * ARP will be used to perform the lookups.
-
102 *
-
103 * @param address The RF24Network address to use
-
104 * @param channel The radio channel (0-127) to use
-
105 * @param data_rate The RF24 datarate to use (RF24_250KBPS, RF24_1MBPS, RF24_2MBPS)
-
106 * @param meshEnable Whether to use RF24Mesh for address assignment
-
107 * @param nodeID The RF24Mesh nodeID to use **if** meshEnable has been set to true
-
108 *
-
109 * @code uint16_t address=00; gw.begin(address); //Start the gateway without using RF24Mesh, with RF24Network address 00 (Master) @endcode
-
110 * @code uint16_t address=01; gw.begin(address); //Start the gateway without using RF24Mesh, with RF24Network address 01 (Child) @endcode
-
111 */
-
112 void begin(uint16_t address, uint8_t channel = 97, rf24_datarate_e data_rate = RF24_1MBPS, bool meshEnable = 0, uint8_t nodeID = 0);
-
113
-
114 /**
-
115 * Once the Gateway has been started via begin() , call setIP to configure the IP and
-
116 * subnet mask.
-
117 *
-
118 * @param ip_addr A character array containing the numeric IP address ie: 192.168.1.1
-
119 * @param mask A character array containing the subnet mask ie: 255.255.255.0
-
120 * @return -1 if failed, 0 on success
-
121 */
-
122 int setIP(char* ip_addr, char* mask);
-
123
-
124 /**
-
125 * Calling update() keeps the network and mesh layers active and processing data. This needs to be called regularly.
-
126 * @code
-
127 * gw.update();
-
128 * if(network.available()){
-
129 * ...do something
-
130 * }
-
131 * @endcode
-
132 * @param interrupts Set true if called from an interrupt handler & call poll() from the main loop or a thread.
-
133 */
-
134 void update(bool interrupts = 0);
-
135
-
136 /**
-
137 * gw.poll(); needs to be called to handle incoming data from the network interface.
-
138 * The function will perform a delayed wait of max 3ms unless otherwise specified.
-
139 * @param waitDelay How long in milliseconds this function will wait for incoming data.
-
140 */
-
141 void poll(uint32_t waitDelay = 3);
-
142
-
143 /**
-
144 * When using interrupts (gwNodeInt, ncursesInt examples) users need to call
-
145 * this function to disable interrupts before accessing the radio and again to
-
146 * re-enable interrupts when complete
-
147 * @param enable 0 to disable interrupts and access the radio, 1 to re-enable
-
148 */
-
149 void interrupts(bool enable = 1);
-
150
-
151 /**@}*/
-
152 /**
-
153 * @name Advanced Operation
-
154 *
-
155 * More advanced methods and options
-
156 */
-
157 /**@{*/
-
158
-
159 uint16_t thisNodeAddress; /**< Address of our node in Octal format (01,021, etc) */
-
160 uint8_t thisNodeID; /**< NodeID (0-255) */
-
161
-
162 bool meshEnabled(); /**< Is RF24Mesh enabled? */
-
163 bool config_TUN; /**< Using a TAP(false) or TUN(true) interface */
-
164 bool fifoCleared;
-
165
-
-
166 uint32_t ifDropped()
-
167 {
-
168 return droppedIncoming;
-
169 }
-
-
170
-
171 void sendUDP(uint8_t nodeID, RF24NetworkFrame frame);
-
172
-
173 /**@}*/
-
174 /**
-
175 * @name Routing Table
-
176 *
-
177 * Utilizing a routing table to provide complete connectivity
-
178 */
-
179 /**@{*/
-
180
-
181 /**
-
182 * If a user has created a file "routing.txt" in the RF24Gateway working directory, it will be loaded <br>
-
183 * at startup into the routing table. The file should contain standard routing table entries as follows: <br>
-
184 * IP<space>NetMask<space>Gateway <br>
-
185 * ie: routing.txt
-
186 * @code
-
187 * 10.1.4.0 255.255.255.0 10.1.3.33
-
188 * 0.0.0.0 0.0.0.0 10.1.3.34 @endcode
-
189 *
-
190 * The first example entry would route all traffic to the 10.1.4.x subnet to 10.1.3.33 <br>
-
191 * All other traffic not destined for the RF24 nodes will use 10.1.3.34 as the gateway
-
192 *
-
193 * Data can be accessed using standard linux Internet address manipulation routines as follows:
-
194 * @code
-
195 * printf("**IP\t\tMask\t\tGateway**\n");
-
196 * for(int i=0; i<gw.routingTableSize; i++){
-
197 * printf("%s \t",inet_ntoa(gw.routingStruct[i].ip));//inet_ntoa uses a statically assigned buffer, so the printf calls need to be done separately
-
198 * printf("%s \t",inet_ntoa(gw.routingStruct[i].mask));
-
199 * printf("%s\n", inet_ntoa(gw.routingStruct[i].gw));
-
200 * //std::cout << inet_ntoa(gw.routingStruct[i].ip) << " \t" << inet_ntoa(gw.routingStruct[i].mask) << " \t" << inet_ntoa(gw.routingStruct[i].gw) << std::endl;
-
201 * }
-
202 * printf("*****\n");
-
203 *
-
204 * Users can modify the routing table as desired, but changes made in code will not currently be saved to file
-
205 *
-
206 * @endcode
-
207 *
-
208 */
-
- -
210 {
-
211 struct in_addr ip;
-
212 struct in_addr mask;
-
213 struct in_addr gw;
-
214 };
-
-
215
-
216 /**
-
217 * The array that holds the routing structure data. See routeStruct
-
218 */
-
219 routeStruct routingStruct[256];
-
220
-
221 /**
-
222 * The size of the existing routing table loaded into memory. See routeStruct
-
223 */
-
224 uint8_t routingTableSize;
-
225
-
226private:
-
227 radio_t& radio;
-
228 network_t& network;
-
229 mesh_t& mesh;
-
230
-
231 bool begin(bool configTUN, bool meshEnable, uint16_t address, uint8_t mesh_nodeID, rf24_datarate_e data_rate, uint8_t _channel);
-
232 bool mesh_enabled;
-
233
-
234 uint32_t droppedIncoming;
+
100 * Calling update() keeps the network and mesh layers active and processing data. This needs to be called regularly.
+
101 * @code
+
102 * gw.update();
+
103 * if(network.available()){
+
104 * ...do something
+
105 * }
+
106 * @endcode
+
107 * @param interrupts Set true if called from an interrupt handler & call poll() from the main loop or a thread.
+
108 */
+
109 void update(bool interrupts = 0);
+
110
+
111 /**
+
112 * gw.poll(); needs to be called to handle incoming data from the network interface.
+
113 * The function will perform a delayed wait of max 3ms unless otherwise specified.
+
114 * @param waitDelay How long in milliseconds this function will wait for incoming data.
+
115 */
+
116 void poll(uint32_t waitDelay = 3);
+
117
+
118 /**
+
119 * When using interrupts (gwNodeInt, ncursesInt examples) users need to call
+
120 * this function to disable interrupts before accessing the radio and again to
+
121 * re-enable interrupts when complete
+
122 * @param enable 0 to disable interrupts and access the radio, 1 to re-enable
+
123 */
+
124 void interrupts(bool enable = 1);
+
125
+
126 /**@}*/
+
127 /**
+
128 * @name Advanced Operation
+
129 *
+
130 * More advanced methods and options
+
131 */
+
132 /**@{*/
+
133
+
134 uint16_t thisNodeAddress; /**< Address of our node in Octal format (01,021, etc) */
+
135 uint8_t thisNodeID; /**< NodeID (0-255) */
+
136
+
137 bool meshEnabled(); /**< Is RF24Mesh enabled? */
+
138 bool config_TUN; /**< Using a TAP(false) or TUN(true) interface */
+
139 bool fifoCleared;
+
140
+
141 uint32_t ifDropped()
+
142 {
+
143 return droppedIncoming;
+
144 }
+
145
+
146 void sendUDP(uint8_t nodeID, RF24NetworkFrame frame);
+
147
+
148 /**@}*/
+
149 /**
+
150 * @name Routing Table
+
151 *
+
152 * Utilizing a routing table to provide complete connectivity
+
153 */
+
154 /**@{*/
+
155
+
156 /**
+
157 * If a user has created a file "routing.txt" in the RF24Gateway working directory, it will be loaded <br>
+
158 * at startup into the routing table. The file should contain standard routing table entries as follows: <br>
+
159 * IP<space>NetMask<space>Gateway <br>
+
160 * ie: routing.txt
+
161 * @code
+
162 * 10.1.4.0 255.255.255.0 10.1.3.33
+
163 * 0.0.0.0 0.0.0.0 10.1.3.34 @endcode
+
164 *
+
165 * The first example entry would route all traffic to the 10.1.4.x subnet to 10.1.3.33 <br>
+
166 * All other traffic not destined for the RF24 nodes will use 10.1.3.34 as the gateway
+
167 *
+
168 * Data can be accessed using standard linux Internet address manipulation routines as follows:
+
169 * @code
+
170 * printf("**IP\t\tMask\t\tGateway**\n");
+
171 * for(int i=0; i<gw.routingTableSize; i++){
+
172 * printf("%s \t",inet_ntoa(gw.routingStruct[i].ip));//inet_ntoa uses a statically assigned buffer, so the printf calls need to be done separately
+
173 * printf("%s \t",inet_ntoa(gw.routingStruct[i].mask));
+
174 * printf("%s\n", inet_ntoa(gw.routingStruct[i].gw));
+
175 * //std::cout << inet_ntoa(gw.routingStruct[i].ip) << " \t" << inet_ntoa(gw.routingStruct[i].mask) << " \t" << inet_ntoa(gw.routingStruct[i].gw) << std::endl;
+
176 * }
+
177 * printf("*****\n");
+
178 *
+
179 * Users can modify the routing table as desired, but changes made in code will not currently be saved to file
+
180 *
+
181 * @endcode
+
182 *
+
183 */
+
184 struct routeStruct
+
185 {
+
186 struct in_addr ip;
+
187 struct in_addr mask;
+
188 struct in_addr gw;
+
189 };
+
190
+
191 /**
+
192 * The array that holds the routing structure data. See routeStruct
+
193 */
+
194 routeStruct routingStruct[256];
+
195
+
196 /**
+
197 * The size of the existing routing table loaded into memory. See routeStruct
+
198 */
+
199 uint8_t routingTableSize;
+
200
+
201private:
+
202 RF24& radio;
+
203 RF24Network& network;
+
204 RF24Mesh& mesh;
+
205
+
206 bool begin(bool configTUN, bool meshEnable, uint16_t address, uint8_t mesh_nodeID, rf24_datarate_e data_rate, uint8_t _channel);
+
207 bool mesh_enabled;
+
208
+
209 uint32_t droppedIncoming;
+
210
+
211 uint8_t channel;
+
212 rf24_datarate_e dataRate;
+
213 char tunName[IFNAMSIZ];
+
214 int tunFd;
+
215
+
216 unsigned long packets_sent; /**< How many have we sent already */
+
217 uint32_t interfaceInTimer;
+
218
+
219 void handleRadioOut();
+
220 void handleRadioIn();
+
221 void handleRX(uint32_t waitDelay = 0);
+
222 void handleTX();
+
223 volatile bool gotInterrupt;
+
224 int configDevice(uint16_t address);
+
225 int allocateTunDevice(char* dev, int flags, uint16_t address);
+
226
+
227 struct msgStruct
+
228 {
+
229 std::uint8_t message[MAX_PAYLOAD_SIZE];
+
230 std::size_t size;
+
231 };
+
232
+
233 std::queue<msgStruct> rxQueue;
+
234 std::queue<msgStruct> txQueue;
235
-
236 uint8_t channel;
-
237 rf24_datarate_e dataRate;
-
238 char tunName[IFNAMSIZ];
-
239 int tunFd;
-
240
-
241 unsigned long packets_sent; /**< How many have we sent already */
-
242 uint32_t interfaceInTimer;
+
236 void printPayload(std::string buffer, std::string debugMsg = "");
+
237 void printPayload(char* buffer, int nread, std::string debugMsg = "");
+
238
+
239 int s; // Socket variable for sending UDP
+
240 void setupSocket();
+
241 struct sockaddr_in addr;
+
242 struct in_addr getLocalIP();
243
-
244 void handleRadioOut();
-
245 void handleRadioIn();
-
246 void handleRX(uint32_t waitDelay = 0);
-
247 void handleTX();
-
248 volatile bool gotInterrupt;
-
249 int configDevice(uint16_t address);
-
250 int allocateTunDevice(char* dev, int flags, uint16_t address);
-
251
-
252 struct msgStruct
-
253 {
-
254 std::uint8_t message[MAX_PAYLOAD_SIZE];
-
255 std::size_t size;
-
256 };
-
257
-
258 std::queue<msgStruct> rxQueue;
-
259 std::queue<msgStruct> txQueue;
-
260
-
261 // void printPayload(std::string buffer, std::string debugMsg = "");
-
262 // void printPayload(char* buffer, int nread, std::string debugMsg = "");
-
263
-
264 int s; // Socket variable for sending UDP
-
265 void setupSocket();
-
266 struct sockaddr_in addr;
-
267 struct in_addr getLocalIP();
-
268
-
269 void loadRoutingTable();
-
270};
-
+
244 void loadRoutingTable();
+
245};
+
246
+
247/**
+
248 * @example RF24GatewayNode.cpp
+
249 *
+
250 * A simple example of using RF24Gateway node to forward IP traffic automatically to a network interface, while
+
251 * managing standard RF24Network user payloads independently.
+
252 */
+
253
+
254/**
+
255 * @example RF24Gateway_ncurses.cpp
+
256 * RF24Gateway NCurses interface - TMRh20 2015 <br>
+
257 * This is a generic tool for nodes supporting or combining with RF24Ethernet and/or RF24Network.
+
258 *
+
259 * The tool provides a simple interface for monitoring information and activity regarding the RF24Gateway: <br>
+
260 * a: Interface statistics from /proc/net/dev <br>
+
261 * b: RF24Mesh address/id assignments <br>
+
262 * c: RF24Network/Radio information <br>
+
263 * d: Active IP connections (optional) <br>
+
264 *
+
265 * **Requirements: NCurses** <br>
+
266 * Install NCurses: apt-get install libncurses5-dev
+
267 * Optional: Enable nf_conntrack: @code modprobe nf_conntrack_ipv4 @endcode
+
268 *
+
269 * @image html ncurses.JPG
+
270 */
271
272/**
-
273 * A type definition of the template class `ESBGateway` to maintain backward compatibility.
-
274 *
-
275 * ```.cpp
-
276 * RF24 radio(7, 8);
-
277 * RF24Network network(radio);
-
278 * RF24Mesh mesh(radio, network);
-
279 *
-
280 * RF24Gateway gateway(radio, network, mesh);
-
281 * // is equivalent to
-
282 * ESBGateway<ESBMesh<ESBNetwork<RF24>, RF24>, ESBNetwork<RF24>, RF24> gateway(radio, network, mesh);
-
283 * ```
-
284 */
-
285typedef ESBGateway<ESBMesh<ESBNetwork<RF24>, RF24>, ESBNetwork<RF24>, RF24> RF24Gateway;
-
286
-
287/**
-
288 * @example RF24GatewayNode.cpp
-
289 *
-
290 * A simple example of using RF24Gateway node to forward IP traffic automatically to a network interface, while
-
291 * managing standard RF24Network user payloads independently.
+
273 * @example RF24GatewayNodeInt.cpp
+
274 * A copy of the RF24GatewayNode example using interrupts.
+
275 */
+
276
+
277/**
+
278 * @example RF24Gateway_ncursesInt.cpp
+
279 * A copy of the ncurses example using interrupts.
+
280 */
+
281
+
282/**
+
283 * @example bClient.sh
+
284 * Once RF24Gateway and RF24Ethernet are configured, standard tools can be used to interact with
+
285 * the sensor nodes. <br>Example of on demand LED/Lighting control using a Bash script.
+
286 */
+
287
+
288/**
+
289 * @example nodeClient.js
+
290 * Once RF24Gateway and RF24Ethernet are configured, standard tools can be used to interact with
+
291 * the sensor nodes. <br> Example of on demand LED/Lighting control using a NodeJS script.
292 */
293
294/**
-
295 * @example RF24Gateway_ncurses.cpp
-
296 * RF24Gateway NCurses interface - TMRh20 2015 <br>
-
297 * This is a generic tool for nodes supporting or combining with RF24Ethernet and/or RF24Network.
-
298 *
-
299 * The tool provides a simple interface for monitoring information and activity regarding the RF24Gateway: <br>
-
300 * a: Interface statistics from /proc/net/dev <br>
-
301 * b: RF24Mesh address/id assignments <br>
-
302 * c: RF24Network/Radio information <br>
-
303 * d: Active IP connections (optional) <br>
-
304 *
-
305 * **Requirements: NCurses** <br>
-
306 * Install NCurses: apt-get install libncurses5-dev
-
307 * Optional: Enable nf_conntrack: @code modprobe nf_conntrack_ipv4 @endcode
-
308 *
-
309 * @image html ncurses.JPG
-
310 */
-
311
-
312/**
-
313 * @example RF24GatewayNodeInt.cpp
-
314 * A copy of the RF24GatewayNode example using interrupts.
-
315 */
-
316
-
317/**
-
318 * @example RF24Gateway_ncursesInt.cpp
-
319 * A copy of the ncurses example using interrupts.
-
320 */
-
321
-
322/**
-
323 * @example bClient.sh
-
324 * Once RF24Gateway and RF24Ethernet are configured, standard tools can be used to interact with
-
325 * the sensor nodes. <br>Example of on demand LED/Lighting control using a Bash script.
-
326 */
-
327
-
328/**
-
329 * @example nodeClient.js
-
330 * Once RF24Gateway and RF24Ethernet are configured, standard tools can be used to interact with
-
331 * the sensor nodes. <br> Example of on demand LED/Lighting control using a NodeJS script.
-
332 */
-
333
-
334/**
-
335 * @example pyClient.py
-
336 * Once RF24Gateway and RF24Ethernet are configured, standard tools can be used to interact with
-
337 * the sensor nodes. <br> Example of scheduled LED/Lighting control using a Python script.
-
338 */
-
339
-
340#endif
-
ESBGateway
Definition RF24Gateway.h:66
-
ESBGateway::config_TUN
bool config_TUN
Definition RF24Gateway.h:163
-
ESBGateway::meshEnabled
bool meshEnabled()
Definition RF24Gateway.cpp:153
-
ESBGateway::thisNodeAddress
uint16_t thisNodeAddress
Definition RF24Gateway.h:159
-
ESBGateway::setIP
int setIP(char *ip_addr, char *mask)
Definition RF24Gateway.cpp:252
-
ESBGateway::routingStruct
routeStruct routingStruct[256]
Definition RF24Gateway.h:219
-
ESBGateway::interrupts
void interrupts(bool enable=1)
Definition RF24Gateway.cpp:314
-
ESBGateway::poll
void poll(uint32_t waitDelay=3)
Definition RF24Gateway.cpp:339
-
ESBGateway::ESBGateway
ESBGateway(radio_t &_radio, network_t &_network, mesh_t &_mesh)
Definition RF24Gateway.cpp:13
-
ESBGateway::begin
void begin(uint8_t nodeID=0, uint8_t channel=97, rf24_datarate_e data_rate=RF24_1MBPS)
Definition RF24Gateway.cpp:21
-
ESBGateway::ifDropped
uint32_t ifDropped()
Definition RF24Gateway.h:166
-
ESBGateway::thisNodeID
uint8_t thisNodeID
Definition RF24Gateway.h:160
-
ESBGateway::update
void update(bool interrupts=0)
Definition RF24Gateway.cpp:322
-
ESBGateway::fifoCleared
bool fifoCleared
Definition RF24Gateway.h:164
-
ESBGateway::routingTableSize
uint8_t routingTableSize
Definition RF24Gateway.h:224
-
ESBGateway::sendUDP
void sendUDP(uint8_t nodeID, RF24NetworkFrame frame)
Definition RF24Gateway.cpp:719
-
ESBMesh
Definition RF24Gateway.h:48
-
ESBNetwork
Definition RF24Gateway.h:45
-
ESBGateway::routeStruct
Definition RF24Gateway.h:210
-
ESBGateway::routeStruct::ip
struct in_addr ip
Definition RF24Gateway.h:211
-
ESBGateway::routeStruct::mask
struct in_addr mask
Definition RF24Gateway.h:212
-
ESBGateway::routeStruct::gw
struct in_addr gw
Definition RF24Gateway.h:213
+
295 * @example pyClient.py
+
296 * Once RF24Gateway and RF24Ethernet are configured, standard tools can be used to interact with
+
297 * the sensor nodes. <br> Example of scheduled LED/Lighting control using a Python script.
+
298 */
+
299
+
300#endif
+
RF24Gateway
Definition: RF24Gateway.h:47
+
RF24Gateway::thisNodeAddress
uint16_t thisNodeAddress
Definition: RF24Gateway.h:134
+
RF24Gateway::setIP
int setIP(char *ip_addr, char *mask)
Definition: RF24Gateway.cpp:243
+
RF24Gateway::interrupts
void interrupts(bool enable=1)
Definition: RF24Gateway.cpp:303
+
RF24Gateway::thisNodeID
uint8_t thisNodeID
Definition: RF24Gateway.h:135
+
RF24Gateway::meshEnabled
bool meshEnabled()
Definition: RF24Gateway.cpp:147
+
RF24Gateway::ifDropped
uint32_t ifDropped()
Definition: RF24Gateway.h:141
+
RF24Gateway::routingTableSize
uint8_t routingTableSize
Definition: RF24Gateway.h:199
+
RF24Gateway::begin
void begin(uint8_t nodeID=0, uint8_t channel=97, rf24_datarate_e data_rate=RF24_1MBPS)
Definition: RF24Gateway.cpp:19
+
RF24Gateway::sendUDP
void sendUDP(uint8_t nodeID, RF24NetworkFrame frame)
Definition: RF24Gateway.cpp:696
+
RF24Gateway::update
void update(bool interrupts=0)
Definition: RF24Gateway.cpp:310
+
RF24Gateway::routingStruct
routeStruct routingStruct[256]
Definition: RF24Gateway.h:194
+
RF24Gateway::fifoCleared
bool fifoCleared
Definition: RF24Gateway.h:139
+
RF24Gateway::config_TUN
bool config_TUN
Definition: RF24Gateway.h:138
+
RF24Gateway::poll
void poll(uint32_t waitDelay=3)
Definition: RF24Gateway.cpp:326
+
RF24Gateway::routeStruct
Definition: RF24Gateway.h:185
+
RF24Gateway::routeStruct::mask
struct in_addr mask
Definition: RF24Gateway.h:187
+
RF24Gateway::routeStruct::gw
struct in_addr gw
Definition: RF24Gateway.h:188
+
RF24Gateway::routeStruct::ip
struct in_addr ip
Definition: RF24Gateway.h:186
diff --git a/RF24Gateway_ncursesInt_8cpp-example.html b/RF24Gateway_ncursesInt_8cpp-example.html index 9b987d9..aca456a 100644 --- a/RF24Gateway_ncursesInt_8cpp-example.html +++ b/RF24Gateway_ncursesInt_8cpp-example.html @@ -3,15 +3,12 @@ - + RF24Gateway - TCP/IP over RF24Network: RF24Gateway_ncursesInt.cpp - - - @@ -26,7 +23,7 @@ -
RF24Gateway - TCP/IP over RF24Network v2.0.0 +
RF24Gateway - TCP/IP over RF24Network v1.1.0
TMRh20 - Pushing the practical limits of RF24 modules
@@ -35,7 +32,7 @@
- + @@ -128,7 +125,7 @@
RF24 radio(22, 0);
RF24Network network(radio);
RF24Mesh mesh(radio, network);
-
RF24Gateway gw(radio, network, mesh);
+
RF24Gateway gw(radio, network, mesh);
uint8_t nodeID = 0;
int interruptPin = 24;
@@ -582,7 +579,7 @@
//This is an IP interface, display the IP
if (family == AF_INET || family == AF_INET6)
{
-
s = getnameinfo(ifa->ifa_addr, (family == AF_INET) ? sizeof(struct sockaddr_in) : sizeof(struct sockaddr_in6), host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST);
+
s = getnameinfo(ifa->ifa_addr, (family == AF_INET) ? sizeof(struct sockaddr_in) : sizeof(struct sockaddr_in6), host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST);
if (s == 0)
{
wprintw(win, "IP: %s\n", host);
@@ -843,11 +840,11 @@
}
/******************************************************************/
-
ESBGateway
Definition RF24Gateway.h:66
+
RF24Gateway
Definition: RF24Gateway.h:47
diff --git a/RF24Gateway_ncurses_8cpp-example.html b/RF24Gateway_ncurses_8cpp-example.html index 744b75f..ef4f4d8 100644 --- a/RF24Gateway_ncurses_8cpp-example.html +++ b/RF24Gateway_ncurses_8cpp-example.html @@ -3,15 +3,12 @@ - + RF24Gateway - TCP/IP over RF24Network: RF24Gateway_ncurses.cpp - - - @@ -26,7 +23,7 @@ -
RF24Gateway - TCP/IP over RF24Network v2.0.0 +
RF24Gateway - TCP/IP over RF24Network v1.1.0
TMRh20 - Pushing the practical limits of RF24 modules
@@ -35,7 +32,7 @@
- + @@ -78,9 +75,9 @@
RF24Gateway_ncurses.cpp
-

RF24Gateway NCurses interface - TMRh20 2015
+

RF24Gateway NCurses interface - TMRh20 2015
This is a generic tool for nodes supporting or combining with RF24Ethernet and/or RF24Network.

-

The tool provides a simple interface for monitoring information and activity regarding the RF24Gateway:
+

The tool provides a simple interface for monitoring information and activity regarding the RF24Gateway:
a: Interface statistics from /proc/net/dev
b: RF24Mesh address/id assignments
c: RF24Network/Radio information
@@ -140,7 +137,7 @@

RF24 radio(22, 0);
RF24Network network(radio);
RF24Mesh mesh(radio, network);
-
RF24Gateway gw(radio, network, mesh);
+
RF24Gateway gw(radio, network, mesh);
/******************************************************************/
@@ -566,7 +563,7 @@
//This is an IP interface, display the IP
if (family == AF_INET || family == AF_INET6)
{
-
s = getnameinfo(ifa->ifa_addr, (family == AF_INET) ? sizeof(struct sockaddr_in) : sizeof(struct sockaddr_in6), host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST);
+
s = getnameinfo(ifa->ifa_addr, (family == AF_INET) ? sizeof(struct sockaddr_in) : sizeof(struct sockaddr_in6), host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST);
if (s == 0)
{
wprintw(win, "IP: %s\n", host);
@@ -819,11 +816,11 @@
}
/******************************************************************/
-
Definition RF24Gateway.h:66
+
Definition: RF24Gateway.h:47
diff --git a/annotated.html b/annotated.html index f3e2eda..ce1e5aa 100644 --- a/annotated.html +++ b/annotated.html @@ -3,15 +3,12 @@ - + RF24Gateway - TCP/IP over RF24Network: Class List - - - @@ -26,7 +23,7 @@ -
RF24Gateway - TCP/IP over RF24Network v2.0.0 +
RF24Gateway - TCP/IP over RF24Network v1.1.0
TMRh20 - Pushing the practical limits of RF24 modules
@@ -35,7 +32,7 @@
- + @@ -79,17 +76,15 @@
Here are the classes, structs, unions and interfaces with brief descriptions:
-
[detail level 12]
- - - - +
[detail level 12]
 CESBGateway
 CrouteStruct
 CESBMesh
 CESBNetwork
+ +
 CRF24Gateway
 CrouteStruct
diff --git a/bClient_8sh-example.html b/bClient_8sh-example.html index 72e467f..6813106 100644 --- a/bClient_8sh-example.html +++ b/bClient_8sh-example.html @@ -3,15 +3,12 @@ - + RF24Gateway - TCP/IP over RF24Network: bClient.sh - - - @@ -26,7 +23,7 @@ -
RF24Gateway - TCP/IP over RF24Network v2.0.0 +
RF24Gateway - TCP/IP over RF24Network v1.1.0
TMRh20 - Pushing the practical limits of RF24 modules
@@ -35,7 +32,7 @@
- + @@ -78,7 +75,7 @@
bClient.sh
-

Once RF24Gateway and RF24Ethernet are configured, standard tools can be used to interact with the sensor nodes.
+

Once RF24Gateway and RF24Ethernet are configured, standard tools can be used to interact with the sensor nodes.
Example of on demand LED/Lighting control using a Bash script.

#!/bin/bash
@@ -114,7 +111,7 @@
diff --git a/bdwn.png b/bdwn.png new file mode 100644 index 0000000000000000000000000000000000000000..940a0b950443a0bb1b216ac03c45b8a16c955452 GIT binary patch literal 147 zcmeAS@N?(olHy`uVBq!ia0vp^>_E)H!3HEvS)PKZC{Gv1kP61Pb5HX&C2wk~_T - - - - - - -RF24Gateway - TCP/IP over RF24Network: Member List - - - - - - - - - - - - - - -
-
- - - - - - -
-
RF24Gateway - TCP/IP over RF24Network v2.0.0 -
-
TMRh20 - Pushing the practical limits of RF24 modules
-
-
- - - - - - - - -
-
- - -
-
-
-
-
-
Loading...
-
Searching...
-
No Matches
-
-
-
-
- -
-
-
ESBGateway< mesh_t, network_t, radio_t > Member List
-
- - - - - diff --git a/classESBGateway.html b/classESBGateway.html deleted file mode 100644 index 335f1fd..0000000 --- a/classESBGateway.html +++ /dev/null @@ -1,598 +0,0 @@ - - - - - - - -RF24Gateway - TCP/IP over RF24Network: ESBGateway< mesh_t, network_t, radio_t > Class Template Reference - - - - - - - - - - - - - - -
-
- - - - - - -
-
RF24Gateway - TCP/IP over RF24Network v2.0.0 -
-
TMRh20 - Pushing the practical limits of RF24 modules
-
-
- - - - - - - - -
-
- - -
-
-
-
-
-
Loading...
-
Searching...
-
No Matches
-
-
-
-
- -
-
- -
ESBGateway< mesh_t, network_t, radio_t > Class Template Reference
-
-
- -

#include <RF24Gateway.h>

- - - - -

-Classes

struct  routeStruct
 
- - - - - - - - - - - - - - - - - -

-Public Member Functions

RF24Gateway (RPi/Linux)

RF24Gateway library for devices with an IP stack

-
 ESBGateway (radio_t &_radio, network_t &_network, mesh_t &_mesh)
 
void begin (uint8_t nodeID=0, uint8_t channel=97, rf24_datarate_e data_rate=RF24_1MBPS)
 
void begin (uint16_t address, uint8_t channel=97, rf24_datarate_e data_rate=RF24_1MBPS, bool meshEnable=0, uint8_t nodeID=0)
 
int setIP (char *ip_addr, char *mask)
 
void update (bool interrupts=0)
 
void poll (uint32_t waitDelay=3)
 
void interrupts (bool enable=1)
 
- - - - - - - - - - - - - - - - -

Advanced Operation

More advanced methods and options

-
uint16_t thisNodeAddress
 
uint8_t thisNodeID
 
bool config_TUN
 
bool fifoCleared
 
bool meshEnabled ()
 
uint32_t ifDropped ()
 
void sendUDP (uint8_t nodeID, RF24NetworkFrame frame)
 
- - - - - - -

Routing Table

Utilizing a routing table to provide complete connectivity

-
routeStruct routingStruct [256]
 
uint8_t routingTableSize
 
-

Detailed Description

-
template<class mesh_t = ESBMesh<ESBNetwork<RF24>, RF24>, class network_t = ESBNetwork<RF24>, class radio_t = RF24>
-class ESBGateway< mesh_t, network_t, radio_t >
Template Parameters
- - - - -
mesh_tThe mesh object's type. Defaults to RF24Mesh for legacy behavior. This new abstraction is really meant for using the nRF52840 SoC as a drop-in replacement for the nRF24L01 radio. For more detail, see the nrf_to_nrf Arduino library.
network_tThe network object's type. Defaults to RF24Network for legacy behavior. This new abstraction is really meant for using the nRF52840 SoC as a drop-in replacement for the nRF24L01 radio. For more detail, see the nrf_to_nrf Arduino library.
radio_tThe radio object's type. Defaults to RF24 for legacy behavior. This new abstraction is really meant for using the nRF52840 SoC as a drop-in replacement for the nRF24L01 radio. For more detail, see the nrf_to_nrf Arduino library.
-
-
-
Examples
RF24GatewayNode.cpp, RF24GatewayNodeInt.cpp, RF24Gateway_ncurses.cpp, and RF24Gateway_ncursesInt.cpp.
-
- -

Definition at line 65 of file RF24Gateway.h.

-

Constructor & Destructor Documentation

- -

◆ ESBGateway()

- -
-
-
-template<class mesh_t , class network_t , class radio_t >
- - - - - - - - - - - - - - - - -
ESBGateway< mesh_t, network_t, radio_t >::ESBGateway (radio_t & _radio,
network_t & _network,
mesh_t & _mesh )
-
-

ESBGateway constructor.

RF24 radio(7,8);
-
RF24Network network(radio);
-
RF24Mesh mesh(radio,network);
-
RF24Gateway gateway(radio,network,mesh);
- -
-

Definition at line 13 of file RF24Gateway.cpp.

- -
-
-

Member Function Documentation

- -

◆ begin() [1/2]

- -
-
-
-template<class mesh_t , class network_t , class radio_t >
- - - - - - - - - - - - - - - - -
void ESBGateway< mesh_t, network_t, radio_t >::begin (uint8_t nodeID = 0,
uint8_t channel = 97,
rf24_datarate_e data_rate = RF24_1MBPS )
-
-

Begin function for use with RF24Mesh (TUN interface)

-
Parameters
- - - - -
nodeIDThe RF24Mesh nodeID to use
channelThe radio channel to use (1-127)
data_rateThe RF24 datarate to use (RF24_250KBPS, RF24_1MBPS, RF24_2MBPS)
-
-
-
gw.begin(); //Start the gateway using RF24Mesh, with nodeID 0 (Master)
-
uint8_t nodeID; gw.begin(nodeID); //Start the gateway using RF24Mesh, with nodeID 1 (Child node)
-
-

Definition at line 21 of file RF24Gateway.cpp.

- -
-
- -

◆ begin() [2/2]

- -
-
-
-template<class mesh_t , class network_t , class radio_t >
- - - - - - - - - - - - - - - - - - - - - - - - - - -
void ESBGateway< mesh_t, network_t, radio_t >::begin (uint16_t address,
uint8_t channel = 97,
rf24_datarate_e data_rate = RF24_1MBPS,
bool meshEnable = 0,
uint8_t nodeID = 0 )
-
-

Begin function for use with a TAP (Ethernet) interface. RF24Mesh can be used for address assignment, but ARP will be used to perform the lookups.

-
Parameters
- - - - - - -
addressThe RF24Network address to use
channelThe radio channel (0-127) to use
data_rateThe RF24 datarate to use (RF24_250KBPS, RF24_1MBPS, RF24_2MBPS)
meshEnableWhether to use RF24Mesh for address assignment
nodeIDThe RF24Mesh nodeID to use if meshEnable has been set to true
-
-
-
uint16_t address=00; gw.begin(address); //Start the gateway without using RF24Mesh, with RF24Network address 00 (Master)
-
uint16_t address=01; gw.begin(address); //Start the gateway without using RF24Mesh, with RF24Network address 01 (Child)
-
-

Definition at line 30 of file RF24Gateway.cpp.

- -
-
- -

◆ setIP()

- -
-
-
-template<class mesh_t , class network_t , class radio_t >
- - - - - - - - - - - -
int ESBGateway< mesh_t, network_t, radio_t >::setIP (char * ip_addr,
char * mask )
-
-

Once the Gateway has been started via begin() , call setIP to configure the IP and subnet mask.

-
Parameters
- - - -
ip_addrA character array containing the numeric IP address ie: 192.168.1.1
maskA character array containing the subnet mask ie: 255.255.255.0
-
-
-
Returns
-1 if failed, 0 on success
- -

Definition at line 252 of file RF24Gateway.cpp.

- -
-
- -

◆ update()

- -
-
-
-template<class mesh_t , class network_t , class radio_t >
- - - - - - - -
void ESBGateway< mesh_t, network_t, radio_t >::update (bool interrupts = 0)
-
-

Calling update() keeps the network and mesh layers active and processing data. This needs to be called regularly.

gw.update();
-
if(network.available()){
-
...do something
-
}
-
Parameters
- - -
interruptsSet true if called from an interrupt handler & call poll() from the main loop or a thread.
-
-
- -

Definition at line 322 of file RF24Gateway.cpp.

- -
-
- -

◆ poll()

- -
-
-
-template<class mesh_t , class network_t , class radio_t >
- - - - - - - -
void ESBGateway< mesh_t, network_t, radio_t >::poll (uint32_t waitDelay = 3)
-
-

gw.poll(); needs to be called to handle incoming data from the network interface. The function will perform a delayed wait of max 3ms unless otherwise specified.

Parameters
- - -
waitDelayHow long in milliseconds this function will wait for incoming data.
-
-
- -

Definition at line 339 of file RF24Gateway.cpp.

- -
-
- -

◆ interrupts()

- -
-
-
-template<class mesh_t , class network_t , class radio_t >
- - - - - - - -
void ESBGateway< mesh_t, network_t, radio_t >::interrupts (bool enable = 1)
-
-

When using interrupts (gwNodeInt, ncursesInt examples) users need to call this function to disable interrupts before accessing the radio and again to re-enable interrupts when complete

Parameters
- - -
enable0 to disable interrupts and access the radio, 1 to re-enable
-
-
- -

Definition at line 314 of file RF24Gateway.cpp.

- -
-
- -

◆ meshEnabled()

- -
-
-
-template<class mesh_t , class network_t , class radio_t >
- - - - - - - -
bool ESBGateway< mesh_t, network_t, radio_t >::meshEnabled ()
-
-

Is RF24Mesh enabled?

- -

Definition at line 153 of file RF24Gateway.cpp.

- -
-
- -

◆ ifDropped()

- -
-
-
-template<class mesh_t = ESBMesh<ESBNetwork<RF24>, RF24>, class network_t = ESBNetwork<RF24>, class radio_t = RF24>
- - - - - -
- - - - - - - -
uint32_t ESBGateway< mesh_t, network_t, radio_t >::ifDropped ()
-
-inline
-
- -

Definition at line 166 of file RF24Gateway.h.

- -
-
- -

◆ sendUDP()

- -
-
-
-template<class mesh_t , class network_t , class radio_t >
- - - - - - - - - - - -
void ESBGateway< mesh_t, network_t, radio_t >::sendUDP (uint8_t nodeID,
RF24NetworkFrame frame )
-
- -

Definition at line 719 of file RF24Gateway.cpp.

- -
-
-

Member Data Documentation

- -

◆ thisNodeAddress

- -
-
-
-template<class mesh_t = ESBMesh<ESBNetwork<RF24>, RF24>, class network_t = ESBNetwork<RF24>, class radio_t = RF24>
- - - - -
uint16_t ESBGateway< mesh_t, network_t, radio_t >::thisNodeAddress
-
-

Address of our node in Octal format (01,021, etc)

- -

Definition at line 159 of file RF24Gateway.h.

- -
-
- -

◆ thisNodeID

- -
-
-
-template<class mesh_t = ESBMesh<ESBNetwork<RF24>, RF24>, class network_t = ESBNetwork<RF24>, class radio_t = RF24>
- - - - -
uint8_t ESBGateway< mesh_t, network_t, radio_t >::thisNodeID
-
-

NodeID (0-255)

- -

Definition at line 160 of file RF24Gateway.h.

- -
-
- -

◆ config_TUN

- -
-
-
-template<class mesh_t = ESBMesh<ESBNetwork<RF24>, RF24>, class network_t = ESBNetwork<RF24>, class radio_t = RF24>
- - - - -
bool ESBGateway< mesh_t, network_t, radio_t >::config_TUN
-
-

Using a TAP(false) or TUN(true) interface

- -

Definition at line 163 of file RF24Gateway.h.

- -
-
- -

◆ fifoCleared

- -
-
-
-template<class mesh_t = ESBMesh<ESBNetwork<RF24>, RF24>, class network_t = ESBNetwork<RF24>, class radio_t = RF24>
- - - - -
bool ESBGateway< mesh_t, network_t, radio_t >::fifoCleared
-
- -

Definition at line 164 of file RF24Gateway.h.

- -
-
- -

◆ routingStruct

- -
-
-
-template<class mesh_t = ESBMesh<ESBNetwork<RF24>, RF24>, class network_t = ESBNetwork<RF24>, class radio_t = RF24>
- - - - -
routeStruct ESBGateway< mesh_t, network_t, radio_t >::routingStruct[256]
-
-

The array that holds the routing structure data. See routeStruct

- -

Definition at line 219 of file RF24Gateway.h.

- -
-
- -

◆ routingTableSize

- -
-
-
-template<class mesh_t = ESBMesh<ESBNetwork<RF24>, RF24>, class network_t = ESBNetwork<RF24>, class radio_t = RF24>
- - - - -
uint8_t ESBGateway< mesh_t, network_t, radio_t >::routingTableSize
-
-

The size of the existing routing table loaded into memory. See routeStruct

- -

Definition at line 224 of file RF24Gateway.h.

- -
-
-
- - - - diff --git a/classESBMesh.html b/classESBMesh.html deleted file mode 100644 index d3e8aae..0000000 --- a/classESBMesh.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - -RF24Gateway - TCP/IP over RF24Network: ESBMesh< network_t, radio_t > Class Template Reference - - - - - - - - - - - - - - -
-
- - - - - - -
-
RF24Gateway - TCP/IP over RF24Network v2.0.0 -
-
TMRh20 - Pushing the practical limits of RF24 modules
-
-
- - - - - - - - -
-
- - -
-
-
-
-
-
Loading...
-
Searching...
-
No Matches
-
-
-
-
- -
-
-
ESBMesh< network_t, radio_t > Class Template Reference
-
-
-

Detailed Description

-
template<class network_t, class radio_t>
-class ESBMesh< network_t, radio_t >
-

Definition at line 48 of file RF24Gateway.h.

-
- - - - diff --git a/classESBNetwork.html b/classESBNetwork.html deleted file mode 100644 index 9366c10..0000000 --- a/classESBNetwork.html +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - -RF24Gateway - TCP/IP over RF24Network: ESBNetwork< radio_t > Class Template Reference - - - - - - - - - - - - - - -
-
- - - - - - -
-
RF24Gateway - TCP/IP over RF24Network v2.0.0 -
-
TMRh20 - Pushing the practical limits of RF24 modules
-
-
- - - - - - - - -
-
- - -
-
-
-
-
-
Loading...
-
Searching...
-
No Matches
-
-
-
-
- -
-
-
ESBNetwork< radio_t > Class Template Reference
-
-
-

Detailed Description

-
template<class radio_t>
-class ESBNetwork< radio_t >
-

Definition at line 45 of file RF24Gateway.h.

-
- - - - diff --git a/classRF24Gateway-members.html b/classRF24Gateway-members.html new file mode 100644 index 0000000..ba4bc9c --- /dev/null +++ b/classRF24Gateway-members.html @@ -0,0 +1,103 @@ + + + + + + + +RF24Gateway - TCP/IP over RF24Network: Member List + + + + + + + + + + + +
+
+ + + + + + +
+
RF24Gateway - TCP/IP over RF24Network v1.1.0 +
+
TMRh20 - Pushing the practical limits of RF24 modules
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+
RF24Gateway Member List
+
+
+ +

This is the complete list of members for RF24Gateway, including all inherited members.

+ + + + + + + + + + + + + + + + + +
begin(uint8_t nodeID=0, uint8_t channel=97, rf24_datarate_e data_rate=RF24_1MBPS)RF24Gateway
begin(uint16_t address, uint8_t channel=97, rf24_datarate_e data_rate=RF24_1MBPS, bool meshEnable=0, uint8_t nodeID=0)RF24Gateway
config_TUNRF24Gateway
fifoClearedRF24Gateway
ifDropped()RF24Gatewayinline
interrupts(bool enable=1)RF24Gateway
meshEnabled()RF24Gateway
poll(uint32_t waitDelay=3)RF24Gateway
RF24Gateway(RF24 &_radio, RF24Network &_network, RF24Mesh &_mesh)RF24Gateway
routingStructRF24Gateway
routingTableSizeRF24Gateway
sendUDP(uint8_t nodeID, RF24NetworkFrame frame)RF24Gateway
setIP(char *ip_addr, char *mask)RF24Gateway
thisNodeAddressRF24Gateway
thisNodeIDRF24Gateway
update(bool interrupts=0)RF24Gateway
+ + + + diff --git a/classRF24Gateway.html b/classRF24Gateway.html new file mode 100644 index 0000000..8a34ee2 --- /dev/null +++ b/classRF24Gateway.html @@ -0,0 +1,607 @@ + + + + + + + +RF24Gateway - TCP/IP over RF24Network: RF24Gateway Class Reference + + + + + + + + + + + +
+
+ + + + + + +
+
RF24Gateway - TCP/IP over RF24Network v1.1.0 +
+
TMRh20 - Pushing the practical limits of RF24 modules
+
+
+ + + + + + + + +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
+ +
RF24Gateway Class Reference
+
+
+ +

#include <RF24Gateway.h>

+ + + + +

+Classes

struct  routeStruct
 
+ + + + + + + + + + + + + + + + + +

+Public Member Functions

RF24Gateway (RPi/Linux)

RF24Gateway library for devices with an IP stack

+
 RF24Gateway (RF24 &_radio, RF24Network &_network, RF24Mesh &_mesh)
 
void begin (uint8_t nodeID=0, uint8_t channel=97, rf24_datarate_e data_rate=RF24_1MBPS)
 
void begin (uint16_t address, uint8_t channel=97, rf24_datarate_e data_rate=RF24_1MBPS, bool meshEnable=0, uint8_t nodeID=0)
 
int setIP (char *ip_addr, char *mask)
 
void update (bool interrupts=0)
 
void poll (uint32_t waitDelay=3)
 
void interrupts (bool enable=1)
 
+ + + + + + + + + + + + + + + + +

Advanced Operation

More advanced methods and options

+
uint16_t thisNodeAddress
 
uint8_t thisNodeID
 
bool config_TUN
 
bool fifoCleared
 
bool meshEnabled ()
 
uint32_t ifDropped ()
 
void sendUDP (uint8_t nodeID, RF24NetworkFrame frame)
 
+ + + + + + +

Routing Table

Utilizing a routing table to provide complete connectivity

+
routeStruct routingStruct [256]
 
uint8_t routingTableSize
 
+

Detailed Description

+

Constructor & Destructor Documentation

+ +

◆ RF24Gateway()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
RF24Gateway::RF24Gateway (RF24 & _radio,
RF24Network & _network,
RF24Mesh & _mesh 
)
+
+

RF24Gateway constructor.

+ +

Definition at line 12 of file RF24Gateway.cpp.

+ +
+
+

Member Function Documentation

+ +

◆ begin() [1/2]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
void RF24Gateway::begin (uint8_t nodeID = 0,
uint8_t channel = 97,
rf24_datarate_e data_rate = RF24_1MBPS 
)
+
+

Begin function for use with RF24Mesh (TUN interface)

+
Parameters
+ + + + +
nodeIDThe RF24Mesh nodeID to use
channelThe radio channel to use (1-127)
data_rateThe RF24 datarate to use (RF24_250KBPS, RF24_1MBPS, RF24_2MBPS)
+
+
+
gw.begin(); //Start the gateway using RF24Mesh, with nodeID 0 (Master)
+
uint8_t nodeID; gw.begin(nodeID); //Start the gateway using RF24Mesh, with nodeID 1 (Child node)
+
+

Definition at line 19 of file RF24Gateway.cpp.

+ +

References begin().

+ +

Referenced by begin().

+ +
+
+ +

◆ begin() [2/2]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
void RF24Gateway::begin (uint16_t address,
uint8_t channel = 97,
rf24_datarate_e data_rate = RF24_1MBPS,
bool meshEnable = 0,
uint8_t nodeID = 0 
)
+
+

Begin function for use with a TAP (Ethernet) interface. RF24Mesh can be used for address assignment, but ARP will be used to perform the lookups.

+
Parameters
+ + + + + + +
addressThe RF24Network address to use
channelThe radio channel (0-127) to use
data_rateThe RF24 datarate to use (RF24_250KBPS, RF24_1MBPS, RF24_2MBPS)
meshEnableWhether to use RF24Mesh for address assignment
nodeIDThe RF24Mesh nodeID to use if meshEnable has been set to true
+
+
+
uint16_t address=00; gw.begin(address); //Start the gateway without using RF24Mesh, with RF24Network address 00 (Master)
+
uint16_t address=01; gw.begin(address); //Start the gateway without using RF24Mesh, with RF24Network address 01 (Child)
+
+

Definition at line 27 of file RF24Gateway.cpp.

+ +

References begin().

+ +
+
+ +

◆ setIP()

+ +
+
+ + + + + + + + + + + + + + + + + + +
int RF24Gateway::setIP (char * ip_addr,
char * mask 
)
+
+

Once the Gateway has been started via begin() , call setIP to configure the IP and subnet mask.

+
Parameters
+ + + +
ip_addrA character array containing the numeric IP address ie: 192.168.1.1
maskA character array containing the subnet mask ie: 255.255.255.0
+
+
+
Returns
-1 if failed, 0 on success
+ +

Definition at line 243 of file RF24Gateway.cpp.

+ +
+
+ +

◆ update()

+ +
+
+ + + + + + + + +
void RF24Gateway::update (bool interrupts = 0)
+
+

Calling update() keeps the network and mesh layers active and processing data. This needs to be called regularly.

gw.update();
+
if(network.available()){
+
...do something
+
}
+
Parameters
+ + +
interruptsSet true if called from an interrupt handler & call poll() from the main loop or a thread.
+
+
+ +

Definition at line 310 of file RF24Gateway.cpp.

+ +

References interrupts().

+ +
+
+ +

◆ poll()

+ +
+
+ + + + + + + + +
void RF24Gateway::poll (uint32_t waitDelay = 3)
+
+

gw.poll(); needs to be called to handle incoming data from the network interface. The function will perform a delayed wait of max 3ms unless otherwise specified.

Parameters
+ + +
waitDelayHow long in milliseconds this function will wait for incoming data.
+
+
+ +

Definition at line 326 of file RF24Gateway.cpp.

+ +

References fifoCleared.

+ +
+
+ +

◆ interrupts()

+ +
+
+ + + + + + + + +
void RF24Gateway::interrupts (bool enable = 1)
+
+

When using interrupts (gwNodeInt, ncursesInt examples) users need to call this function to disable interrupts before accessing the radio and again to re-enable interrupts when complete

Parameters
+ + +
enable0 to disable interrupts and access the radio, 1 to re-enable
+
+
+ +

Definition at line 303 of file RF24Gateway.cpp.

+ +

Referenced by update().

+ +
+
+ +

◆ meshEnabled()

+ +
+
+ + + + + + + +
bool RF24Gateway::meshEnabled ()
+
+

Is RF24Mesh enabled?

+ +

Definition at line 147 of file RF24Gateway.cpp.

+ +
+
+ +

◆ ifDropped()

+ +
+
+ + + + + +
+ + + + + + + +
uint32_t RF24Gateway::ifDropped ()
+
+inline
+
+ +

Definition at line 141 of file RF24Gateway.h.

+ +
+
+ +

◆ sendUDP()

+ +
+
+ + + + + + + + + + + + + + + + + + +
void RF24Gateway::sendUDP (uint8_t nodeID,
RF24NetworkFrame frame 
)
+
+ +

Definition at line 696 of file RF24Gateway.cpp.

+ +
+
+

Member Data Documentation

+ +

◆ thisNodeAddress

+ +
+
+ + + + +
uint16_t RF24Gateway::thisNodeAddress
+
+

Address of our node in Octal format (01,021, etc)

+ +

Definition at line 134 of file RF24Gateway.h.

+ +
+
+ +

◆ thisNodeID

+ +
+
+ + + + +
uint8_t RF24Gateway::thisNodeID
+
+

NodeID (0-255)

+ +

Definition at line 135 of file RF24Gateway.h.

+ +
+
+ +

◆ config_TUN

+ +
+
+ + + + +
bool RF24Gateway::config_TUN
+
+

Using a TAP(false) or TUN(true) interface

+ +

Definition at line 138 of file RF24Gateway.h.

+ +
+
+ +

◆ fifoCleared

+ +
+
+ + + + +
bool RF24Gateway::fifoCleared
+
+ +

Definition at line 139 of file RF24Gateway.h.

+ +

Referenced by poll().

+ +
+
+ +

◆ routingStruct

+ +
+
+ + + + +
routeStruct RF24Gateway::routingStruct[256]
+
+

The array that holds the routing structure data. See routeStruct

+ +

Definition at line 194 of file RF24Gateway.h.

+ +
+
+ +

◆ routingTableSize

+ +
+
+ + + + +
uint8_t RF24Gateway::routingTableSize
+
+

The size of the existing routing table loaded into memory. See routeStruct

+ +

Definition at line 199 of file RF24Gateway.h.

+ +
+
+
+ + + + diff --git a/classes.html b/classes.html index a97fc45..f7e96e8 100644 --- a/classes.html +++ b/classes.html @@ -3,15 +3,12 @@ - + RF24Gateway - TCP/IP over RF24Network: Class Index - - - @@ -26,7 +23,7 @@ -
RF24Gateway - TCP/IP over RF24Network v2.0.0 +
RF24Gateway - TCP/IP over RF24Network v1.1.0
TMRh20 - Pushing the practical limits of RF24 modules
@@ -35,7 +32,7 @@
- + @@ -78,19 +75,16 @@
Class Index
diff --git a/clipboard.js b/clipboard.js deleted file mode 100644 index 42c1fb0..0000000 --- a/clipboard.js +++ /dev/null @@ -1,61 +0,0 @@ -/** - -The code below is based on the Doxygen Awesome project, see -https://github.com/jothepro/doxygen-awesome-css - -MIT License - -Copyright (c) 2021 - 2022 jothepro - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - -*/ - -let clipboard_title = "Copy to clipboard" -let clipboard_icon = `` -let clipboard_successIcon = `` -let clipboard_successDuration = 1000 - -$(function() { - if(navigator.clipboard) { - const fragments = document.getElementsByClassName("fragment") - for(const fragment of fragments) { - const clipboard_div = document.createElement("div") - clipboard_div.classList.add("clipboard") - clipboard_div.innerHTML = clipboard_icon - clipboard_div.title = clipboard_title - $(clipboard_div).click(function() { - const content = this.parentNode.cloneNode(true) - // filter out line number and folded fragments from file listings - content.querySelectorAll(".lineno, .ttc, .foldclosed").forEach((node) => { node.remove() }) - let text = content.textContent - // remove trailing newlines and trailing spaces from empty lines - text = text.replace(/^\s*\n/gm,'\n').replace(/\n*$/,'') - navigator.clipboard.writeText(text); - this.classList.add("success") - this.innerHTML = clipboard_successIcon - window.setTimeout(() => { // switch back to normal icon after timeout - this.classList.remove("success") - this.innerHTML = clipboard_icon - }, clipboard_successDuration); - }) - fragment.insertBefore(clipboard_div, fragment.firstChild) - } - } -}) diff --git a/cookie.js b/cookie.js deleted file mode 100644 index 53ad21d..0000000 --- a/cookie.js +++ /dev/null @@ -1,58 +0,0 @@ -/*! - Cookie helper functions - Copyright (c) 2023 Dimitri van Heesch - Released under MIT license. -*/ -let Cookie = { - cookie_namespace: 'doxygen_', - - readSetting(cookie,defVal) { - if (window.chrome) { - const val = localStorage.getItem(this.cookie_namespace+cookie) || - sessionStorage.getItem(this.cookie_namespace+cookie); - if (val) return val; - } else { - let myCookie = this.cookie_namespace+cookie+"="; - if (document.cookie) { - const index = document.cookie.indexOf(myCookie); - if (index != -1) { - const valStart = index + myCookie.length; - let valEnd = document.cookie.indexOf(";", valStart); - if (valEnd == -1) { - valEnd = document.cookie.length; - } - return document.cookie.substring(valStart, valEnd); - } - } - } - return defVal; - }, - - writeSetting(cookie,val,days=10*365) { // default days='forever', 0=session cookie, -1=delete - if (window.chrome) { - if (days==0) { - sessionStorage.setItem(this.cookie_namespace+cookie,val); - } else { - localStorage.setItem(this.cookie_namespace+cookie,val); - } - } else { - let date = new Date(); - date.setTime(date.getTime()+(days*24*60*60*1000)); - const expiration = days!=0 ? "expires="+date.toGMTString()+";" : ""; - document.cookie = this.cookie_namespace + cookie + "=" + - val + "; SameSite=Lax;" + expiration + "path=/"; - } - }, - - eraseSetting(cookie) { - if (window.chrome) { - if (localStorage.getItem(this.cookie_namespace+cookie)) { - localStorage.removeItem(this.cookie_namespace+cookie); - } else if (sessionStorage.getItem(this.cookie_namespace+cookie)) { - sessionStorage.removeItem(this.cookie_namespace+cookie); - } - } else { - this.writeSetting(cookie,'',-1); - } - }, -} diff --git a/darkmode_toggle.js b/darkmode_toggle.js index b9c7364..e2331dc 100644 --- a/darkmode_toggle.js +++ b/darkmode_toggle.js @@ -28,10 +28,6 @@ SOFTWARE. */ class DarkModeToggle extends HTMLElement { - - static darkmode_cookie_name = ''+'prefers-dark'; - static lightmode_cookie_name = ''+'prefers-light'; - static icon = ''; static title = "Toggle Light/Dark Mode" @@ -61,30 +57,29 @@ class DarkModeToggle extends HTMLElement { const toggleButton = document.createElement('dark-mode-toggle') toggleButton.title = DarkModeToggle.title toggleButton.innerHTML = DarkModeToggle.icon - toggleButton.tabIndex = 0; function addButton() { - const titleArea = document.getElementById("titlearea"); - const searchBox = document.getElementById("MSearchBox"); - const mainMenu = document.getElementById("main-menu"); - const navRow1 = document.getElementById("navrow1"); - let mainMenuVisible = false; + var titleArea = document.getElementById("titlearea"); + var searchBox = document.getElementById("MSearchBox"); + var mainMenu = document.getElementById("main-menu"); + var navRow1 = document.getElementById("navrow1"); + var mainMenuVisible = false; if (mainMenu) { - const menuStyle = window.getComputedStyle(mainMenu); + var menuStyle = window.getComputedStyle(mainMenu); mainMenuVisible = menuStyle.display!=='none' } - const searchBoxPos1 = document.getElementById("searchBoxPos1"); + var searchBoxPos1 = document.getElementById("searchBoxPos1"); if (searchBox) { // (1) search box visible searchBox.parentNode.appendChild(toggleButton) } else if (navRow1) { // (2) no search box, static menu bar - const li = document.createElement('li'); + var li = document.createElement('li'); li.style = 'float: right;' li.appendChild(toggleButton); toggleButton.style = 'width: 24px; height: 25px; padding-top: 11px; float: right;'; - const row = document.querySelector('#navrow1 > ul:first-of-type'); + var row = document.querySelector('#navrow1 > ul:first-of-type'); row.appendChild(li) } else if (mainMenu && mainMenuVisible) { // (3) no search box + dynamic menu bar expanded - const li = document.createElement('li'); + var li = document.createElement('li'); li.style = 'float: right;' li.appendChild(toggleButton); toggleButton.style = 'width: 14px; height: 36px; padding-top: 10px; float: right;'; @@ -99,16 +94,11 @@ class DarkModeToggle extends HTMLElement { } } - $(document).ready(() => addButton()); - $(window).resize(() => addButton()); - let inFocus = false; - $(document).focusin(() => inFocus = true); - $(document).focusout(() => inFocus = false); - $(document).keyup(function(e) { - if (e.keyCode==27 && !inFocus) { // escape key maps to keycode `27` - e.stopPropagation(); - DarkModeToggle.userPreference = !DarkModeToggle.userPreference - } + $(document).ready(function(){ + addButton(); + }) + $(window).resize(function(){ + addButton(); }) DarkModeToggle.setDarkModeVisibility(DarkModeToggle.darkModeEnabled) }) @@ -118,7 +108,32 @@ class DarkModeToggle extends HTMLElement { constructor() { super(); this.onclick=this.toggleDarkMode - this.onkeypress=function(e){if (e.keyCode==13) { this.toggleDarkMode(); }}; + } + + static createCookie(name, value, days) { + if (days) { + var date = new Date(); + date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); + var expires = "; expires=" + date.toGMTString(); + } + else var expires = ""; + + document.cookie = name + "=" + value + expires + "; path=/"; + } + + static readCookie(name) { + var nameEQ = name + "="; + var ca = document.cookie.split(';'); + for (var i = 0; i < ca.length; i++) { + var c = ca[i]; + while (c.charAt(0) == ' ') c = c.substring(1, c.length); + if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length); + } + return null; + } + + static eraseCookie(name) { + DarkModeToggle.createCookie(name, "", -1); } /** @@ -129,29 +144,54 @@ class DarkModeToggle extends HTMLElement { } static get prefersDarkModeInLightMode() { - return Cookie.readSetting(DarkModeToggle.darkmode_cookie_name,'0')=='1'; + if (window.chrome) { // Chrome supports localStorage in combination with file:// but not cookies + return localStorage.getItem(DarkModeToggle.prefersDarkModeInLightModeKey) + } else { // Other browsers support cookies in combination with file:// but not localStorage + return DarkModeToggle.readCookie('doxygen_prefers_dark')=='1' + } } static set prefersDarkModeInLightMode(preference) { - if (preference) { - Cookie.writeSetting(DarkModeToggle.darkmode_cookie_name,'1'); + if (window.chrome) { + if (preference) { + localStorage.setItem(DarkModeToggle.prefersDarkModeInLightModeKey, true) + } else { + localStorage.removeItem(DarkModeToggle.prefersDarkModeInLightModeKey) + } } else { - Cookie.eraseSetting(DarkModeToggle.darkmode_cookie_name); + if (preference) { + DarkModeToggle.createCookie('doxygen_prefers_dark','1',365) + } else { + DarkModeToggle.eraseCookie('doxygen_prefers_dark') + } } } static get prefersLightModeInDarkMode() { - return Cookie.readSetting(DarkModeToggle.lightmode_cookie_name,'0')=='1' + if (window.chrome) { // Chrome supports localStorage in combination with file:// but not cookies + return localStorage.getItem(DarkModeToggle.prefersLightModeInDarkModeKey) + } else { // Other browsers support cookies in combination with file:// but not localStorage + return DarkModeToggle.readCookie('doxygen_prefers_light')=='1' + } } static set prefersLightModeInDarkMode(preference) { - if (preference) { - Cookie.writeSetting(DarkModeToggle.lightmode_cookie_name,'1'); + if (window.chrome) { + if (preference) { + localStorage.setItem(DarkModeToggle.prefersLightModeInDarkModeKey, true) + } else { + localStorage.removeItem(DarkModeToggle.prefersLightModeInDarkModeKey) + } } else { - Cookie.eraseSetting(DarkModeToggle.lightmode_cookie_name); + if (preference) { + DarkModeToggle.createCookie('doxygen_prefers_light','1',365) + } else { + DarkModeToggle.eraseCookie('doxygen_prefers_light') + } } } + /** * @returns `true` for dark-mode, `false` for light-mode user preference */ @@ -179,7 +219,7 @@ class DarkModeToggle extends HTMLElement { } static setDarkModeVisibility(enable) { - let darkModeStyle, lightModeStyle; + var darkModeStyle, lightModeStyle; if(enable) { darkModeStyle = 'inline-block'; lightModeStyle = 'none' @@ -187,8 +227,12 @@ class DarkModeToggle extends HTMLElement { darkModeStyle = 'none'; lightModeStyle = 'inline-block' } - document.querySelectorAll('.dark-mode-visible' ).forEach(el => el.style.display = darkModeStyle); - document.querySelectorAll('.light-mode-visible').forEach(el => el.style.display = lightModeStyle); + document.querySelectorAll('.dark-mode-visible').forEach(function(el) { + el.style.display = darkModeStyle; + }); + document.querySelectorAll('.light-mode-visible').forEach(function(el) { + el.style.display = lightModeStyle; + }); } static enableDarkMode(enable) { if(enable) { diff --git a/dir_49e56c817e5e54854c35e136979f97ca.html b/dir_49e56c817e5e54854c35e136979f97ca.html index 0c44df0..eb60f14 100644 --- a/dir_49e56c817e5e54854c35e136979f97ca.html +++ b/dir_49e56c817e5e54854c35e136979f97ca.html @@ -3,15 +3,12 @@ - + RF24Gateway - TCP/IP over RF24Network: docs Directory Reference - - - @@ -26,7 +23,7 @@ -
RF24Gateway - TCP/IP over RF24Network v2.0.0 +
RF24Gateway - TCP/IP over RF24Network v1.1.0
TMRh20 - Pushing the practical limits of RF24 modules
@@ -35,7 +32,7 @@
- + @@ -85,7 +82,7 @@ diff --git a/doc.png b/doc.png new file mode 100644 index 0000000000000000000000000000000000000000..17edabff95f7b8da13c9516a04efe05493c29501 GIT binary patch literal 746 zcmV7=@pnbNXRFEm&G8P!&WHG=d)>K?YZ1bzou)2{$)) zumDct!>4SyxL;zgaG>wy`^Hv*+}0kUfCrz~BCOViSb$_*&;{TGGn2^x9K*!Sf0=lV zpP=7O;GA0*Jm*tTYj$IoXvimpnV4S1Z5f$p*f$Db2iq2zrVGQUz~yq`ahn7ck(|CE z7Gz;%OP~J6)tEZWDzjhL9h2hdfoU2)Nd%T<5Kt;Y0XLt&<@6pQx!nw*5`@bq#?l*?3z{Hlzoc=Pr>oB5(9i6~_&-}A(4{Q$>c>%rV&E|a(r&;?i5cQB=} zYSDU5nXG)NS4HEs0it2AHe2>shCyr7`6@4*6{r@8fXRbTA?=IFVWAQJL&H5H{)DpM#{W(GL+Idzf^)uRV@oB8u$ z8v{MfJbTiiRg4bza<41NAzrl{=3fl_D+$t+^!xlQ8S}{UtY`e z;;&9UhyZqQRN%2pot{*Ei0*4~hSF_3AH2@fKU!$NSflS>{@tZpDT4`M2WRTTVH+D? z)GFlEGGHe?koB}i|1w45!BF}N_q&^HJ&-tyR{(afC6H7|aml|tBBbv}55C5DNP8p3 z)~jLEO4Z&2hZmP^i-e%(@d!(E|KRafiU8Q5u(wU((j8un3OR*Hvj+t literal 0 HcmV?d00001 diff --git a/doc.svg b/doc.svg deleted file mode 100644 index 0b928a5..0000000 --- a/doc.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - diff --git a/docd.png b/docd.png new file mode 100644 index 0000000000000000000000000000000000000000..d7c94fda9bf08ecc02c7190d968452b7a2dbf04b GIT binary patch literal 756 zcmV1wr-rhpn+wxm%q2)IkAYsr{iGq<}_z5JCD4J;FN?6Qh;@TCubdp(_XdD-^ zG_#)IP7_z6hKNdx5^+FGArwLWTWCG!j+oKji?U!hxA#d-ljgkN`+e^@-P+RWG{Bx= z2iQyYTtEf*o~ySWrIVW}HWHi0_hd4~$E6Jx1U`>Owo}EYJ1O>iZvS?!z8}B}QwLMA zC3Keqf1c}K@?C`X>68b(EUzYUYAS&OH^VPteZLPr{S&|nQvp@6W4GH-1U8!u&7l~A zx~RUSNH+>7@q38W6!BzirtjLFCzc|XGx)EF#G%^pWION*k@?vP<2O>|XkCD3ujl%1 z{55JSVkw{~HbX>iEZ2%yJ2eHj5Yh8OTpzs0A2;tZ^x!#5D+y-es{k1&0|Ns9-|+Xt ziGiTsZ8(^nUo#wdTpIDkb-Zp(3|A*FzW}GZ5SQD-r^R`&X@`26E3W|GyrwDIZjtQ& z$g5f8Sv=VgVtDien@J(!^BK+#l;s-LgP--p7C;7;E!ysXcXK6?+9D>_-B(?Wm(U zQbNm-5TyYxIU=rs0+)!ixqzhuxw(AqKc3?KKX32{D~Qibp*r0x&Wux5-9WCMMRi3U zTd6dOCQlj>a;gr;gLwRKulT&(m@^L{&HkSC(qH05HSSf$YEhynGvH zWNez``Z8FJXE+BSg=%ak{OR z+Nylcb{?evLYLuE1_HngYw0g%LC#=$a@?4~Tx>F9295Q>9UJ|_6v-KMw;!YZSgGj@ zR8fRov=hJ#QvsO@xw*{0%zH@OKVEUr - - - - - - - - - - diff --git a/doxygen-custom.css b/doxygen-custom.css index 2b5ef5a..7d56191 100644 --- a/doxygen-custom.css +++ b/doxygen-custom.css @@ -1,107 +1,3 @@ table.markdownTable th { color: unset; } - -/* overrides from default CSSS for some admonitions */ -dl.note, dl.remark, -dl.warning, dl.attention { - color: unset; -} -dl.remark { - background: var(--remark-color-bg); - border-left: 8px solid var(--remark-color-hl); -} -dl.remark dt { - color: var(--remark-color-hl); -} - -/* special rules to accent `/see` or `/sa` command output */ -dl.see { - background: var(--seealso-color-bg); - border-left: 8px solid var(--seealso-color-hl); -} -dl.see dt { - color: var(--seealso-color-hl); -} -dl.see { - padding: 10px; - margin: 10px 0px; - overflow: hidden; - margin-left: 0; - border-radius: 4px; -} - -/* admonition icons */ -dl.note dt::before { - background-color: var(--note-color-hl); - mask-image: var(--note-icon); -} -dl.see dt::before { - background-color: var(--seealso-color-hl); - mask-image: var(--seealso-icon); -} -dl.remark dt::before { - background-color: var(--remark-color-hl); - mask-image: var(--remark-icon); -} -dl.warning dt::before { - background-color: var(--warning-color-hl); - mask-image: var(--warning-icon); -} -dl.deprecated dt::before { - background-color: var(--deprecated-color-hl); - mask-image: var(--deprecated-icon); -} -dl.note dt::before, -dl.see dt::before, -dl.warning dt::before, -dl.remark dt::before, -dl.deprecated dt::before { - vertical-align: middle; - background-repeat: no-repeat; - content: ""; - display: inline-block; - height: 2em; - width: 2em; - margin-right: 0.25rem; -} -dl.note dt, -dl.see dt, -dl.warning dt, -dl.remark dt, -dl.deprecated dt { - margin-top: -0.35em; - margin-bottom: 0.5em; -} - -/* icon SVG data */ -*:root { - --note-icon: url('data:image/svg+xml;utf8,'); - --seealso-icon: url('data:image/svg+xml;utf8,'); - --warning-icon: url('data:image/svg+xml;utf8,'); - --remark-icon: url('data:image/svg+xml;utf8,'); - --deprecated-icon: url('data:image/svg+xml;utf8,'); -} - -/* color overrides */ -html { - /* light theme CSS variables */ - --note-color-bg: hsla(47.6, 77.3%, 91.4%, 65%); - --warning-color-bg: hsla(6.8, 75.9%, 88.6%, 65%); - --deprecated-color-bg: hsla(205.7, 22.6%, 93.9%, 65%); - --seealso-color-bg: hsla(215, 76%, 89%, 65%); - --seealso-color-hl: hsl(215, 98%, 48%); - --remark-color-bg: hsla(133, 75%, 89%, 65%); - --remark-color-hl: hsl(133, 98.9%, 35.3%); -} - -html.dark-mode { - /* dark theme CSS variables */ - --note-color-bg: hsla(45.8, 87.3%, 12.4%, 65%); - --warning-color-bg: hsla(5.2, 33.3%, 13.5%, 65%); - --deprecated-color-bg: hsla(221.5, 12.4%, 20.6%, 65%); - --seealso-color-bg: hsla(215, 33%, 14%, 0.65); - --seealso-color-hl: hsl(215, 98%, 48%); - --remark-color-bg: hsla(133, 32%, 14%, 65%); - --remark-color-hl: hsl(133, 98%, 48%); -} \ No newline at end of file diff --git a/doxygen.css b/doxygen.css index 9cf4f26..1402220 100644 --- a/doxygen.css +++ b/doxygen.css @@ -1,4 +1,4 @@ -/* The standard CSS for doxygen 1.10.0*/ +/* The standard CSS for doxygen 1.9.6*/ html { /* page base colors */ @@ -39,9 +39,7 @@ html { --icon-background-color: #728DC1; --icon-foreground-color: white; ---icon-doc-image: url('doc.svg'); ---icon-folder-open-image: url('folderopen.svg'); ---icon-folder-closed-image: url('folderclosed.svg'); +--icon-doc-image: url('doc.png'); /* brief member declaration list */ --memdecl-background-color: #F9FAFC; @@ -102,7 +100,6 @@ html { --toc-background-color: #F4F6FA; --toc-border-color: #D8DFEE; --toc-header-color: #4665A2; ---toc-down-arrow-image: url("data:image/svg+xml;utf8,&%238595;"); /** search field */ --search-background-color: white; @@ -128,7 +125,6 @@ html { --code-preprocessor-color: #806020; --code-string-literal-color: #002080; --code-char-literal-color: #008080; ---code-xml-cdata-color: black; --code-vhdl-digit-color: #FF00FF; --code-vhdl-char-color: #000000; --code-vhdl-keyword-color: #700070; @@ -145,7 +141,6 @@ html { --fragment-lineno-link-bg-color: #D8D8D8; --fragment-lineno-link-hover-fg-color: #4665A2; --fragment-lineno-link-hover-bg-color: #C8C8C8; ---fragment-copy-ok-color: #2EC82E; --tooltip-foreground-color: black; --tooltip-background-color: white; --tooltip-border-color: gray; @@ -153,15 +148,10 @@ html { --tooltip-declaration-color: #006318; --tooltip-link-color: #4665A2; --tooltip-shadow: 1px 1px 7px gray; ---fold-line-color: #808080; ---fold-minus-image: url('minus.svg'); ---fold-plus-image: url('plus.svg'); ---fold-minus-image-relpath: url('../../minus.svg'); ---fold-plus-image-relpath: url('../../plus.svg'); /** font-family */ --font-family-normal: Roboto,sans-serif; ---font-family-monospace: 'JetBrains Mono',Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace,fixed; +--font-family-monospace: monospace,fixed; --font-family-nav: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; --font-family-title: Tahoma,Arial,sans-serif; --font-family-toc: Verdana,'DejaVu Sans',Geneva,sans-serif; @@ -169,28 +159,6 @@ html { --font-family-icon: Arial,Helvetica; --font-family-tooltip: Roboto,sans-serif; -/** special sections */ ---warning-color-bg: #f8d1cc; ---warning-color-hl: #b61825; ---warning-color-text: #75070f; ---note-color-bg: #faf3d8; ---note-color-hl: #f3a600; ---note-color-text: #5f4204; ---todo-color-bg: #e4f3ff; ---todo-color-hl: #1879C4; ---todo-color-text: #274a5c; ---test-color-bg: #e8e8ff; ---test-color-hl: #3939C4; ---test-color-text: #1a1a5c; ---deprecated-color-bg: #ecf0f3; ---deprecated-color-hl: #5b6269; ---deprecated-color-text: #43454a; ---bug-color-bg: #e4dafd; ---bug-color-hl: #5b2bdd; ---bug-color-text: #2a0d72; ---invariant-color-bg: #d8f1e3; ---invariant-color-hl: #44b86f; ---invariant-color-text: #265532; } html.dark-mode { @@ -232,9 +200,7 @@ html.dark-mode { --icon-background-color: #334975; --icon-foreground-color: #C4CFE5; ---icon-doc-image: url('docd.svg'); ---icon-folder-open-image: url('folderopend.svg'); ---icon-folder-closed-image: url('folderclosedd.svg'); +--icon-doc-image: url('docd.png'); /* brief member declaration list */ --memdecl-background-color: #0B101A; @@ -295,7 +261,6 @@ html.dark-mode { --toc-background-color: #151E30; --toc-border-color: #202E4A; --toc-header-color: #A3B4D7; ---toc-down-arrow-image: url("data:image/svg+xml;utf8,&%238595;"); /** search field */ --search-background-color: black; @@ -321,15 +286,14 @@ html.dark-mode { --code-preprocessor-color: #65CABE; --code-string-literal-color: #7EC699; --code-char-literal-color: #00E0F0; ---code-xml-cdata-color: #C9D1D9; --code-vhdl-digit-color: #FF00FF; ---code-vhdl-char-color: #C0C0C0; ---code-vhdl-keyword-color: #CF53C9; +--code-vhdl-char-color: #000000; +--code-vhdl-keyword-color: #700070; --code-vhdl-logic-color: #FF0000; --code-link-color: #79C0FF; --code-external-link-color: #79C0FF; --fragment-foreground-color: #C9D1D9; ---fragment-background-color: #090D16; +--fragment-background-color: black; --fragment-border-color: #30363D; --fragment-lineno-border-color: #30363D; --fragment-lineno-background-color: black; @@ -338,7 +302,6 @@ html.dark-mode { --fragment-lineno-link-bg-color: #303030; --fragment-lineno-link-hover-fg-color: #8E96A1; --fragment-lineno-link-hover-bg-color: #505050; ---fragment-copy-ok-color: #0EA80E; --tooltip-foreground-color: #C9D1D9; --tooltip-background-color: #202020; --tooltip-border-color: #C9D1D9; @@ -346,15 +309,10 @@ html.dark-mode { --tooltip-declaration-color: #20C348; --tooltip-link-color: #79C0FF; --tooltip-shadow: none; ---fold-line-color: #808080; ---fold-minus-image: url('minusd.svg'); ---fold-plus-image: url('plusd.svg'); ---fold-minus-image-relpath: url('../../minusd.svg'); ---fold-plus-image-relpath: url('../../plusd.svg'); /** font-family */ --font-family-normal: Roboto,sans-serif; ---font-family-monospace: 'JetBrains Mono',Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace,fixed; +--font-family-monospace: monospace,fixed; --font-family-nav: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; --font-family-title: Tahoma,Arial,sans-serif; --font-family-toc: Verdana,'DejaVu Sans',Geneva,sans-serif; @@ -362,28 +320,6 @@ html.dark-mode { --font-family-icon: Arial,Helvetica; --font-family-tooltip: Roboto,sans-serif; -/** special sections */ ---warning-color-bg: #2e1917; ---warning-color-hl: #ad2617; ---warning-color-text: #f5b1aa; ---note-color-bg: #3b2e04; ---note-color-hl: #f1b602; ---note-color-text: #ceb670; ---todo-color-bg: #163750; ---todo-color-hl: #1982D2; ---todo-color-text: #dcf0fa; ---test-color-bg: #121258; ---test-color-hl: #4242cf; ---test-color-text: #c0c0da; ---deprecated-color-bg: #2e323b; ---deprecated-color-hl: #738396; ---deprecated-color-text: #abb0bd; ---bug-color-bg: #2a2536; ---bug-color-hl: #7661b3; ---bug-color-text: #ae9ed6; ---invariant-color-bg: #303a35; ---invariant-color-hl: #76ce96; ---invariant-color-text: #cceed5; } body { @@ -401,6 +337,8 @@ body, table, div, p, dl { /* @group Heading Levels */ .title { + font-weight: 400; + font-size: 14px; font-family: var(--font-family-normal); line-height: 28px; font-size: 150%; @@ -533,12 +471,6 @@ div.qindex{ color: var(--index-separator-color); } -#main-menu a:focus { - outline: auto; - z-index: 10; - position: relative; -} - dt.alphachar{ font-size: 180%; font-weight: bold; @@ -598,13 +530,7 @@ a { } a:hover { - text-decoration: none; - background: linear-gradient(to bottom, transparent 0,transparent calc(100% - 1px), currentColor 100%); -} - -a:hover > span.arrow { - text-decoration: none; - background : var(--nav-background-color); + text-decoration: underline; } a.el { @@ -680,70 +606,37 @@ ul.multicol { .fragment { text-align: left; direction: ltr; - overflow-x: auto; + overflow-x: auto; /*Fixed: fragment lines overlap floating elements*/ overflow-y: hidden; - position: relative; - min-height: 12px; - margin: 10px 0px; - padding: 10px 10px; - border: 1px solid var(--fragment-border-color); - border-radius: 4px; - background-color: var(--fragment-background-color); - color: var(--fragment-foreground-color); } pre.fragment { - word-wrap: break-word; - font-size: 10pt; - line-height: 125%; - font-family: var(--font-family-monospace); -} - -.clipboard { - width: 24px; - height: 24px; - right: 5px; - top: 5px; - opacity: 0; - position: absolute; - display: inline; + border: 1px solid var(--fragment-border-color); + background-color: var(--fragment-background-color); + color: var(--fragment-foreground-color); + padding: 4px 6px; + margin: 4px 8px 4px 2px; overflow: auto; - fill: var(--fragment-foreground-color); - justify-content: center; - align-items: center; - cursor: pointer; -} - -.clipboard.success { - border: 1px solid var(--fragment-foreground-color); - border-radius: 4px; -} - -.fragment:hover .clipboard, .clipboard.success { - opacity: .28; -} - -.clipboard:hover, .clipboard.success { - opacity: 1 !important; -} - -.clipboard:active:not([class~=success]) svg { - transform: scale(.91); -} - -.clipboard.success svg { - fill: var(--fragment-copy-ok-color); + word-wrap: break-word; + font-size: 9pt; + line-height: 125%; + font-family: var(--font-family-monospace); + font-size: 105%; } -.clipboard.success { - border-color: var(--fragment-copy-ok-color); +div.fragment { + padding: 0 0 1px 0; /*Fixed: last line underline overlap border*/ + margin: 4px 8px 4px 2px; + color: var(--fragment-foreground-color); + background-color: var(--fragment-background-color); + border: 1px solid var(--fragment-border-color); } div.line { font-family: var(--font-family-monospace); font-size: 13px; min-height: 13px; - line-height: 1.2; + line-height: 1.0; text-wrap: unrestricted; white-space: -moz-pre-wrap; /* Moz */ white-space: -pre-wrap; /* Opera 4-6 */ @@ -776,18 +669,6 @@ div.line.glow { box-shadow: 0 0 10px var(--glow-color); } -span.fold { - margin-left: 5px; - margin-right: 1px; - margin-top: 0px; - margin-bottom: 0px; - padding: 0px; - display: inline-block; - width: 12px; - height: 12px; - background-repeat:no-repeat; - background-position:center; -} span.lineno { padding-right: 4px; @@ -859,6 +740,10 @@ img.light-mode-visible { display: none; } +img.formulaDsp { + +} + img.formulaInl, img.inline { vertical-align: middle; } @@ -921,10 +806,6 @@ span.charliteral { color: var(--code-char-literal-color); } -span.xmlcdata { - color: var(--code-xml-cdata-color); -} - span.vhdldigit { color: var(--code-vhdl-digit-color); } @@ -1158,25 +1039,17 @@ dl.reflist dd { .paramtype { white-space: nowrap; - padding: 0px; - padding-bottom: 1px; } .paramname { + color: var(--memdef-param-name-color); white-space: nowrap; - padding: 0px; - padding-bottom: 1px; - margin-left: 2px; } - .paramname em { - color: var(--memdef-param-name-color); font-style: normal; - margin-right: 1px; } - -.paramname .paramdefval { - font-family: var(--font-family-monospace); +.paramname code { + line-height: 14px; } .params, .retval, .exception, .tparams { @@ -1347,7 +1220,8 @@ div.directory { width: 24px; height: 18px; margin-bottom: 4px; - background-image:var(--icon-folder-open-image); + background-image:url('folderopen.png'); + background-position: 0px -4px; background-repeat: repeat-y; vertical-align:top; display: inline-block; @@ -1357,7 +1231,8 @@ div.directory { width: 24px; height: 18px; margin-bottom: 4px; - background-image:var(--icon-folder-closed-image); + background-image:url('folderclosed.png'); + background-position: 0px -4px; background-repeat: repeat-y; vertical-align:top; display: inline-block; @@ -1510,6 +1385,7 @@ table.fieldtable { { height:32px; display:block; + text-decoration: none; outline: none; color: var(--nav-text-normal-color); font-family: var(--font-family-nav); @@ -1598,8 +1474,7 @@ dl { padding: 0 0 0 0; } -/* - +/* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug, dl.examples */ dl.section { margin-left: 0px; padding-left: 0px; @@ -1654,101 +1529,8 @@ dl.bug { border-color: #C08050; } -*/ - -dl.bug dt a, dl.deprecated dt a, dl.todo dt a, dl.test a { - font-weight: bold !important; -} - -dl.warning, dl.attention, dl.note, dl.deprecated, dl.bug, -dl.invariant, dl.pre, dl.post, dl.todo, dl.test, dl.remark { - padding: 10px; - margin: 10px 0px; - overflow: hidden; - margin-left: 0; - border-radius: 4px; -} - dl.section dd { - margin-bottom: 2px; -} - -dl.warning, dl.attention { - background: var(--warning-color-bg); - border-left: 8px solid var(--warning-color-hl); - color: var(--warning-color-text); -} - -dl.warning dt, dl.attention dt { - color: var(--warning-color-hl); -} - -dl.note, dl.remark { - background: var(--note-color-bg); - border-left: 8px solid var(--note-color-hl); - color: var(--note-color-text); -} - -dl.note dt, dl.remark dt { - color: var(--note-color-hl); -} - -dl.todo { - background: var(--todo-color-bg); - border-left: 8px solid var(--todo-color-hl); - color: var(--todo-color-text); -} - -dl.todo dt { - color: var(--todo-color-hl); -} - -dl.test { - background: var(--test-color-bg); - border-left: 8px solid var(--test-color-hl); - color: var(--test-color-text); -} - -dl.test dt { - color: var(--test-color-hl); -} - -dl.bug dt a { - color: var(--bug-color-hl) !important; -} - -dl.bug { - background: var(--bug-color-bg); - border-left: 8px solid var(--bug-color-hl); - color: var(--bug-color-text); -} - -dl.bug dt a { - color: var(--bug-color-hl) !important; -} - -dl.deprecated { - background: var(--deprecated-color-bg); - border-left: 8px solid var(--deprecated-color-hl); - color: var(--deprecated-color-text); -} - -dl.deprecated dt a { - color: var(--deprecated-color-hl) !important; -} - -dl.section dd, dl.bug dd, dl.deprecated dd, dl.todo dd, dl.test dd { - margin-inline-start: 0px; -} - -dl.invariant, dl.pre, dl.post { - background: var(--invariant-color-bg); - border-left: 8px solid var(--invariant-color-hl); - color: var(--invariant-color-text); -} - -dl.invariant dt, dl.pre dt, dl.post dt { - color: var(--invariant-color-hl); + margin-bottom: 6px; } @@ -1763,12 +1545,12 @@ dl.invariant dt, dl.pre dt, dl.post dt { vertical-align: bottom; border-collapse: separate; } - + #projectlogo img -{ +{ border: 0px none; } - + #projectalign { vertical-align: middle; @@ -1869,7 +1651,7 @@ div.toc { } div.toc li { - background: var(--toc-down-arrow-image) no-repeat scroll 0 5px transparent; + background: url("bdwn.png") no-repeat scroll 0 5px transparent; font: 10px/1.2 var(--font-family-toc); margin-top: 5px; padding-left: 10px; @@ -1898,11 +1680,11 @@ div.toc li.level2 { } div.toc li.level3 { - margin-left: 15px; + margin-left: 30px; } div.toc li.level4 { - margin-left: 15px; + margin-left: 45px; } span.emoji { diff --git a/doxygen.svg b/doxygen.svg index 79a7635..d42dad5 100644 --- a/doxygen.svg +++ b/doxygen.svg @@ -1,6 +1,4 @@ - @@ -19,7 +17,7 @@ - + diff --git a/doxygen_crawl.html b/doxygen_crawl.html deleted file mode 100644 index ae9e3ee..0000000 --- a/doxygen_crawl.html +++ /dev/null @@ -1,61 +0,0 @@ - - - -Validator / crawler helper - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dynsections.js b/dynsections.js index 24dfe9c..1f4cd14 100644 --- a/dynsections.js +++ b/dynsections.js @@ -22,177 +22,106 @@ @licend The above is the entire license notice for the JavaScript code in this file */ - -let dynsection = { - - // helper function - updateStripes : function() { - $('table.directory tr'). - removeClass('even').filter(':visible:even').addClass('even'); - $('table.directory tr'). - removeClass('odd').filter(':visible:odd').addClass('odd'); - }, - - toggleVisibility : function(linkObj) { - const base = $(linkObj).attr('id'); - const summary = $('#'+base+'-summary'); - const content = $('#'+base+'-content'); - const trigger = $('#'+base+'-trigger'); - const src=$(trigger).attr('src'); - if (content.is(':visible')===true) { - content.hide(); - summary.show(); - $(linkObj).addClass('closed').removeClass('opened'); - $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png'); +function toggleVisibility(linkObj) +{ + var base = $(linkObj).attr('id'); + var summary = $('#'+base+'-summary'); + var content = $('#'+base+'-content'); + var trigger = $('#'+base+'-trigger'); + var src=$(trigger).attr('src'); + if (content.is(':visible')===true) { + content.hide(); + summary.show(); + $(linkObj).addClass('closed').removeClass('opened'); + $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png'); + } else { + content.show(); + summary.hide(); + $(linkObj).removeClass('closed').addClass('opened'); + $(trigger).attr('src',src.substring(0,src.length-10)+'open.png'); + } + return false; +} + +function updateStripes() +{ + $('table.directory tr'). + removeClass('even').filter(':visible:even').addClass('even'); + $('table.directory tr'). + removeClass('odd').filter(':visible:odd').addClass('odd'); +} + +function toggleLevel(level) +{ + $('table.directory tr').each(function() { + var l = this.id.split('_').length-1; + var i = $('#img'+this.id.substring(3)); + var a = $('#arr'+this.id.substring(3)); + if (l'); - // add vertical lines to other rows - $('span[class=lineno]').not(':eq(0)').append(''); - // add toggle controls to lines with fold divs - $('div[class=foldopen]').each(function() { - // extract specific id to use - const id = $(this).attr('id').replace('foldopen',''); - // extract start and end foldable fragment attributes - const start = $(this).attr('data-start'); - const end = $(this).attr('data-end'); - // replace normal fold span with controls for the first line of a foldable fragment - $(this).find('span[class=fold]:first').replaceWith(''); - // append div for folded (closed) representation - $(this).after(''); - // extract the first line from the "open" section to represent closed content - const line = $(this).children().first().clone(); - // remove any glow that might still be active on the original line - $(line).removeClass('glow'); - if (start) { - // if line already ends with a start marker (e.g. trailing {), remove it - $(line).html($(line).html().replace(new RegExp('\\s*'+start+'\\s*$','g'),'')); - } - // replace minus with plus symbol - $(line).find('span[class=fold]').css('background-image',codefold.plusImg[relPath]); - // append ellipsis - $(line).append(' '+start+''+end); - // insert constructed line into closed div - $('#foldclosed'+id).html(line); - }); - }, -}; + }); + updateStripes(); +} + +function toggleFolder(id) +{ + // the clicked row + var currentRow = $('#row_'+id); + + // all rows after the clicked row + var rows = currentRow.nextAll("tr"); + + var re = new RegExp('^row_'+id+'\\d+_$', "i"); //only one sub + + // only match elements AFTER this one (can't hide elements before) + var childRows = rows.filter(function() { return this.id.match(re); }); + + // first row is visible we are HIDING + if (childRows.filter(':first').is(':visible')===true) { + // replace down arrow by right arrow for current row + var currentRowSpans = currentRow.find("span"); + currentRowSpans.filter(".iconfopen").removeClass("iconfopen").addClass("iconfclosed"); + currentRowSpans.filter(".arrow").html('►'); + rows.filter("[id^=row_"+id+"]").hide(); // hide all children + } else { // we are SHOWING + // replace right arrow by down arrow for current row + var currentRowSpans = currentRow.find("span"); + currentRowSpans.filter(".iconfclosed").removeClass("iconfclosed").addClass("iconfopen"); + currentRowSpans.filter(".arrow").html('▼'); + // replace down arrows by right arrows for child rows + var childRowsSpans = childRows.find("span"); + childRowsSpans.filter(".iconfopen").removeClass("iconfopen").addClass("iconfclosed"); + childRowsSpans.filter(".arrow").html('►'); + childRows.show(); //show all children + } + updateStripes(); +} + + +function toggleInherit(id) +{ + var rows = $('tr.inherit.'+id); + var img = $('tr.inherit_header.'+id+' img'); + var src = $(img).attr('src'); + if (rows.filter(':first').is(':visible')===true) { + rows.css('display','none'); + $(img).attr('src',src.substring(0,src.length-8)+'closed.png'); + } else { + rows.css('display','table-row'); // using show() causes jump in firefox + $(img).attr('src',src.substring(0,src.length-10)+'open.png'); + } +} /* @license-end */ -$(function() { +$(document).ready(function() { $('.code,.codeRef').each(function() { $(this).data('powertip',$('#a'+$(this).attr('href').replace(/.*\//,'').replace(/[^a-z_A-Z0-9]/g,'_')).html()); $.fn.powerTip.smartPlacementLists.s = [ 's', 'n', 'ne', 'se' ]; diff --git a/examples.html b/examples.html index c4294f7..fa4017d 100644 --- a/examples.html +++ b/examples.html @@ -3,15 +3,12 @@ - + RF24Gateway - TCP/IP over RF24Network: Examples - - - @@ -26,7 +23,7 @@ -
RF24Gateway - TCP/IP over RF24Network v2.0.0 +
RF24Gateway - TCP/IP over RF24Network v1.1.0
TMRh20 - Pushing the practical limits of RF24 modules
@@ -35,7 +32,7 @@
- + @@ -90,7 +87,7 @@ diff --git a/favicon.ico b/favicon.ico deleted file mode 100644 index c15a1650af557d6ec815ebd7c0b5dbf5cc080676..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4286 zcmc(iTT@%t8HTmbTLO|^B{RuQF8dF1+sS`u|3GnV5NCurSYW$$;sBD+2}$S-;$VR> z*!ajn#&(=Z-R9)9?o6jMz3hMR?3p+3S{oE}NPB1FS+=ab*Lv3Xt?zxmg~y}t&nKUF z#NVEqzwvlJ@OV7G<=|JI-*JfVf9*%_oqePG=NxOG=-7*E4&Qs5*y0{Sc65_ zxlNG&Hiskmy>qbo^6(~C-zHnIT>f|pwm%O$@s9XCv#@)!u;VN5EPkUm0$=F}T^rw^ ztNIsoZoNdu_Fv(<{|df4-@&){J-iQofcMdlu=iiVKKcpP@jqZae+~1+KVf~%!O!A5 z@ytGW<-WVeIh-rj=-By|YyM5H-Bo=lSZ@9qKkEQ`ZwR`70s5r^^noa}p%}E`IJD6O zw6P@AiyYU=P^VH*gJ~!;87Nmct}Q{ip5@57|DQ?A=kmRYMLACka1F7}bP?KMOs=o@ zM;+=_PX@TIokOW%Sw zvkmXkHtg(e>T(BmVHb9B7gqTWtd+a4Dtj>3?!nyPsNRRU^}rqC^G%NRd$3mdPLc15 zIVH{)Yvj3B?l#xv$ZR{pdzb@w&o9CE4(d;vNQ)ehpM^JGdF%DB`R85!g*N;TKZNI_ zkN)@g_+xlfwQ=A7Z_ep+`j6H(?=T0jdvXo&E1!Of_iO*6MqZ+mTItxL79YQcZ@#%bpF{=GSp2O#yGWf zeG{tOLlpYlohJS?w5=EPfkpDk{E|AIt3r$3fp%q?{20{HD6H_~6Mo3iE-t$Lr-}bw z_9^`+Og~tHcc%tBwGK0}0c-s(%=n&MOaF2gdh~4kA#YnIhK68uM8{R#LpfxpY+Dh z+wj+(F@EwlUo`T=cxif5P|rOD%lw68WPs7}svM z#ILWCe}(+DC$0R%BbT2zkms)sh9%z|DuMT}Mt+*}d&2PcH1W@M!^>yd2>DmHTlp(b zpNB>59b*6g9nA0mG+#9l*2tQ|iD?}cJx{DPl4;a_gUFCRu zWD*AX+T^sOlFuB#94*WGKE3~)p1*M+1mAh`WBGb+RPud`HTppm=FF{@_>JNd>Ym!; zeWJPkv<&NSiu}xx8~-r*!K~D_&{qSWXDs=DDzx&GNAxA~gVa`2{Tq4mZ?IPv4qN%z z1E`l4VPtDAe2Ja_E zj$T0jQ)jY{Ivjy#wjQqg`n3Lou8uf21kx#$XmfG-(hw^NU!U=zr z@sE%{u|obvL;kyj|I&Ya=jaX1@kdYi4MCCGTBh4PRd*G;oA7EbCm-WjP*UV5e){wX-s{!`du_%ma8@`Btwsg{)*Btd)N$i0=nYm#ds>5Oa%ew~qyEe{! z_VI2q%(F?A>v2dH{UK;m8F@bt9!f8B=ZhX6Ab+6^zarvKLJ7v9d{JLbCpQx%!9SJ6*+RygSpod4H6581`|My-fOPFvIm? ij#+u`=)qupp7^Zoy>yf-DMy)(JIbZl8`j1<{rMRY83?oh diff --git a/folderclosed.png b/folderclosed.png new file mode 100644 index 0000000000000000000000000000000000000000..bb8ab35edce8e97554e360005ee9fc5bffb36e66 GIT binary patch literal 616 zcmV-u0+;=XP)a9#ETzayK)T~Jw&MMH>OIr#&;dC}is*2Mqdf&akCc=O@`qC+4i z5Iu3w#1M@KqXCz8TIZd1wli&kkl2HVcAiZ8PUn5z_kG@-y;?yK06=cA0U%H0PH+kU zl6dp}OR(|r8-RG+YLu`zbI}5TlOU6ToR41{9=uz^?dGTNL;wIMf|V3`d1Wj3y!#6` zBLZ?xpKR~^2x}?~zA(_NUu3IaDB$tKma*XUdOZN~c=dLt_h_k!dbxm_*ibDM zlFX`g{k$X}yIe%$N)cn1LNu=q9_CS)*>A zsX_mM4L@`(cSNQKMFc$RtYbx{79#j-J7hk*>*+ZZhM4Hw?I?rsXCi#mRWJ=-0LGV5a-WR0Qgt<|Nqf)C-@80`5gIz45^_20000 - - - - - - - - - diff --git a/folderclosedd.svg b/folderclosedd.svg deleted file mode 100644 index 52f0166..0000000 --- a/folderclosedd.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - diff --git a/folderopen.png b/folderopen.png new file mode 100644 index 0000000000000000000000000000000000000000..d6c7f676a3b3ef8c2c307d319dff3c6a604eb227 GIT binary patch literal 597 zcmV-b0;>IqP)X=#(TiCT&PiIIVc55T}TU}EUh*{q$|`3@{d>{Tc9Bo>e= zfmF3!f>fbI9#GoEHh0f`i5)wkLpva0ztf%HpZneK?w-7AK@b4Itw{y|Zd3k!fH?q2 zlhckHd_V2M_X7+)U&_Xcfvtw60l;--DgZmLSw-Y?S>)zIqMyJ1#FwLU*%bl38ok+! zh78H87n`ZTS;uhzAR$M`zZ`bVhq=+%u9^$5jDplgxd44}9;IRqUH1YHH|@6oFe%z( zo4)_>E$F&^P-f(#)>(TrnbE>Pefs9~@iN=|)Rz|V`sGfHNrJ)0gJb8xx+SBmRf@1l zvuzt=vGfI)<-F9!o&3l?>9~0QbUDT(wFdnQPv%xdD)m*g%!20>Bc9iYmGAp<9YAa( z0QgYgTWqf1qN++Gqp z8@AYPTB3E|6s=WLG?xw0tm|U!o=&zd+H0oRYE;Dbx+Na9s^STqX|Gnq%H8s(nGDGJ j8vwW|`Ts`)fSK|Kx=IK@RG@g200000NkvXXu0mjfauFEA literal 0 HcmV?d00001 diff --git a/folderopen.svg b/folderopen.svg deleted file mode 100644 index f6896dd..0000000 --- a/folderopen.svg +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - diff --git a/folderopend.svg b/folderopend.svg deleted file mode 100644 index 2d1f06e..0000000 --- a/folderopend.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - diff --git a/functions.html b/functions.html index 7c76291..f5a05fc 100644 --- a/functions.html +++ b/functions.html @@ -3,15 +3,12 @@ - + RF24Gateway - TCP/IP over RF24Network: Class Members - - - @@ -26,7 +23,7 @@ -
RF24Gateway - TCP/IP over RF24Network v2.0.0 +
RF24Gateway - TCP/IP over RF24Network v1.1.0
TMRh20 - Pushing the practical limits of RF24 modules
@@ -35,7 +32,7 @@
- + @@ -76,29 +73,29 @@
Here is a list of all class members with links to the classes they belong to:
diff --git a/functions_func.html b/functions_func.html index d0cbd85..7e4b5d7 100644 --- a/functions_func.html +++ b/functions_func.html @@ -3,15 +3,12 @@ - + RF24Gateway - TCP/IP over RF24Network: Class Members - Functions - - - @@ -26,7 +23,7 @@ -
RF24Gateway - TCP/IP over RF24Network v2.0.0 +
RF24Gateway - TCP/IP over RF24Network v1.1.0
TMRh20 - Pushing the practical limits of RF24 modules
@@ -35,7 +32,7 @@
- + @@ -75,21 +72,21 @@
-
Here is a list of all functions with links to the classes they belong to:
diff --git a/functions_vars.html b/functions_vars.html index 513d09f..46ec10d 100644 --- a/functions_vars.html +++ b/functions_vars.html @@ -3,15 +3,12 @@ - + RF24Gateway - TCP/IP over RF24Network: Class Members - Variables - - - @@ -26,7 +23,7 @@ -
RF24Gateway - TCP/IP over RF24Network v2.0.0 +
RF24Gateway - TCP/IP over RF24Network v1.1.0
TMRh20 - Pushing the practical limits of RF24 modules
@@ -35,7 +32,7 @@
- + @@ -75,21 +72,21 @@
-
Here is a list of all variables with links to the classes they belong to:
diff --git a/index.html b/index.html index ae8e1b8..198ea36 100644 --- a/index.html +++ b/index.html @@ -3,15 +3,12 @@ - + RF24Gateway - TCP/IP over RF24Network: RF24Gateway - - - @@ -26,7 +23,7 @@ -
RF24Gateway - TCP/IP over RF24Network v2.0.0 +
RF24Gateway - TCP/IP over RF24Network v1.1.0
TMRh20 - Pushing the practical limits of RF24 modules
@@ -35,7 +32,7 @@
- + @@ -75,66 +72,39 @@
-
RF24Gateway
+
-

-

RF24Gateway is a library style replacement for the standalone RF24toTUN application, used with RF24Ethernet.

-

In addition to passing TCP/IP payloads to a network interface, RF24Gateway also allows users to send and receive standard RF24Network payloads.

+

+

RF24Gateway is a library style replacement for the standalone RF24toTUN application, used with RF24Ethernet.

+

In addition to passing TCP/IP payloads to a network interface, RF24Gateway also allows users to send and receive standard RF24Network payloads.

This allows users to deploy and manage hybrid networks, consisting of nodes communicating via TCP/IP and RF24Network Messages

-News - 2023 API Changes

-

Introducing RF24Network, RF24Mesh & RF24Gateway v2.0 with some significant API changes, adding the use of C++ Templates in order to support a range of ESB enabled radios, most recently NRF52x radios.

-

Important Notes:

    -
  • Any network layer that uses v2 needs to have RF24Network/RF24Mesh dependencies of v2 or newer. RF24 v1.x is an exception here.
  • -
  • General usage should remain backward compatible, see the included examples of the related libraries for more info
  • -
  • Any third party libs that extend the network/mesh layer may also need to be updated to incorporate the new templated class prototypes:
    template<class radio_t>
    -
    class ESBNetwork;
    -
    -
    template<class network_t, class radio_t>
    -
    class ESBMesh;
    - - -
  • -
  • Third party libs should also be able to use the backward-compatible typedef in their template: -
  • -
  • The auto installers do not perform a version check like package managers, so having the correct versions of the software is important.
  • -
  • We will be maintaining the v1.x versions with bugfixes etc for those who cannot or do not wish to migrate to the newer template approach.
  • -
-

Installation

See http://nRF24.github.io/RF24 for installation instructions using the installer, or clone the RF24 libs and run 'make install' for each one.

-

After running the installer, RF24Gateway will be installed at rf24libs/RF24Gateway. Examples are included for operating the gateway as well as client scripts & programs to control nodes via http requests.

-

Note: RF24Gateway is tested with and defaults to using RF24Mesh. Sensor nodes must also use RF24Mesh or be statically assigned within RF24Mesh.

-

See http://nRF24.github.io/RF24Ethernet/ for related documentation for use with RF24Gateway.

-

+

After running the installer, RF24Gateway will be installed at rf24libs/RF24Gateway. Examples are included for operating the gateway as well as client scripts & programs to control nodes via http requests.

+

Note: RF24Gateway is tested with and defaults to using RF24Mesh. Sensor nodes must also use RF24Mesh or be statically assigned within RF24Mesh.

+

See http://nRF24.github.io/RF24Ethernet/ for related documentation for use with RF24Gateway.

+

How It Works

-

RF24Gateway is relatively simple in design, and uses the Universal TUN/TAP driver for Linux

+

RF24Gateway is relatively simple in design, and uses the Universal TUN/TAP driver for Linux

Data incoming from the RF24 communication stack (designated as external data) is passed to the interface without modification. Conversely, incoming TCP/IP or other data received on the TUN/TAP interface is passed directly into the radio network and designated as external data.

-

Linux devices running RF24Gateway can establish network links using the built-in TCP/IP stack, and users can include Arduino/AVR devices or additional RPi devices to automatically extend the wireless range.

+

Linux devices running RF24Gateway can establish network links using the built-in TCP/IP stack, and users can include Arduino/AVR devices or additional RPi devices to automatically extend the wireless range.

Arduino/AVR devices, etc must utilize a software IP stack such as uIP.

-

+

Simple Configuration

In the standard configuration, a single Linux/RF24Gateway node is used to provide connectivity to one or more Arduino nodes running RF24Ethernet. In this case the master node could be configured with IP 10.1.3.1 netmask 255.255.255.0 and nodeID 0 The remaining Arduino nodes can used nodeIDs 2-253, and would be assigned IP addresses 10.1.3.2-253 and netmask 255.255.255.0

If there are problems starting the examples, the following commands can be run to configure the interface:

@@ -144,9 +114,9 @@

sudo sysctl -w net.ipv4.ip_forward=1
sudo iptables -t nat -A POSTROUTING -j MASQUERADE

See http://nRF24.github.io/RF24Ethernet/ConfigAndSetup.html for more info

-

+

Advanced Configuration

-

In a more advanced configuration, users can use two or more nodes running RF24Gateway together, along with Arduino Nodes running RF24Ethernet In this case the master node could be configured differently with IP 10.1.3.1 netmask 255.255.0.0 and nodeID 0 The child RPi2 node could be assigned IP 10.1.3.33 netmask 255.255.0.0 and nodeID 33 Another device, lets say usb0 connected to the child RPi2 node is assigned IP 10.1.5.1 netmask 255.255.255.0

+

In a more advanced configuration, users can use two or more nodes running RF24Gateway together, along with Arduino Nodes running RF24Ethernet In this case the master node could be configured differently with IP 10.1.3.1 netmask 255.255.0.0 and nodeID 0 The child RPi2 node could be assigned IP 10.1.3.33 netmask 255.255.0.0 and nodeID 33 Another device, lets say usb0 connected to the child RPi2 node is assigned IP 10.1.5.1 netmask 255.255.255.0

In this configuration, connectivity between all nodes in the mesh would be established, but a routing table is needed to include attached and internet devices.

To fully enable routing beyond the RPi devices, a routing table needs to be added to the Master node:

    @@ -154,17 +124,17 @@

  1. Edit the file accordingly
  2. Restart the gateway example to reload routing info
-

+

Network Configuration Example

Local WiFi/Ethernet Network (Windows,Linux,RPi devices etc) - 10.10.1.0 - 255.255.255.0 ( 10.10.1.x network )
RPi devices (tun_nrf24 interfaces & all connected devices) - 10.1.0.0 - 255.255.0.0 ( 10.1.x.x network )

-

+

Explanation

-

The RF24Gateway/RF24Mesh network supports about 253 hosts. I setup the RF24Gateway and all associated devices with a much larger subnet in this config to encompass all devices directly accessible via the RF24Gateway network.

+

The RF24Gateway/RF24Mesh network supports about 253 hosts. I setup the RF24Gateway and all associated devices with a much larger subnet in this config to encompass all devices directly accessible via the RF24Gateway network.

ie: RPi master 10.1.3.1/16, RPi2 child 10.1.3.33/16, RPi2 child usb0 10.1.5.1/24

-

+

Routing Configuration

-

In the RF24Gateway example working directory, create a file "routing.txt". Add routing entries in a standard kind of format:

+

In the RF24Gateway example working directory, create a file "routing.txt". Add routing entries in a standard kind of format:

IP<space>NetMask<space>Gateway

Example routing.txt file:

    @@ -174,11 +144,11 @@

  • Traffic for 10.1.4.x will use 10.1.3.34 as the gateway

    10.1.4.0 255.255.255.0 10.1.3.34
  • -
  • Traffic not in the RF24Gateway network will be sent via 10.10.3.33 by default

    +
  • Traffic not in the RF24Gateway network will be sent via 10.10.3.33 by default

    0.0.0.0 0.0.0.0 10.10.3.33
-

+

Additional Routing Configuration

You can specify any combination of IP/Netmask in the routing.txt file to create unique subnets for routing traffic.

Examples are:

@@ -192,16 +162,15 @@

  • Traffic for 10.1.5.(65-94) will use 10.1.3.35 as the gateway

    10.1.5.64 255.255.255.224 10.1.3.35
  • -
  • Traffic not in the RF24Gateway network will be sent via 10.10.3.32 by default

    +
  • Traffic not in the RF24Gateway network will be sent via 10.10.3.32 by default

    0.0.0.0 0.0.0.0 10.10.3.32
  • -
    diff --git a/md_CONTRIBUTING.html b/md_CONTRIBUTING.html index 1a88e26..ab9f79f 100644 --- a/md_CONTRIBUTING.html +++ b/md_CONTRIBUTING.html @@ -3,15 +3,12 @@ - + RF24Gateway - TCP/IP over RF24Network: CONTRIBUTING - - - @@ -26,7 +23,7 @@ -
    RF24Gateway - TCP/IP over RF24Network v2.0.0 +
    RF24Gateway - TCP/IP over RF24Network v1.1.0
    TMRh20 - Pushing the practical limits of RF24 modules
    @@ -35,7 +32,7 @@
    - + @@ -75,10 +72,10 @@
    -
    CONTRIBUTING
    +
    CONTRIBUTING
    -

    These are the current requirements for getting your code included in RF24Gateway:

    +

    These are the current requirements for getting your code included in RF24Gateway:

    diff --git a/menu.js b/menu.js index 717761d..b0b2693 100644 --- a/menu.js +++ b/menu.js @@ -24,12 +24,13 @@ */ function initMenu(relPath,searchEnabled,serverSide,searchPage,search) { function makeTree(data,relPath) { - let result=''; + var result=''; if ('children' in data) { result+='
      '; - for (let i in data.children) { - let url; - const link = data.children[i].url; + for (var i in data.children) { + var url; + var link; + link = data.children[i].url; if (link.substring(0,1)=='^') { url = link.substring(1); } else { @@ -43,7 +44,7 @@ function initMenu(relPath,searchEnabled,serverSide,searchPage,search) { } return result; } - let searchBoxHtml; + var searchBoxHtml; if (searchEnabled) { if (serverSide) { searchBoxHtml='
      '+ @@ -87,28 +88,29 @@ function initMenu(relPath,searchEnabled,serverSide,searchPage,search) { if (searchBoxHtml) { $('#main-menu').append('
    • '); } - const $mainMenuState = $('#main-menu-state'); - let prevWidth = 0; + var $mainMenuState = $('#main-menu-state'); + var prevWidth = 0; if ($mainMenuState.length) { - const initResizableIfExists = function() { + function initResizableIfExists() { if (typeof initResizable==='function') initResizable(); } // animate mobile menu - $mainMenuState.change(function() { - const $menu = $('#main-menu'); - let options = { duration: 250, step: initResizableIfExists }; + $mainMenuState.change(function(e) { + var $menu = $('#main-menu'); + var options = { duration: 250, step: initResizableIfExists }; if (this.checked) { - options['complete'] = () => $menu.css('display', 'block'); + options['complete'] = function() { $menu.css('display', 'block') }; $menu.hide().slideDown(options); } else { - options['complete'] = () => $menu.css('display', 'none'); + options['complete'] = function() { $menu.css('display', 'none') }; $menu.show().slideUp(options); } }); // set default menu visibility - const resetState = function() { - const $menu = $('#main-menu'); - const newWidth = $(window).outerWidth(); + function resetState() { + var $menu = $('#main-menu'); + var $mainMenuState = $('#main-menu-state'); + var newWidth = $(window).outerWidth(); if (newWidth!=prevWidth) { if ($(window).outerWidth()<768) { $mainMenuState.prop('checked',false); $menu.hide(); diff --git a/minus.svg b/minus.svg deleted file mode 100644 index f70d0c1..0000000 --- a/minus.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/minusd.svg b/minusd.svg deleted file mode 100644 index 5f8e879..0000000 --- a/minusd.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/nodeClient_8js-example.html b/nodeClient_8js-example.html index 4769aa6..151d156 100644 --- a/nodeClient_8js-example.html +++ b/nodeClient_8js-example.html @@ -3,15 +3,12 @@ - + RF24Gateway - TCP/IP over RF24Network: nodeClient.js - - - @@ -26,7 +23,7 @@ -
      RF24Gateway - TCP/IP over RF24Network v2.0.0 +
      RF24Gateway - TCP/IP over RF24Network v1.1.0
      TMRh20 - Pushing the practical limits of RF24 modules
      @@ -35,7 +32,7 @@
      - + @@ -78,7 +75,7 @@
      nodeClient.js
      -

      Once RF24Gateway and RF24Ethernet are configured, standard tools can be used to interact with the sensor nodes.
      +

      Once RF24Gateway and RF24Ethernet are configured, standard tools can be used to interact with the sensor nodes.
      Example of on demand LED/Lighting control using a NodeJS script.

      var request = require('request')
      var url = 'http://10.10.2.4:1000/ON' // input your url here /ON to turn on and /OFF to turn off
      @@ -101,7 +98,7 @@
      diff --git a/pages.html b/pages.html index 5448243..dfb8fae 100644 --- a/pages.html +++ b/pages.html @@ -3,15 +3,12 @@ - + RF24Gateway - TCP/IP over RF24Network: Related Pages - - - @@ -26,7 +23,7 @@ -
      RF24Gateway - TCP/IP over RF24Network v2.0.0 +
      RF24Gateway - TCP/IP over RF24Network v1.1.0
      TMRh20 - Pushing the practical limits of RF24 modules
      @@ -35,7 +32,7 @@
      - + @@ -86,7 +83,7 @@
    diff --git a/plus.svg b/plus.svg deleted file mode 100644 index 0752016..0000000 --- a/plus.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/plusd.svg b/plusd.svg deleted file mode 100644 index 0c65bfe..0000000 --- a/plusd.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/pyClient_8py-example.html b/pyClient_8py-example.html index d42210f..2e946dd 100644 --- a/pyClient_8py-example.html +++ b/pyClient_8py-example.html @@ -3,15 +3,12 @@ - + RF24Gateway - TCP/IP over RF24Network: pyClient.py - - - @@ -26,7 +23,7 @@ -
    RF24Gateway - TCP/IP over RF24Network v2.0.0 +
    RF24Gateway - TCP/IP over RF24Network v1.1.0
    TMRh20 - Pushing the practical limits of RF24 modules
    @@ -35,7 +32,7 @@
    - + @@ -78,7 +75,7 @@
    pyClient.py
    -

    Once RF24Gateway and RF24Ethernet are configured, standard tools can be used to interact with the sensor nodes.
    +

    Once RF24Gateway and RF24Ethernet are configured, standard tools can be used to interact with the sensor nodes.
    Example of scheduled LED/Lighting control using a Python script.

    1#!/usr/bin/env python
    2"""
    @@ -157,7 +154,7 @@
    diff --git a/search/all_0.js b/search/all_0.js index b948451..452bf20 100644 --- a/search/all_0.js +++ b/search/all_0.js @@ -1,4 +1,4 @@ var searchData= [ - ['2023_20api_20changes_0',['News - 2023 API Changes',['../index.html#autotoc_md1',1,'']]] + ['begin_0',['begin',['../classRF24Gateway.html#a9005d67e041ab3352cdd57ac358b6024',1,'RF24Gateway::begin(uint8_t nodeID=0, uint8_t channel=97, rf24_datarate_e data_rate=RF24_1MBPS)'],['../classRF24Gateway.html#a409e9363e3ed47bc111fa36eeb3ef67b',1,'RF24Gateway::begin(uint16_t address, uint8_t channel=97, rf24_datarate_e data_rate=RF24_1MBPS, bool meshEnable=0, uint8_t nodeID=0)']]] ]; diff --git a/search/all_1.js b/search/all_1.js index 8fcf341..472e3ad 100644 --- a/search/all_1.js +++ b/search/all_1.js @@ -1,6 +1,5 @@ var searchData= [ - ['additional_20routing_20configuration_0',['Additional Routing Configuration',['../index.html#autotoc_md9',1,'']]], - ['advanced_20configuration_1',['Advanced Configuration',['../index.html#autotoc_md5',1,'']]], - ['api_20changes_2',['News - 2023 API Changes',['../index.html#autotoc_md1',1,'']]] + ['config_5ftun_0',['config_TUN',['../classRF24Gateway.html#ab5845650441bbb0e6dc6d46581a8defd',1,'RF24Gateway']]], + ['contributing_1',['CONTRIBUTING',['../md_CONTRIBUTING.html',1,'']]] ]; diff --git a/search/all_10.js b/search/all_10.js deleted file mode 100644 index 4ce7175..0000000 --- a/search/all_10.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['works_0',['How It Works',['../index.html#autotoc_md3',1,'']]] -]; diff --git a/search/all_2.js b/search/all_2.js index 6f552a6..c2f96f6 100644 --- a/search/all_2.js +++ b/search/all_2.js @@ -1,4 +1,4 @@ var searchData= [ - ['begin_0',['begin',['../classESBGateway.html#a63aa12d91a100713af306be07a091736',1,'ESBGateway::begin(uint8_t nodeID=0, uint8_t channel=97, rf24_datarate_e data_rate=RF24_1MBPS)'],['../classESBGateway.html#a86d7e067cda97af1a810a42269c2e231',1,'ESBGateway::begin(uint16_t address, uint8_t channel=97, rf24_datarate_e data_rate=RF24_1MBPS, bool meshEnable=0, uint8_t nodeID=0)']]] + ['fifocleared_0',['fifoCleared',['../classRF24Gateway.html#ab1c6dca6e041f4b53d505be6ceedee76',1,'RF24Gateway']]] ]; diff --git a/search/all_3.js b/search/all_3.js index dbc9d8b..39622d0 100644 --- a/search/all_3.js +++ b/search/all_3.js @@ -1,8 +1,4 @@ var searchData= [ - ['changes_0',['News - 2023 API Changes',['../index.html#autotoc_md1',1,'']]], - ['config_5ftun_1',['config_TUN',['../classESBGateway.html#a0530f6b4fa80e1bb4632326e15dd8113',1,'ESBGateway']]], - ['configuration_2',['Configuration',['../index.html#autotoc_md9',1,'Additional Routing Configuration'],['../index.html#autotoc_md5',1,'Advanced Configuration'],['../index.html#autotoc_md8',1,'Routing Configuration'],['../index.html#autotoc_md4',1,'Simple Configuration']]], - ['configuration_20example_3',['Network Configuration Example',['../index.html#autotoc_md6',1,'']]], - ['contributing_4',['CONTRIBUTING',['../md_CONTRIBUTING.html',1,'']]] + ['gw_0',['gw',['../structRF24Gateway_1_1routeStruct.html#ab026ce6c7ca06f9d299065b5ca36b245',1,'RF24Gateway::routeStruct']]] ]; diff --git a/search/all_4.js b/search/all_4.js index 87d10dd..f0add3e 100644 --- a/search/all_4.js +++ b/search/all_4.js @@ -1,10 +1,6 @@ var searchData= [ - ['esbgateway_0',['ESBGateway',['../classESBGateway.html',1,'ESBGateway< mesh_t, network_t, radio_t >'],['../classESBGateway.html#a32e99edaeaad744ac078c89667fea97e',1,'ESBGateway::ESBGateway()']]], - ['esbmesh_1',['ESBMesh',['../classESBMesh.html',1,'']]], - ['esbmesh_3c_20esbnetwork_3c_20rf24_20_3e_2c_20rf24_20_3e_2',['ESBMesh< ESBNetwork< RF24 >, RF24 >',['../classESBMesh.html',1,'']]], - ['esbnetwork_3',['ESBNetwork',['../classESBNetwork.html',1,'']]], - ['esbnetwork_3c_20rf24_20_3e_4',['ESBNetwork< RF24 >',['../classESBNetwork.html',1,'']]], - ['example_5',['Network Configuration Example',['../index.html#autotoc_md6',1,'']]], - ['explanation_6',['Explanation',['../index.html#autotoc_md7',1,'']]] + ['ifdropped_0',['ifDropped',['../classRF24Gateway.html#a8b4479e126d180037f71f77f9aaf40c0',1,'RF24Gateway']]], + ['interrupts_1',['interrupts',['../classRF24Gateway.html#a318c35eb1ecce02e12062822e714d38c',1,'RF24Gateway']]], + ['ip_2',['ip',['../structRF24Gateway_1_1routeStruct.html#acc7b96511f6e94f2afef69a4c63679e0',1,'RF24Gateway::routeStruct']]] ]; diff --git a/search/all_5.js b/search/all_5.js index 01f6c50..e789459 100644 --- a/search/all_5.js +++ b/search/all_5.js @@ -1,4 +1,5 @@ var searchData= [ - ['fifocleared_0',['fifoCleared',['../classESBGateway.html#adfee55530c62d956bbe655909b57c6e5',1,'ESBGateway']]] + ['mask_0',['mask',['../structRF24Gateway_1_1routeStruct.html#a7742cff2aabb92931ee8828cbee2d68c',1,'RF24Gateway::routeStruct']]], + ['meshenabled_1',['meshEnabled',['../classRF24Gateway.html#a7dad81701804d1fb5cd55d0370d1a2df',1,'RF24Gateway']]] ]; diff --git a/search/all_6.js b/search/all_6.js index 3f03e23..d839120 100644 --- a/search/all_6.js +++ b/search/all_6.js @@ -1,4 +1,4 @@ var searchData= [ - ['gw_0',['gw',['../structESBGateway_1_1routeStruct.html#aa46d4e51c8c6d75066115b6614a25e34',1,'ESBGateway::routeStruct']]] + ['poll_0',['poll',['../classRF24Gateway.html#afd57521e1958f45b210888c9a957adb3',1,'RF24Gateway']]] ]; diff --git a/search/all_7.js b/search/all_7.js index cf7cdbc..9be0930 100644 --- a/search/all_7.js +++ b/search/all_7.js @@ -1,4 +1,7 @@ var searchData= [ - ['how_20it_20works_0',['How It Works',['../index.html#autotoc_md3',1,'']]] + ['rf24gateway_0',['RF24Gateway',['../index.html',1,'(Global Namespace)'],['../classRF24Gateway.html',1,'RF24Gateway'],['../classRF24Gateway.html#a939a9d63e37fb627847ebe70d4fb6043',1,'RF24Gateway::RF24Gateway(RF24 &_radio, RF24Network &_network, RF24Mesh &_mesh)']]], + ['routestruct_1',['routeStruct',['../structRF24Gateway_1_1routeStruct.html',1,'RF24Gateway']]], + ['routingstruct_2',['routingStruct',['../classRF24Gateway.html#aaac15d895072ec085e051ee9f4d60b48',1,'RF24Gateway']]], + ['routingtablesize_3',['routingTableSize',['../classRF24Gateway.html#a8f8bcb7aad7a40d882268cfb3d6a3090',1,'RF24Gateway']]] ]; diff --git a/search/all_8.js b/search/all_8.js index f15549e..19e3e74 100644 --- a/search/all_8.js +++ b/search/all_8.js @@ -1,8 +1,5 @@ var searchData= [ - ['ifdropped_0',['ifDropped',['../classESBGateway.html#a9a307c3c9e320944592a20d0587644bc',1,'ESBGateway']]], - ['installation_1',['Installation',['../index.html#autotoc_md2',1,'']]], - ['interrupts_2',['interrupts',['../classESBGateway.html#a30757aeb509a6eb1cbcb4dce84eae514',1,'ESBGateway']]], - ['ip_3',['ip',['../structESBGateway_1_1routeStruct.html#a55d3ef4a67bbe45aa3417c5fbae13cdb',1,'ESBGateway::routeStruct']]], - ['it_20works_4',['How It Works',['../index.html#autotoc_md3',1,'']]] + ['sendudp_0',['sendUDP',['../classRF24Gateway.html#a9128f60a993cc25b5abe89757b06350e',1,'RF24Gateway']]], + ['setip_1',['setIP',['../classRF24Gateway.html#a1dcb8921636e754ae4a7f21d59fcfb3e',1,'RF24Gateway']]] ]; diff --git a/search/all_9.js b/search/all_9.js index f91e603..86a69a9 100644 --- a/search/all_9.js +++ b/search/all_9.js @@ -1,5 +1,5 @@ var searchData= [ - ['mask_0',['mask',['../structESBGateway_1_1routeStruct.html#a77a1be906770ad3ceb94755d4601cf85',1,'ESBGateway::routeStruct']]], - ['meshenabled_1',['meshEnabled',['../classESBGateway.html#a0e89668c66169cc98d8398e54966f38e',1,'ESBGateway']]] + ['thisnodeaddress_0',['thisNodeAddress',['../classRF24Gateway.html#a1312aa864c8edbd44f7af75081e25caf',1,'RF24Gateway']]], + ['thisnodeid_1',['thisNodeID',['../classRF24Gateway.html#a33c259fdc8989208a39a2eeb5a1761de',1,'RF24Gateway']]] ]; diff --git a/search/all_a.js b/search/all_a.js index 271598c..2ac38cc 100644 --- a/search/all_a.js +++ b/search/all_a.js @@ -1,5 +1,4 @@ var searchData= [ - ['network_20configuration_20example_0',['Network Configuration Example',['../index.html#autotoc_md6',1,'']]], - ['news_202023_20api_20changes_1',['News - 2023 API Changes',['../index.html#autotoc_md1',1,'']]] + ['update_0',['update',['../classRF24Gateway.html#a91c25cc30c580baa4afac301fd9a0f00',1,'RF24Gateway']]] ]; diff --git a/search/all_b.js b/search/all_b.js deleted file mode 100644 index dc3a891..0000000 --- a/search/all_b.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['poll_0',['poll',['../classESBGateway.html#a3174228b62901c8575d8fb1905d4559e',1,'ESBGateway']]] -]; diff --git a/search/all_c.js b/search/all_c.js deleted file mode 100644 index c852bd2..0000000 --- a/search/all_c.js +++ /dev/null @@ -1,8 +0,0 @@ -var searchData= -[ - ['rf24gateway_0',['RF24Gateway',['../index.html',1,'']]], - ['routestruct_1',['routeStruct',['../structESBGateway_1_1routeStruct.html',1,'ESBGateway']]], - ['routing_20configuration_2',['Routing Configuration',['../index.html#autotoc_md9',1,'Additional Routing Configuration'],['../index.html#autotoc_md8',1,'Routing Configuration']]], - ['routingstruct_3',['routingStruct',['../classESBGateway.html#a1a3e6c55fcc931364823fd09106befbd',1,'ESBGateway']]], - ['routingtablesize_4',['routingTableSize',['../classESBGateway.html#ae48103de27d41f7d5187a7c32463fde7',1,'ESBGateway']]] -]; diff --git a/search/all_d.js b/search/all_d.js deleted file mode 100644 index 5c1ebbf..0000000 --- a/search/all_d.js +++ /dev/null @@ -1,6 +0,0 @@ -var searchData= -[ - ['sendudp_0',['sendUDP',['../classESBGateway.html#af1efe5211f53be4bade8c2e6be10d966',1,'ESBGateway']]], - ['setip_1',['setIP',['../classESBGateway.html#a16f0a977e0e77d894e555ace9999568d',1,'ESBGateway']]], - ['simple_20configuration_2',['Simple Configuration',['../index.html#autotoc_md4',1,'']]] -]; diff --git a/search/all_e.js b/search/all_e.js deleted file mode 100644 index f268585..0000000 --- a/search/all_e.js +++ /dev/null @@ -1,5 +0,0 @@ -var searchData= -[ - ['thisnodeaddress_0',['thisNodeAddress',['../classESBGateway.html#a0f17365f6cce8bd10f05b8113b9f2180',1,'ESBGateway']]], - ['thisnodeid_1',['thisNodeID',['../classESBGateway.html#aa12a1cbda71c18074fc519d0dda025bf',1,'ESBGateway']]] -]; diff --git a/search/all_f.js b/search/all_f.js deleted file mode 100644 index c0131d1..0000000 --- a/search/all_f.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['update_0',['update',['../classESBGateway.html#aaf1214fabf2485bcffb30f9460c2e2b2',1,'ESBGateway']]] -]; diff --git a/search/classes_0.js b/search/classes_0.js index 6c14710..0040c0c 100644 --- a/search/classes_0.js +++ b/search/classes_0.js @@ -1,8 +1,5 @@ var searchData= [ - ['esbgateway_0',['ESBGateway',['../classESBGateway.html',1,'']]], - ['esbmesh_1',['ESBMesh',['../classESBMesh.html',1,'']]], - ['esbmesh_3c_20esbnetwork_3c_20rf24_20_3e_2c_20rf24_20_3e_2',['ESBMesh< ESBNetwork< RF24 >, RF24 >',['../classESBMesh.html',1,'']]], - ['esbnetwork_3',['ESBNetwork',['../classESBNetwork.html',1,'']]], - ['esbnetwork_3c_20rf24_20_3e_4',['ESBNetwork< RF24 >',['../classESBNetwork.html',1,'']]] + ['rf24gateway_0',['RF24Gateway',['../classRF24Gateway.html',1,'']]], + ['routestruct_1',['routeStruct',['../structRF24Gateway_1_1routeStruct.html',1,'RF24Gateway']]] ]; diff --git a/search/classes_1.js b/search/classes_1.js deleted file mode 100644 index dde857f..0000000 --- a/search/classes_1.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['routestruct_0',['routeStruct',['../structESBGateway_1_1routeStruct.html',1,'ESBGateway']]] -]; diff --git a/search/close.svg b/search/close.svg index 337d6cc..a933eea 100644 --- a/search/close.svg +++ b/search/close.svg @@ -1,14 +1,27 @@ - + + + + image/svg+xml + + + + + - + + + + image/svg+xml + + + + + - + + + + image/svg+xml + + + + + - + + sodipodi:docname="mag_sel.svg" + inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)"> + + + + image/svg+xml + + + + + + + inkscape:connector-curvature="0" + sodipodi:nodetypes="cccc" /> + inkscape:connector-curvature="0" /> diff --git a/search/mag_seld.svg b/search/mag_seld.svg index c906f84..6e720dc 100644 --- a/search/mag_seld.svg +++ b/search/mag_seld.svg @@ -1,31 +1,74 @@ - + + sodipodi:docname="mag_sel.svg" + inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)"> + + + + image/svg+xml + + + + + + + inkscape:connector-curvature="0" + sodipodi:nodetypes="cccc" /> + inkscape:connector-curvature="0" /> diff --git a/search/search.js b/search/search.js index 666af01..e103a26 100644 --- a/search/search.js +++ b/search/search.js @@ -22,9 +22,58 @@ @licend The above is the entire license notice for the JavaScript code in this file */ -const SEARCH_COOKIE_NAME = ''+'search_grp'; +function convertToId(search) +{ + var result = ''; + for (i=0;i document.getElementById("MSearchField"); - this.DOMSearchSelect = () => document.getElementById("MSearchSelect"); - this.DOMSearchSelectWindow = () => document.getElementById("MSearchSelectWindow"); - this.DOMPopupSearchResults = () => document.getElementById("MSearchResults"); - this.DOMPopupSearchResultsWindow = () => document.getElementById("MSearchResultsWindow"); - this.DOMSearchClose = () => document.getElementById("MSearchClose"); - this.DOMSearchBox = () => document.getElementById("MSearchBox"); + this.DOMSearchField = function() + { return document.getElementById("MSearchField"); } + + this.DOMSearchSelect = function() + { return document.getElementById("MSearchSelect"); } + + this.DOMSearchSelectWindow = function() + { return document.getElementById("MSearchSelectWindow"); } + + this.DOMPopupSearchResults = function() + { return document.getElementById("MSearchResults"); } + + this.DOMPopupSearchResultsWindow = function() + { return document.getElementById("MSearchResultsWindow"); } + + this.DOMSearchClose = function() + { return document.getElementById("MSearchClose"); } + + this.DOMSearchBox = function() + { return document.getElementById("MSearchBox"); } // ------------ Event Handlers // Called when focus is added or removed from the search field. - this.OnSearchFieldFocus = function(isActive) { + this.OnSearchFieldFocus = function(isActive) + { this.Activate(isActive); } - this.OnSearchSelectShow = function() { - const searchSelectWindow = this.DOMSearchSelectWindow(); - const searchField = this.DOMSearchSelect(); + this.OnSearchSelectShow = function() + { + var searchSelectWindow = this.DOMSearchSelectWindow(); + var searchField = this.DOMSearchSelect(); - const left = getXPos(searchField); - const top = getYPos(searchField) + searchField.offsetHeight; + var left = getXPos(searchField); + var top = getYPos(searchField); + top += searchField.offsetHeight; // show search selection popup searchSelectWindow.style.display='block'; @@ -102,44 +146,55 @@ function SearchBox(name, resultsPath, extension) { searchSelectWindow.style.top = top + 'px'; // stop selection hide timer - if (this.hideTimeout) { + if (this.hideTimeout) + { clearTimeout(this.hideTimeout); this.hideTimeout=0; } return false; // to avoid "image drag" default event } - this.OnSearchSelectHide = function() { - this.hideTimeout = setTimeout(this.CloseSelectionWindow.bind(this), + this.OnSearchSelectHide = function() + { + this.hideTimeout = setTimeout(this.name +".CloseSelectionWindow()", this.closeSelectionTimeout); } // Called when the content of the search field is changed. - this.OnSearchFieldChange = function(evt) { - if (this.keyTimeout) { // kill running timer + this.OnSearchFieldChange = function(evt) + { + if (this.keyTimeout) // kill running timer + { clearTimeout(this.keyTimeout); this.keyTimeout = 0; } - const e = evt ? evt : window.event; // for IE - if (e.keyCode==40 || e.keyCode==13) { - if (e.shiftKey==1) { + var e = (evt) ? evt : window.event; // for IE + if (e.keyCode==40 || e.keyCode==13) + { + if (e.shiftKey==1) + { this.OnSearchSelectShow(); - const win=this.DOMSearchSelectWindow(); - for (let i=0;i do a search + var searchValue = this.DOMSearchField().value.replace(/ +/g, ""); + if (searchValue!="" && this.searchActive) // something was found -> do a search + { this.Search(); } } - this.OnSearchSelectKey = function(evt) { - const e = (evt) ? evt : window.event; // for IE - if (e.keyCode==40 && this.searchIndex0) { // Up + } + else if (e.keyCode==38 && this.searchIndex>0) // Up + { this.searchIndex--; this.OnSelectItem(this.searchIndex); - } else if (e.keyCode==13 || e.keyCode==27) { - e.stopPropagation(); + } + else if (e.keyCode==13 || e.keyCode==27) + { this.OnSelectItem(this.searchIndex); this.CloseSelectionWindow(); this.DOMSearchField().focus(); @@ -239,75 +299,78 @@ function SearchBox(name, resultsPath, extension) { // --------- Actions // Closes the results window. - this.CloseResultsWindow = function() { + this.CloseResultsWindow = function() + { this.DOMPopupSearchResultsWindow().style.display = 'none'; this.DOMSearchClose().style.display = 'none'; this.Activate(false); } - this.CloseSelectionWindow = function() { + this.CloseSelectionWindow = function() + { this.DOMSearchSelectWindow().style.display = 'none'; } // Performs a search. - this.Search = function() { + this.Search = function() + { this.keyTimeout = 0; // strip leading whitespace - const searchValue = this.DOMSearchField().value.replace(/^ +/, ""); + var searchValue = this.DOMSearchField().value.replace(/^ +/, ""); - const code = searchValue.toLowerCase().charCodeAt(0); - let idxChar = searchValue.substr(0, 1).toLowerCase(); - if ( 0xD800 <= code && code <= 0xDBFF && searchValue > 1) { // surrogate pair + var code = searchValue.toLowerCase().charCodeAt(0); + var idxChar = searchValue.substr(0, 1).toLowerCase(); + if ( 0xD800 <= code && code <= 0xDBFF && searchValue > 1) // surrogate pair + { idxChar = searchValue.substr(0, 2); } - let jsFile; - let idx = indexSectionsWithContent[this.searchIndex].indexOf(idxChar); - if (idx!=-1) { - const hexCode=idx.toString(16); - jsFile = this.resultsPath + indexSectionNames[this.searchIndex] + '_' + hexCode + '.js'; + var jsFile; + + var idx = indexSectionsWithContent[this.searchIndex].indexOf(idxChar); + if (idx!=-1) + { + var hexCode=idx.toString(16); + jsFile = this.resultsPath + indexSectionNames[this.searchIndex] + '_' + hexCode + '.js'; } - const loadJS = function(url, impl, loc) { - const scriptTag = document.createElement('script'); + var loadJS = function(url, impl, loc){ + var scriptTag = document.createElement('script'); scriptTag.src = url; scriptTag.onload = impl; scriptTag.onreadystatechange = impl; loc.appendChild(scriptTag); } - const domPopupSearchResultsWindow = this.DOMPopupSearchResultsWindow(); - const domSearchBox = this.DOMSearchBox(); - const domPopupSearchResults = this.DOMPopupSearchResults(); - const domSearchClose = this.DOMSearchClose(); - const resultsPath = this.resultsPath; + var domPopupSearchResultsWindow = this.DOMPopupSearchResultsWindow(); + var domSearchBox = this.DOMSearchBox(); + var domPopupSearchResults = this.DOMPopupSearchResults(); + var domSearchClose = this.DOMSearchClose(); + var resultsPath = this.resultsPath; - const handleResults = function() { + var handleResults = function() { document.getElementById("Loading").style.display="none"; if (typeof searchData !== 'undefined') { createResults(resultsPath); document.getElementById("NoMatches").style.display="none"; } + + searchResults.Search(searchValue); - if (idx!=-1) { - searchResults.Search(searchValue); - } else { // no file with search results => force empty search results - searchResults.Search('===='); - } - - if (domPopupSearchResultsWindow.style.display!='block') { + if (domPopupSearchResultsWindow.style.display!='block') + { domSearchClose.style.display = 'inline-block'; - let left = getXPos(domSearchBox) + 150; - let top = getYPos(domSearchBox) + 20; + var left = getXPos(domSearchBox) + 150; + var top = getYPos(domSearchBox) + 20; domPopupSearchResultsWindow.style.display = 'block'; left -= domPopupSearchResults.offsetWidth; - const maxWidth = document.body.clientWidth; - const maxHeight = document.body.clientHeight; - let width = 300; + var maxWidth = document.body.clientWidth; + var maxHeight = document.body.clientHeight; + var width = 300; if (left<10) left=10; if (width+left+8>maxWidth) width=maxWidth-left-8; - let height = 400; + var height = 400; if (height+top+8>maxHeight) height=maxHeight-top-8; domPopupSearchResultsWindow.style.top = top + 'px'; domPopupSearchResultsWindow.style.left = left + 'px'; @@ -329,13 +392,17 @@ function SearchBox(name, resultsPath, extension) { // Activates or deactivates the search panel, resetting things to // their default values if necessary. - this.Activate = function(isActive) { + this.Activate = function(isActive) + { if (isActive || // open it - this.DOMPopupSearchResultsWindow().style.display == 'block' - ) { + this.DOMPopupSearchResultsWindow().style.display == 'block' + ) + { this.DOMSearchBox().className = 'MSearchBoxActive'; this.searchActive = true; - } else if (!isActive) { // directly remove the panel + } + else if (!isActive) // directly remove the panel + { this.DOMSearchBox().className = 'MSearchBoxInactive'; this.searchActive = false; this.lastSearchValue = '' @@ -348,347 +415,402 @@ function SearchBox(name, resultsPath, extension) { // ----------------------------------------------------------------------- // The class that handles everything on the search results page. -function SearchResults() { - - function convertToId(search) { - let result = ''; - for (let i=0;i. - this.lastMatchCount = 0; - this.lastKey = 0; - this.repeatOn = false; +function SearchResults(name) +{ + // The number of matches from the last run of . + this.lastMatchCount = 0; + this.lastKey = 0; + this.repeatOn = false; + + // Toggles the visibility of the passed element ID. + this.FindChildElement = function(id) + { + var parentElement = document.getElementById(id); + var element = parentElement.firstChild; + + while (element && element!=parentElement) + { + if (element.nodeName.toLowerCase() == 'div' && element.className == 'SRChildren') + { + return element; + } - // Toggles the visibility of the passed element ID. - this.FindChildElement = function(id) { - const parentElement = document.getElementById(id); - let element = parentElement.firstChild; + if (element.nodeName.toLowerCase() == 'div' && element.hasChildNodes()) + { + element = element.firstChild; + } + else if (element.nextSibling) + { + element = element.nextSibling; + } + else + { + do + { + element = element.parentNode; + } + while (element && element!=parentElement && !element.nextSibling); - while (element && element!=parentElement) { - if (element.nodeName.toLowerCase() == 'div' && element.className == 'SRChildren') { - return element; + if (element && element!=parentElement) + { + element = element.nextSibling; + } + } } + } - if (element.nodeName.toLowerCase() == 'div' && element.hasChildNodes()) { - element = element.firstChild; - } else if (element.nextSibling) { - element = element.nextSibling; - } else { - do { - element = element.parentNode; + this.Toggle = function(id) + { + var element = this.FindChildElement(id); + if (element) + { + if (element.style.display == 'block') + { + element.style.display = 'none'; } - while (element && element!=parentElement && !element.nextSibling); - - if (element && element!=parentElement) { - element = element.nextSibling; + else + { + element.style.display = 'block'; } } } - } - this.Toggle = function(id) { - const element = this.FindChildElement(id); - if (element) { - if (element.style.display == 'block') { - element.style.display = 'none'; - } else { - element.style.display = 'block'; + // Searches for the passed string. If there is no parameter, + // it takes it from the URL query. + // + // Always returns true, since other documents may try to call it + // and that may or may not be possible. + this.Search = function(search) + { + if (!search) // get search word from URL + { + search = window.location.search; + search = search.substring(1); // Remove the leading '?' + search = unescape(search); } - } - } - // Searches for the passed string. If there is no parameter, - // it takes it from the URL query. - // - // Always returns true, since other documents may try to call it - // and that may or may not be possible. - this.Search = function(search) { - if (!search) { // get search word from URL - search = window.location.search; - search = search.substring(1); // Remove the leading '?' - search = unescape(search); - } - - search = search.replace(/^ +/, ""); // strip leading spaces - search = search.replace(/ +$/, ""); // strip trailing spaces - search = search.toLowerCase(); - search = convertToId(search); - - const resultRows = document.getElementsByTagName("div"); - let matches = 0; - - let i = 0; - while (i < resultRows.length) { - const row = resultRows.item(i); - if (row.className == "SRResult") { - let rowMatchName = row.id.toLowerCase(); - rowMatchName = rowMatchName.replace(/^sr\d*_/, ''); // strip 'sr123_' - - if (search.length<=rowMatchName.length && - rowMatchName.substr(0, search.length)==search) { - row.style.display = 'block'; - matches++; - } else { - row.style.display = 'none'; + search = search.replace(/^ +/, ""); // strip leading spaces + search = search.replace(/ +$/, ""); // strip trailing spaces + search = search.toLowerCase(); + search = convertToId(search); + + var resultRows = document.getElementsByTagName("div"); + var matches = 0; + + var i = 0; + while (i < resultRows.length) + { + var row = resultRows.item(i); + if (row.className == "SRResult") + { + var rowMatchName = row.id.toLowerCase(); + rowMatchName = rowMatchName.replace(/^sr\d*_/, ''); // strip 'sr123_' + + if (search.length<=rowMatchName.length && + rowMatchName.substr(0, search.length)==search) + { + row.style.display = 'block'; + matches++; + } + else + { + row.style.display = 'none'; + } } + i++; } - i++; - } - document.getElementById("Searching").style.display='none'; - if (matches == 0) { // no results - document.getElementById("NoMatches").style.display='block'; - } else { // at least one result - document.getElementById("NoMatches").style.display='none'; + document.getElementById("Searching").style.display='none'; + if (matches == 0) // no results + { + document.getElementById("NoMatches").style.display='block'; + } + else // at least one result + { + document.getElementById("NoMatches").style.display='none'; + } + this.lastMatchCount = matches; + return true; } - this.lastMatchCount = matches; - return true; - } - // return the first item with index index or higher that is visible - this.NavNext = function(index) { - let focusItem; - for (;;) { - const focusName = 'Item'+index; - focusItem = document.getElementById(focusName); - if (focusItem && focusItem.parentNode.parentNode.style.display=='block') { - break; - } else if (!focusItem) { // last element - break; - } - focusItem=null; - index++; - } - return focusItem; - } + // return the first item with index index or higher that is visible + this.NavNext = function(index) + { + var focusItem; + while (1) + { + var focusName = 'Item'+index; + focusItem = document.getElementById(focusName); + if (focusItem && focusItem.parentNode.parentNode.style.display=='block') + { + break; + } + else if (!focusItem) // last element + { + break; + } + focusItem=null; + index++; + } + return focusItem; + } - this.NavPrev = function(index) { - let focusItem; - for (;;) { - const focusName = 'Item'+index; - focusItem = document.getElementById(focusName); - if (focusItem && focusItem.parentNode.parentNode.style.display=='block') { - break; - } else if (!focusItem) { // last element - break; + this.NavPrev = function(index) + { + var focusItem; + while (1) + { + var focusName = 'Item'+index; + focusItem = document.getElementById(focusName); + if (focusItem && focusItem.parentNode.parentNode.style.display=='block') + { + break; + } + else if (!focusItem) // last element + { + break; + } + focusItem=null; + index--; } - focusItem=null; - index--; + return focusItem; } - return focusItem; - } - this.ProcessKeys = function(e) { - if (e.type == "keydown") { - this.repeatOn = false; - this.lastKey = e.keyCode; - } else if (e.type == "keypress") { - if (!this.repeatOn) { - if (this.lastKey) this.repeatOn = true; - return false; // ignore first keypress after keydown + this.ProcessKeys = function(e) + { + if (e.type == "keydown") + { + this.repeatOn = false; + this.lastKey = e.keyCode; + } + else if (e.type == "keypress") + { + if (!this.repeatOn) + { + if (this.lastKey) this.repeatOn = true; + return false; // ignore first keypress after keydown + } } - } else if (e.type == "keyup") { - this.lastKey = 0; - this.repeatOn = false; + else if (e.type == "keyup") + { + this.lastKey = 0; + this.repeatOn = false; + } + return this.lastKey!=0; } - return this.lastKey!=0; - } - this.Nav = function(evt,itemIndex) { - const e = (evt) ? evt : window.event; // for IE - if (e.keyCode==13) return true; - if (!this.ProcessKeys(e)) return false; - - if (this.lastKey==38) { // Up - const newIndex = itemIndex-1; - let focusItem = this.NavPrev(newIndex); - if (focusItem) { - let child = this.FindChildElement(focusItem.parentNode.parentNode.id); - if (child && child.style.display == 'block') { // children visible - let n=0; - let tmpElem; - for (;;) { // search for last child - tmpElem = document.getElementById('Item'+newIndex+'_c'+n); - if (tmpElem) { - focusItem = tmpElem; - } else { // found it! - break; + this.Nav = function(evt,itemIndex) + { + var e = (evt) ? evt : window.event; // for IE + if (e.keyCode==13) return true; + if (!this.ProcessKeys(e)) return false; + + if (this.lastKey==38) // Up + { + var newIndex = itemIndex-1; + var focusItem = this.NavPrev(newIndex); + if (focusItem) + { + var child = this.FindChildElement(focusItem.parentNode.parentNode.id); + if (child && child.style.display == 'block') // children visible + { + var n=0; + var tmpElem; + while (1) // search for last child + { + tmpElem = document.getElementById('Item'+newIndex+'_c'+n); + if (tmpElem) + { + focusItem = tmpElem; + } + else // found it! + { + break; + } + n++; } - n++; } } + if (focusItem) + { + focusItem.focus(); + } + else // return focus to search field + { + document.getElementById("MSearchField").focus(); + } + } + else if (this.lastKey==40) // Down + { + var newIndex = itemIndex+1; + var focusItem; + var item = document.getElementById('Item'+itemIndex); + var elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem && elem.style.display == 'block') // children visible + { + focusItem = document.getElementById('Item'+itemIndex+'_c0'); + } + if (!focusItem) focusItem = this.NavNext(newIndex); + if (focusItem) focusItem.focus(); } - if (focusItem) { - focusItem.focus(); - } else { // return focus to search field + else if (this.lastKey==39) // Right + { + var item = document.getElementById('Item'+itemIndex); + var elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem) elem.style.display = 'block'; + } + else if (this.lastKey==37) // Left + { + var item = document.getElementById('Item'+itemIndex); + var elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem) elem.style.display = 'none'; + } + else if (this.lastKey==27) // Escape + { + searchBox.CloseResultsWindow(); document.getElementById("MSearchField").focus(); } - } else if (this.lastKey==40) { // Down - const newIndex = itemIndex+1; - let focusItem; - const item = document.getElementById('Item'+itemIndex); - const elem = this.FindChildElement(item.parentNode.parentNode.id); - if (elem && elem.style.display == 'block') { // children visible - focusItem = document.getElementById('Item'+itemIndex+'_c0'); - } - if (!focusItem) focusItem = this.NavNext(newIndex); - if (focusItem) focusItem.focus(); - } else if (this.lastKey==39) { // Right - const item = document.getElementById('Item'+itemIndex); - const elem = this.FindChildElement(item.parentNode.parentNode.id); - if (elem) elem.style.display = 'block'; - } else if (this.lastKey==37) { // Left - const item = document.getElementById('Item'+itemIndex); - const elem = this.FindChildElement(item.parentNode.parentNode.id); - if (elem) elem.style.display = 'none'; - } else if (this.lastKey==27) { // Escape - e.stopPropagation(); - searchBox.CloseResultsWindow(); - document.getElementById("MSearchField").focus(); - } else if (this.lastKey==13) { // Enter - return true; + else if (this.lastKey==13) // Enter + { + return true; + } + return false; } - return false; - } - this.NavChild = function(evt,itemIndex,childIndex) { - const e = (evt) ? evt : window.event; // for IE - if (e.keyCode==13) return true; - if (!this.ProcessKeys(e)) return false; - - if (this.lastKey==38) { // Up - if (childIndex>0) { - const newIndex = childIndex-1; - document.getElementById('Item'+itemIndex+'_c'+newIndex).focus(); - } else { // already at first child, jump to parent - document.getElementById('Item'+itemIndex).focus(); - } - } else if (this.lastKey==40) { // Down - const newIndex = childIndex+1; - let elem = document.getElementById('Item'+itemIndex+'_c'+newIndex); - if (!elem) { // last child, jump to parent next parent - elem = this.NavNext(itemIndex+1); - } - if (elem) { - elem.focus(); - } - } else if (this.lastKey==27) { // Escape - e.stopPropagation(); - searchBox.CloseResultsWindow(); - document.getElementById("MSearchField").focus(); - } else if (this.lastKey==13) { // Enter - return true; + this.NavChild = function(evt,itemIndex,childIndex) + { + var e = (evt) ? evt : window.event; // for IE + if (e.keyCode==13) return true; + if (!this.ProcessKeys(e)) return false; + + if (this.lastKey==38) // Up + { + if (childIndex>0) + { + var newIndex = childIndex-1; + document.getElementById('Item'+itemIndex+'_c'+newIndex).focus(); + } + else // already at first child, jump to parent + { + document.getElementById('Item'+itemIndex).focus(); + } + } + else if (this.lastKey==40) // Down + { + var newIndex = childIndex+1; + var elem = document.getElementById('Item'+itemIndex+'_c'+newIndex); + if (!elem) // last child, jump to parent next parent + { + elem = this.NavNext(itemIndex+1); + } + if (elem) + { + elem.focus(); + } + } + else if (this.lastKey==27) // Escape + { + searchBox.CloseResultsWindow(); + document.getElementById("MSearchField").focus(); + } + else if (this.lastKey==13) // Enter + { + return true; + } + return false; } - return false; - } } -function createResults(resultsPath) { - - function setKeyActions(elem,action) { - elem.setAttribute('onkeydown',action); - elem.setAttribute('onkeypress',action); - elem.setAttribute('onkeyup',action); - } +function setKeyActions(elem,action) +{ + elem.setAttribute('onkeydown',action); + elem.setAttribute('onkeypress',action); + elem.setAttribute('onkeyup',action); +} - function setClassAttr(elem,attr) { - elem.setAttribute('class',attr); - elem.setAttribute('className',attr); - } +function setClassAttr(elem,attr) +{ + elem.setAttribute('class',attr); + elem.setAttribute('className',attr); +} - const results = document.getElementById("SRResults"); +function createResults(resultsPath) +{ + var results = document.getElementById("SRResults"); results.innerHTML = ''; - searchData.forEach((elem,index) => { - const id = elem[0]; - const srResult = document.createElement('div'); + for (var e=0; e - + RF24Gateway - TCP/IP over RF24Network: Member List - - - @@ -26,7 +23,7 @@ -
    RF24Gateway - TCP/IP over RF24Network v2.0.0 +
    RF24Gateway - TCP/IP over RF24Network v1.1.0
    TMRh20 - Pushing the practical limits of RF24 modules
    @@ -35,7 +32,7 @@
    - + @@ -75,23 +72,23 @@
    -
    ESBGateway< mesh_t, network_t, radio_t >::routeStruct Member List
    +
    RF24Gateway::routeStruct Member List
    diff --git a/structESBGateway_1_1routeStruct.html b/structRF24Gateway_1_1routeStruct.html similarity index 53% rename from structESBGateway_1_1routeStruct.html rename to structRF24Gateway_1_1routeStruct.html index 6ec2a26..5cf6299 100644 --- a/structESBGateway_1_1routeStruct.html +++ b/structRF24Gateway_1_1routeStruct.html @@ -3,15 +3,12 @@ - + -RF24Gateway - TCP/IP over RF24Network: ESBGateway< mesh_t, network_t, radio_t >::routeStruct Struct Reference - +RF24Gateway - TCP/IP over RF24Network: RF24Gateway::routeStruct Struct Reference - - @@ -26,7 +23,7 @@ -
    RF24Gateway - TCP/IP over RF24Network v2.0.0 +
    RF24Gateway - TCP/IP over RF24Network v1.1.0
    TMRh20 - Pushing the practical limits of RF24 modules
    @@ -35,7 +32,7 @@
    - + @@ -75,14 +72,14 @@
    -
    ESBGateway< mesh_t, network_t, radio_t >::routeStruct Struct Reference
    +List of all members
    +
    RF24Gateway::routeStruct Struct Reference
    @@ -90,16 +87,15 @@ - - - - - - + + + + + +

    Public Attributes

    struct in_addr ip
     
    struct in_addr mask
     
    struct in_addr gw
     
    struct in_addr ip
     
    struct in_addr mask
     
    struct in_addr gw
     

    Detailed Description

    -
    template<class mesh_t = ESBMesh<ESBNetwork<RF24>, RF24>, class network_t = ESBNetwork<RF24>, class radio_t = RF24>
    -struct ESBGateway< mesh_t, network_t, radio_t >::routeStruct

    If a user has created a file "routing.txt" in the RF24Gateway working directory, it will be loaded
    +

    If a user has created a file "routing.txt" in the RF24Gateway working directory, it will be loaded
    at startup into the routing table. The file should contain standard routing table entries as follows:
    IP<space>NetMask<space>Gateway
    ie: routing.txt

    10.1.4.0 255.255.255.0 10.1.3.33
    @@ -107,77 +103,71 @@

    The first example entry would route all traffic to the 10.1.4.x subnet to 10.1.3.33
    All other traffic not destined for the RF24 nodes will use 10.1.3.34 as the gateway

    Data can be accessed using standard linux Internet address manipulation routines as follows:

    printf("**IP\t\tMask\t\tGateway**\n");
    -
    for(int i=0; i<gw.routingTableSize; i++){
    -
    printf("%s \t",inet_ntoa(gw.routingStruct[i].ip));//inet_ntoa uses a statically assigned buffer, so the printf calls need to be done separately
    -
    printf("%s \t",inet_ntoa(gw.routingStruct[i].mask));
    -
    printf("%s\n", inet_ntoa(gw.routingStruct[i].gw));
    +
    for(int i=0; i<gw.routingTableSize; i++){
    +
    printf("%s \t",inet_ntoa(gw.routingStruct[i].ip));//inet_ntoa uses a statically assigned buffer, so the printf calls need to be done separately
    +
    printf("%s \t",inet_ntoa(gw.routingStruct[i].mask));
    +
    printf("%s\n", inet_ntoa(gw.routingStruct[i].gw));
    //std::cout << inet_ntoa(gw.routingStruct[i].ip) << " \t" << inet_ntoa(gw.routingStruct[i].mask) << " \t" << inet_ntoa(gw.routingStruct[i].gw) << std::endl;
    }
    printf("*****\n");
    Users can modify the routing table as desired, but changes made in code will not currently be saved to file
    - +
    -

    Definition at line 209 of file RF24Gateway.h.

    +

    Definition at line 184 of file RF24Gateway.h.

    Member Data Documentation

    - -

    ◆ ip

    + +

    ◆ ip

    -
    -template<class mesh_t = ESBMesh<ESBNetwork<RF24>, RF24>, class network_t = ESBNetwork<RF24>, class radio_t = RF24>
    - +
    struct in_addr ESBGateway< mesh_t, network_t, radio_t >::routeStruct::ipstruct in_addr RF24Gateway::routeStruct::ip
    -

    Definition at line 211 of file RF24Gateway.h.

    +

    Definition at line 186 of file RF24Gateway.h.

    - -

    ◆ mask

    + +

    ◆ mask

    -
    -template<class mesh_t = ESBMesh<ESBNetwork<RF24>, RF24>, class network_t = ESBNetwork<RF24>, class radio_t = RF24>
    - +
    struct in_addr ESBGateway< mesh_t, network_t, radio_t >::routeStruct::maskstruct in_addr RF24Gateway::routeStruct::mask
    -

    Definition at line 212 of file RF24Gateway.h.

    +

    Definition at line 187 of file RF24Gateway.h.

    - -

    ◆ gw

    + +

    ◆ gw

    -
    -template<class mesh_t = ESBMesh<ESBNetwork<RF24>, RF24>, class network_t = ESBNetwork<RF24>, class radio_t = RF24>
    - +
    struct in_addr ESBGateway< mesh_t, network_t, radio_t >::routeStruct::gwstruct in_addr RF24Gateway::routeStruct::gw
    -

    Definition at line 213 of file RF24Gateway.h.

    +

    Definition at line 188 of file RF24Gateway.h.

    diff --git a/tabs.css b/tabs.css index fe4854a..71c8a47 100644 --- a/tabs.css +++ b/tabs.css @@ -1 +1 @@ -.sm{position:relative;z-index:9999}.sm,.sm ul,.sm li{display:block;list-style:none;margin:0;padding:0;line-height:normal;direction:ltr;text-align:left;-webkit-tap-highlight-color:rgba(0,0,0,0)}.sm-rtl,.sm-rtl ul,.sm-rtl li{direction:rtl;text-align:right}.sm>li>h1,.sm>li>h2,.sm>li>h3,.sm>li>h4,.sm>li>h5,.sm>li>h6{margin:0;padding:0}.sm ul{display:none}.sm li,.sm a{position:relative}.sm a{display:block}.sm a.disabled{cursor:not-allowed}.sm:after{content:"\00a0";display:block;height:0;font:0/0 serif;clear:both;visibility:hidden;overflow:hidden}.sm,.sm *,.sm *:before,.sm *:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.main-menu-btn{position:relative;display:inline-block;width:36px;height:36px;text-indent:36px;margin-left:8px;white-space:nowrap;overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0)}.main-menu-btn-icon,.main-menu-btn-icon:before,.main-menu-btn-icon:after{position:absolute;top:50%;left:2px;height:2px;width:24px;background:var(--nav-menu-button-color);-webkit-transition:all .25s;transition:all .25s}.main-menu-btn-icon:before{content:'';top:-7px;left:0}.main-menu-btn-icon:after{content:'';top:7px;left:0}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon{height:0}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon:before{top:0;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon:after{top:0;-webkit-transform:rotate(45deg);transform:rotate(45deg)}#main-menu-state{position:absolute;width:1px;height:1px;margin:-1px;border:0;padding:0;overflow:hidden;clip:rect(1px,1px,1px,1px)}#main-menu-state:not(:checked) ~ #main-menu{display:none}#main-menu-state:checked ~ #main-menu{display:block}@media(min-width:768px){.main-menu-btn{position:absolute;top:-99999px}#main-menu-state:not(:checked) ~ #main-menu{display:block}}.sm-dox{background-image:var(--nav-gradient-image)}.sm-dox a,.sm-dox a:focus,.sm-dox a:hover,.sm-dox a:active{padding:0 12px;padding-right:43px;font-family:var(--font-family-nav);font-size:13px;font-weight:bold;line-height:36px;text-decoration:none;text-shadow:var(--nav-text-normal-shadow);color:var(--nav-text-normal-color);outline:0}.sm-dox a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:var(--nav-text-hover-shadow)}.sm-dox a.current{color:#d23600}.sm-dox a.disabled{color:#bbb}.sm-dox a span.sub-arrow{position:absolute;top:50%;margin-top:-14px;left:auto;right:3px;width:28px;height:28px;overflow:hidden;font:bold 12px/28px monospace !important;text-align:center;text-shadow:none;background:var(--nav-menu-toggle-color);-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox a span.sub-arrow:before{display:block;content:'+'}.sm-dox a.highlighted span.sub-arrow:before{display:block;content:'-'}.sm-dox>li:first-child>a,.sm-dox>li:first-child>:not(ul) a{-moz-border-radius:5px 5px 0 0;-webkit-border-radius:5px;border-radius:5px 5px 0 0}.sm-dox>li:last-child>a,.sm-dox>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul{-moz-border-radius:0 0 5px 5px;-webkit-border-radius:0;border-radius:0 0 5px 5px}.sm-dox>li:last-child>a.highlighted,.sm-dox>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox ul{background:var(--nav-menu-background-color)}.sm-dox ul a,.sm-dox ul a:focus,.sm-dox ul a:hover,.sm-dox ul a:active{font-size:12px;border-left:8px solid transparent;line-height:36px;text-shadow:none;background-color:var(--nav-menu-background-color);background-image:none}.sm-dox ul a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:0 1px 1px black}.sm-dox ul ul a,.sm-dox ul ul a:hover,.sm-dox ul ul a:focus,.sm-dox ul ul a:active{border-left:16px solid transparent}.sm-dox ul ul ul a,.sm-dox ul ul ul a:hover,.sm-dox ul ul ul a:focus,.sm-dox ul ul ul a:active{border-left:24px solid transparent}.sm-dox ul ul ul ul a,.sm-dox ul ul ul ul a:hover,.sm-dox ul ul ul ul a:focus,.sm-dox ul ul ul ul a:active{border-left:32px solid transparent}.sm-dox ul ul ul ul ul a,.sm-dox ul ul ul ul ul a:hover,.sm-dox ul ul ul ul ul a:focus,.sm-dox ul ul ul ul ul a:active{border-left:40px solid transparent}@media(min-width:768px){.sm-dox ul{position:absolute;width:12em}.sm-dox li{float:left}.sm-dox.sm-rtl li{float:right}.sm-dox ul li,.sm-dox.sm-rtl ul li,.sm-dox.sm-vertical li{float:none}.sm-dox a{white-space:nowrap}.sm-dox ul a,.sm-dox.sm-vertical a{white-space:normal}.sm-dox .sm-nowrap>li>a,.sm-dox .sm-nowrap>li>:not(ul) a{white-space:nowrap}.sm-dox{padding:0 10px;background-image:var(--nav-gradient-image);line-height:36px}.sm-dox a span.sub-arrow{top:50%;margin-top:-2px;right:12px;width:0;height:0;border-width:4px;border-style:solid dashed dashed dashed;border-color:var(--nav-text-normal-color) transparent transparent transparent;background:transparent;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox a,.sm-dox a:focus,.sm-dox a:active,.sm-dox a:hover,.sm-dox a.highlighted{padding:0 12px;background-image:var(--nav-separator-image);background-repeat:no-repeat;background-position:right;-moz-border-radius:0 !important;-webkit-border-radius:0;border-radius:0 !important}.sm-dox a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:var(--nav-text-hover-shadow)}.sm-dox a:hover span.sub-arrow{border-color:var(--nav-text-hover-color) transparent transparent transparent}.sm-dox a.has-submenu{padding-right:24px}.sm-dox li{border-top:0}.sm-dox>li>ul:before,.sm-dox>li>ul:after{content:'';position:absolute;top:-18px;left:30px;width:0;height:0;overflow:hidden;border-width:9px;border-style:dashed dashed solid dashed;border-color:transparent transparent #bbb transparent}.sm-dox>li>ul:after{top:-16px;left:31px;border-width:8px;border-color:transparent transparent var(--nav-menu-background-color) transparent}.sm-dox ul{border:1px solid #bbb;padding:5px 0;background:var(--nav-menu-background-color);-moz-border-radius:5px !important;-webkit-border-radius:5px;border-radius:5px !important;-moz-box-shadow:0 5px 9px rgba(0,0,0,0.2);-webkit-box-shadow:0 5px 9px rgba(0,0,0,0.2);box-shadow:0 5px 9px rgba(0,0,0,0.2)}.sm-dox ul a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-color:transparent transparent transparent var(--nav-menu-foreground-color);border-style:dashed dashed dashed solid}.sm-dox ul a,.sm-dox ul a:hover,.sm-dox ul a:focus,.sm-dox ul a:active,.sm-dox ul a.highlighted{color:var(--nav-menu-foreground-color);background-image:none;border:0 !important}.sm-dox ul a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:var(--nav-text-hover-shadow)}.sm-dox ul a:hover span.sub-arrow{border-color:transparent transparent transparent var(--nav-text-hover-color)}.sm-dox span.scroll-up,.sm-dox span.scroll-down{position:absolute;display:none;visibility:hidden;overflow:hidden;background:var(--nav-menu-background-color);height:36px}.sm-dox span.scroll-up:hover,.sm-dox span.scroll-down:hover{background:#eee}.sm-dox span.scroll-up:hover span.scroll-up-arrow,.sm-dox span.scroll-up:hover span.scroll-down-arrow{border-color:transparent transparent #d23600 transparent}.sm-dox span.scroll-down:hover span.scroll-down-arrow{border-color:#d23600 transparent transparent transparent}.sm-dox span.scroll-up-arrow,.sm-dox span.scroll-down-arrow{position:absolute;top:0;left:50%;margin-left:-6px;width:0;height:0;overflow:hidden;border-width:6px;border-style:dashed dashed solid dashed;border-color:transparent transparent var(--nav-menu-foreground-color) transparent}.sm-dox span.scroll-down-arrow{top:8px;border-style:solid dashed dashed dashed;border-color:var(--nav-menu-foreground-color) transparent transparent transparent}.sm-dox.sm-rtl a.has-submenu{padding-right:12px;padding-left:24px}.sm-dox.sm-rtl a span.sub-arrow{right:auto;left:12px}.sm-dox.sm-rtl.sm-vertical a.has-submenu{padding:10px 20px}.sm-dox.sm-rtl.sm-vertical a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-rtl>li>ul:before{left:auto;right:30px}.sm-dox.sm-rtl>li>ul:after{left:auto;right:31px}.sm-dox.sm-rtl ul a.has-submenu{padding:10px 20px !important}.sm-dox.sm-rtl ul a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-vertical{padding:10px 0;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox.sm-vertical a{padding:10px 20px}.sm-dox.sm-vertical a:hover,.sm-dox.sm-vertical a:focus,.sm-dox.sm-vertical a:active,.sm-dox.sm-vertical a.highlighted{background:#fff}.sm-dox.sm-vertical a.disabled{background-image:var(--nav-gradient-image)}.sm-dox.sm-vertical a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-style:dashed dashed dashed solid;border-color:transparent transparent transparent #555}.sm-dox.sm-vertical>li>ul:before,.sm-dox.sm-vertical>li>ul:after{display:none}.sm-dox.sm-vertical ul a{padding:10px 20px}.sm-dox.sm-vertical ul a:hover,.sm-dox.sm-vertical ul a:focus,.sm-dox.sm-vertical ul a:active,.sm-dox.sm-vertical ul a.highlighted{background:#eee}.sm-dox.sm-vertical ul a.disabled{background:var(--nav-menu-background-color)}} \ No newline at end of file +.sm{position:relative;z-index:9999}.sm,.sm ul,.sm li{display:block;list-style:none;margin:0;padding:0;line-height:normal;direction:ltr;text-align:left;-webkit-tap-highlight-color:rgba(0,0,0,0)}.sm-rtl,.sm-rtl ul,.sm-rtl li{direction:rtl;text-align:right}.sm>li>h1,.sm>li>h2,.sm>li>h3,.sm>li>h4,.sm>li>h5,.sm>li>h6{margin:0;padding:0}.sm ul{display:none}.sm li,.sm a{position:relative}.sm a{display:block}.sm a.disabled{cursor:not-allowed}.sm:after{content:"\00a0";display:block;height:0;font:0/0 serif;clear:both;visibility:hidden;overflow:hidden}.sm,.sm *,.sm *:before,.sm *:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.main-menu-btn{position:relative;display:inline-block;width:36px;height:36px;text-indent:36px;margin-left:8px;white-space:nowrap;overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0)}.main-menu-btn-icon,.main-menu-btn-icon:before,.main-menu-btn-icon:after{position:absolute;top:50%;left:2px;height:2px;width:24px;background:var(--nav-menu-button-color);-webkit-transition:all .25s;transition:all .25s}.main-menu-btn-icon:before{content:'';top:-7px;left:0}.main-menu-btn-icon:after{content:'';top:7px;left:0}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon{height:0}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon:before{top:0;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon:after{top:0;-webkit-transform:rotate(45deg);transform:rotate(45deg)}#main-menu-state{position:absolute;width:1px;height:1px;margin:-1px;border:0;padding:0;overflow:hidden;clip:rect(1px,1px,1px,1px)}#main-menu-state:not(:checked) ~ #main-menu{display:none}#main-menu-state:checked ~ #main-menu{display:block}@media(min-width:768px){.main-menu-btn{position:absolute;top:-99999px}#main-menu-state:not(:checked) ~ #main-menu{display:block}}.sm-dox{background-image:var(--nav-gradient-image)}.sm-dox a,.sm-dox a:focus,.sm-dox a:hover,.sm-dox a:active{padding:0 12px;padding-right:43px;font-family:var(--font-family-nav);font-size:13px;font-weight:bold;line-height:36px;text-decoration:none;text-shadow:var(--nav-text-normal-shadow);color:var(--nav-text-normal-color);outline:0}.sm-dox a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:var(--nav-text-hover-shadow)}.sm-dox a.current{color:#d23600}.sm-dox a.disabled{color:#bbb}.sm-dox a span.sub-arrow{position:absolute;top:50%;margin-top:-14px;left:auto;right:3px;width:28px;height:28px;overflow:hidden;font:bold 12px/28px monospace !important;text-align:center;text-shadow:none;background:var(--nav-menu-toggle-color);-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox a span.sub-arrow:before{display:block;content:'+'}.sm-dox a.highlighted span.sub-arrow:before{display:block;content:'-'}.sm-dox>li:first-child>a,.sm-dox>li:first-child>:not(ul) a{-moz-border-radius:5px 5px 0 0;-webkit-border-radius:5px;border-radius:5px 5px 0 0}.sm-dox>li:last-child>a,.sm-dox>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul{-moz-border-radius:0 0 5px 5px;-webkit-border-radius:0;border-radius:0 0 5px 5px}.sm-dox>li:last-child>a.highlighted,.sm-dox>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox ul{background:var(--nav-menu-background-color)}.sm-dox ul a,.sm-dox ul a:focus,.sm-dox ul a:hover,.sm-dox ul a:active{font-size:12px;border-left:8px solid transparent;line-height:36px;text-shadow:none;background-color:var(--nav-menu-background-color);background-image:none}.sm-dox ul a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:0 1px 1px black}.sm-dox ul ul a,.sm-dox ul ul a:hover,.sm-dox ul ul a:focus,.sm-dox ul ul a:active{border-left:16px solid transparent}.sm-dox ul ul ul a,.sm-dox ul ul ul a:hover,.sm-dox ul ul ul a:focus,.sm-dox ul ul ul a:active{border-left:24px solid transparent}.sm-dox ul ul ul ul a,.sm-dox ul ul ul ul a:hover,.sm-dox ul ul ul ul a:focus,.sm-dox ul ul ul ul a:active{border-left:32px solid transparent}.sm-dox ul ul ul ul ul a,.sm-dox ul ul ul ul ul a:hover,.sm-dox ul ul ul ul ul a:focus,.sm-dox ul ul ul ul ul a:active{border-left:40px solid transparent}@media(min-width:768px){.sm-dox ul{position:absolute;width:12em}.sm-dox li{float:left}.sm-dox.sm-rtl li{float:right}.sm-dox ul li,.sm-dox.sm-rtl ul li,.sm-dox.sm-vertical li{float:none}.sm-dox a{white-space:nowrap}.sm-dox ul a,.sm-dox.sm-vertical a{white-space:normal}.sm-dox .sm-nowrap>li>a,.sm-dox .sm-nowrap>li>:not(ul) a{white-space:nowrap}.sm-dox{padding:0 10px;background-image:var(--nav-gradient-image);line-height:36px}.sm-dox a span.sub-arrow{top:50%;margin-top:-2px;right:12px;width:0;height:0;border-width:4px;border-style:solid dashed dashed dashed;border-color:var(--nav-text-normal-color) transparent transparent transparent;background:transparent;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox a,.sm-dox a:focus,.sm-dox a:active,.sm-dox a:hover,.sm-dox a.highlighted{padding:0 12px;background-image:var(--nav-separator-image);background-repeat:no-repeat;background-position:right;-moz-border-radius:0 !important;-webkit-border-radius:0;border-radius:0 !important}.sm-dox a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:var(--nav-text-hover-shadow)}.sm-dox a:hover span.sub-arrow{border-color:var(--nav-text-hover-color) transparent transparent transparent}.sm-dox a.has-submenu{padding-right:24px}.sm-dox li{border-top:0}.sm-dox>li>ul:before,.sm-dox>li>ul:after{content:'';position:absolute;top:-18px;left:30px;width:0;height:0;overflow:hidden;border-width:9px;border-style:dashed dashed solid dashed;border-color:transparent transparent #bbb transparent}.sm-dox>li>ul:after{top:-16px;left:31px;border-width:8px;border-color:transparent transparent var(--nav-menu-background-color) transparent}.sm-dox ul{border:1px solid #bbb;padding:5px 0;background:var(--nav-menu-background-color);-moz-border-radius:5px !important;-webkit-border-radius:5px;border-radius:5px !important;-moz-box-shadow:0 5px 9px rgba(0,0,0,0.2);-webkit-box-shadow:0 5px 9px rgba(0,0,0,0.2);box-shadow:0 5px 9px rgba(0,0,0,0.2)}.sm-dox ul a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-color:transparent transparent transparent var(--nav-menu-foreground-color);border-style:dashed dashed dashed solid}.sm-dox ul a,.sm-dox ul a:hover,.sm-dox ul a:focus,.sm-dox ul a:active,.sm-dox ul a.highlighted{color:var(--nav-menu-foreground-color);background-image:none;border:0 !important;color:var(--nav-menu-foreground-color);background-image:none}.sm-dox ul a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:var(--nav-text-hover-shadow)}.sm-dox ul a:hover span.sub-arrow{border-color:transparent transparent transparent var(--nav-text-hover-color)}.sm-dox span.scroll-up,.sm-dox span.scroll-down{position:absolute;display:none;visibility:hidden;overflow:hidden;background:var(--nav-menu-background-color);height:36px}.sm-dox span.scroll-up:hover,.sm-dox span.scroll-down:hover{background:#eee}.sm-dox span.scroll-up:hover span.scroll-up-arrow,.sm-dox span.scroll-up:hover span.scroll-down-arrow{border-color:transparent transparent #d23600 transparent}.sm-dox span.scroll-down:hover span.scroll-down-arrow{border-color:#d23600 transparent transparent transparent}.sm-dox span.scroll-up-arrow,.sm-dox span.scroll-down-arrow{position:absolute;top:0;left:50%;margin-left:-6px;width:0;height:0;overflow:hidden;border-width:6px;border-style:dashed dashed solid dashed;border-color:transparent transparent var(--nav-menu-foreground-color) transparent}.sm-dox span.scroll-down-arrow{top:8px;border-style:solid dashed dashed dashed;border-color:var(--nav-menu-foreground-color) transparent transparent transparent}.sm-dox.sm-rtl a.has-submenu{padding-right:12px;padding-left:24px}.sm-dox.sm-rtl a span.sub-arrow{right:auto;left:12px}.sm-dox.sm-rtl.sm-vertical a.has-submenu{padding:10px 20px}.sm-dox.sm-rtl.sm-vertical a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-rtl>li>ul:before{left:auto;right:30px}.sm-dox.sm-rtl>li>ul:after{left:auto;right:31px}.sm-dox.sm-rtl ul a.has-submenu{padding:10px 20px !important}.sm-dox.sm-rtl ul a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-vertical{padding:10px 0;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox.sm-vertical a{padding:10px 20px}.sm-dox.sm-vertical a:hover,.sm-dox.sm-vertical a:focus,.sm-dox.sm-vertical a:active,.sm-dox.sm-vertical a.highlighted{background:#fff}.sm-dox.sm-vertical a.disabled{background-image:var(--nav-gradient-image)}.sm-dox.sm-vertical a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-style:dashed dashed dashed solid;border-color:transparent transparent transparent #555}.sm-dox.sm-vertical>li>ul:before,.sm-dox.sm-vertical>li>ul:after{display:none}.sm-dox.sm-vertical ul a{padding:10px 20px}.sm-dox.sm-vertical ul a:hover,.sm-dox.sm-vertical ul a:focus,.sm-dox.sm-vertical ul a:active,.sm-dox.sm-vertical ul a.highlighted{background:#eee}.sm-dox.sm-vertical ul a.disabled{background:var(--nav-menu-background-color)}} \ No newline at end of file