File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
libraries/MySensors/examples/EthernetGateway Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 62
62
#endif
63
63
64
64
// Use this if you have attached a Ethernet ENC28J60 shields
65
- #include < UIPEthernet.h>
65
+ // #include <UIPEthernet.h>
66
66
67
67
// Use this fo WizNET module and Arduino Ethernet Shield
68
- // #include <Ethernet.h>
68
+ #include < Ethernet.h>
69
69
70
70
71
71
#define INCLUSION_MODE_TIME 1 // Number of minutes inclusion mode is enabled
@@ -97,6 +97,7 @@ EthernetServer server = EthernetServer(IP_PORT);
97
97
98
98
char inputString[MAX_RECEIVE_LENGTH] = " " ; // A string to hold incoming commands from serial/ethernet interface
99
99
int inputPos = 0 ;
100
+ bool sentReady = false ;
100
101
101
102
void w5100_spi_en (boolean enable)
102
103
{
@@ -151,7 +152,7 @@ void setup()
151
152
server.begin ();
152
153
w5100_spi_en (false );
153
154
154
- // output(PSTR("0;0;%d;0;%d;Gateway startup complete.\n"), C_INTERNAL, I_GATEWAY_READY);
155
+ output (PSTR (" 0;0;%d;0;%d;Gateway startup complete.\n " ), C_INTERNAL, I_GATEWAY_READY);
155
156
156
157
}
157
158
@@ -170,7 +171,12 @@ void loop()
170
171
EthernetClient client = server.available ();
171
172
172
173
if (client) {
173
-
174
+ if (!sentReady) {
175
+ // Send gateway startup message when first client connects
176
+ output (PSTR (" 0;0;%d;0;%d;Gateway startup complete.\n " ), C_INTERNAL, I_GATEWAY_READY);
177
+ sentReady = true ;
178
+ }
179
+
174
180
// if got 1 or more bytes
175
181
if (client.available ()) {
176
182
// read the bytes incoming from the client
You can’t perform that action at this time.
0 commit comments