Created
November 18, 2015 01:06
-
-
Save D3f0/ddc1f66312bb3eb02db8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Quizás la API Serial y Ethernet podrían compartir algo | |
MaraCommandReceiver commandReceiver; | |
void loop(){ | |
// Create a client connection | |
EthernetClient client = server.available(); | |
if (client) { | |
while (client.connected()) { | |
if (client.available()) { | |
char c = client.read(); | |
commandReceiver.processByte(c); | |
if (commandReceiver.hasPackage()) { | |
uint8_t size, uint8_t bytesOfResponse[255]; | |
commandReceiver.fillPackage(&size, &bytesOfResponse); | |
client.write(size, bytesOfResponse); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment