jjpavlik / homemetrics

1 stars 0 forks source link

Single send packet routine #8

Open jjpavlik opened 4 years ago

jjpavlik commented 4 years ago

Right now each possible response routine is sending the packet on its own. This make it really hard to for example track the amount of bytes being sent, and make the code a bit messy. Maybe there should be something like:

boolean send_packet(byte *packet, byte size){ sent = Serial.write(packet, size); bytes_sent = bytes_sent+sent; if(sent == size) { return true; } bad_writes++; return false; }