Skip to content

Instantly share code, notes, and snippets.

@D3f0
Created November 18, 2015 01:06
Show Gist options
  • Save D3f0/ddc1f66312bb3eb02db8 to your computer and use it in GitHub Desktop.
Save D3f0/ddc1f66312bb3eb02db8 to your computer and use it in GitHub Desktop.
// 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