Closed GoogleCodeExporter closed 9 years ago
I've just been looking at this code. I haven't worked out why resetting the
bytes in the frame buffer causes the arduino to reset; however I've looked at
the way readPacket works, and I can't see any reason why these bytes need to be
set to zero at all, given that there is a _frameLength variable to indicate
which bytes have been read into the current response.
I've tried simply commenting out the 'for' loop in the original version, and at
a first glance this seems to work OK.
The patch is to change XBeeResponse::reset() to look like this:
void XBeeResponse::reset() {
init();
_apiId = 0;
_msbLength = 0;
_lsbLength = 0;
_checksum = 0;
_frameLength = 0;
_errorCode = NO_ERROR;
/* REMOVED.
for (int i = 0; i < MAX_FRAME_DATA_SIZE; i++) {
getFrameData()[i] = 0;
}*/
}
(From line 739 in the 0.3 version of the library)
Original comment by highfel...@gmail.com
on 5 Oct 2012 at 8:13
Thanks guys for identifying the issue and the fix. I removed the reset and
checked into subversion.
Original comment by andrew.rapp@gmail.com
on 6 Oct 2012 at 8:10
Hi, it also happened to me. I've just commented that pieec of code in the reset
procedure and now the Arduino does not reset itself.
Do you know a reason for this? as I partner is developing similar software and
it doesn't happen to him.
Regards
Original comment by Javier.B...@gmail.com
on 10 Jan 2013 at 2:41
I'm not working on this anymore. I never worked out why it was happening, just
the workaround I posted.
Original comment by highfel...@gmail.com
on 10 Jan 2013 at 3:31
Please try version 0.5
Original comment by andrew.rapp@gmail.com
on 2 Feb 2014 at 6:39
Original issue reported on code.google.com by
Megahulk...@googlemail.com
on 24 Feb 2012 at 9:49