aboutsummaryrefslogtreecommitdiff
path: root/libraries/Ethernet
diff options
context:
space:
mode:
authorDavid A. Mellis <d.mellis@arduino.cc>2009-08-15 14:48:42 +0000
committerDavid A. Mellis <d.mellis@arduino.cc>2009-08-15 14:48:42 +0000
commit50f77c7210a490d8fee28348fcda811ca0bdf615 (patch)
treec5ed76441bcdd7c51b6bf07d7b0ba16444dbaee6 /libraries/Ethernet
parent159051b8f814edb7474912ad6d04058d34f2d173 (diff)
parent79b7ecdd92973f4aa67a6bcaa8bd12a10e5b5133 (diff)
Moving the processing-5503 branch (used for Arduino 0017) into the trunk.
Diffstat (limited to 'libraries/Ethernet')
-rw-r--r--libraries/Ethernet/Client.cpp16
-rw-r--r--libraries/Ethernet/keywords.txt30
2 files changed, 42 insertions, 4 deletions
diff --git a/libraries/Ethernet/Client.cpp b/libraries/Ethernet/Client.cpp
index ebbb08d..0511c7b 100644
--- a/libraries/Ethernet/Client.cpp
+++ b/libraries/Ethernet/Client.cpp
@@ -113,13 +113,21 @@ void Client::stop() {
}
uint8_t Client::connected() {
- uint8_t s = status();
- return !(s == SOCK_LISTEN || s == SOCK_CLOSED || s == SOCK_FIN_WAIT ||
- (s == SOCK_CLOSE_WAIT && !available()));
+ if (_sock == 255) {
+ return 0;
+ } else {
+ uint8_t s = status();
+ return !(s == SOCK_LISTEN || s == SOCK_CLOSED || s == SOCK_FIN_WAIT ||
+ (s == SOCK_CLOSE_WAIT && !available()));
+ }
}
uint8_t Client::status() {
- return getSn_SR(_sock);
+ if (_sock == 255) {
+ return SOCK_CLOSED;
+ } else {
+ return getSn_SR(_sock);
+ }
}
// the next three functions are a hack so we can compare the client returned
diff --git a/libraries/Ethernet/keywords.txt b/libraries/Ethernet/keywords.txt
new file mode 100644
index 0000000..ebc5793
--- /dev/null
+++ b/libraries/Ethernet/keywords.txt
@@ -0,0 +1,30 @@
+#######################################
+# Syntax Coloring Map For Ethernet
+#######################################
+
+#######################################
+# Datatypes (KEYWORD1)
+#######################################
+
+Ethernet KEYWORD1
+Client KEYWORD1
+Server KEYWORD1
+
+#######################################
+# Methods and Functions (KEYWORD2)
+#######################################
+
+status KEYWORD2
+connect KEYWORD2
+write KEYWORD2
+available KEYWORD2
+read KEYWORD2
+flush KEYWORD2
+stop KEYWORD2
+connected KEYWORD2
+begin KEYWORD2
+
+#######################################
+# Constants (LITERAL1)
+#######################################
+