MCPcopy Create free account
hub / github.com/DanielOgorchock/ST_Anything / checkStatus

Method checkStatus

Arduino/libraries/Ethernet2/src/Twitter.cpp:58–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58bool Twitter::checkStatus(Print *debug)
59{
60 if (!client.connected()) {
61 if (debug)
62 while(client.available())
63 debug->print((char)client.read());
64 client.flush();
65 client.stop();
66 return false;
67 }
68 if (!client.available())
69 return true;
70 char c = client.read();
71 if (debug)
72 debug->print(c);
73 switch(parseStatus) {
74 case 0:
75 if (c == ' ') parseStatus++; break; // skip "HTTP/1.1 "
76 case 1:
77 if (c >= '0' && c <= '9') {
78 statusCode *= 10;
79 statusCode += c - '0';
80 } else {
81 parseStatus++;
82 }
83 }
84 return true;
85}
86
87int Twitter::wait(Print *debug)
88{

Callers

nothing calls this directly

Calls 6

printMethod · 0.80
connectedMethod · 0.45
availableMethod · 0.45
readMethod · 0.45
flushMethod · 0.45
stopMethod · 0.45

Tested by

no test coverage detected