Brunovf1 / xbee-arduino

Automatically exported from code.google.com/p/xbee-arduino
GNU General Public License v3.0
0 stars 0 forks source link

drop of incoming packets when you send outgoing packet #8

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Send a Packet from A to B
2.keep B from reading the packet with delay(5000) or just dont use readpacket
3.send a packet from B to A - the first packet is lost

What is the expected output? What do you see instead?

The first packet should be in the buffer, but the buffer is clean

Reason and solution:

remove the line:
Serial.flush() in the Function: XBee::send(XBeeRequest &request)

Serial.flush cleans the inputbuffer, it does not sends anything; see arduino 
documentation: http://arduino.cc/en/Serial/Flush

Original issue reported on code.google.com by woegerer...@gmail.com on 12 Feb 2011 at 2:14

GoogleCodeExporter commented 9 years ago
I had thought, incorrectly, that flush flushes the output buffer.  I committed 
to svn and will release soon.  Thanks for reporting.

Original comment by andrew.rapp@gmail.com on 3 Apr 2011 at 2:27