Skip to content

Commit 51e98e6

Browse files
committed
Updated Readme and Xbee.cpp files
1 parent 5804680 commit 51e98e6

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,16 @@
11
# Digi-Xbee-Java---Processing-Arduino
2+
3+
1-10-15
4+
5+
Updated sample send-receive processing sketch as well as the associated arduino sketch to test the interface between Processing and Digi's Java libary.
6+
7+
The Arduino sketch is based on examples from the Desert Home web site - Using the XBee Library Part 3 (http://www.desert-home.com/2013/02/using-xbee-library-part-3.html) for sending packet string data.
8+
The XBee library is a my modifications of the XBee-Arduino library by Andrew Rapp (http://code.google.com/p/xbee-arduino/). The modified allows you set the API mode of the radios to 1 or 2. It is called from the setup() of the Arduino sketch as:
9+
10+
Xbee.setAPImode(1); //for API mode 1 or
11+
Xbee.setAPImode(2); //for API mode 2.
12+
13+
Default is API mode 2 per the original library.
14+
15+
The examples in the XBee-Arduino library are defaulted to API mode 2 as it was only designed for API mode 2.
16+

xbee-arduino/XBee.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,8 @@ void XBee::readPacket() {
867867

868868
b = read();
869869

870-
if (_pos > 0 && b == START_BYTE && ATAP == 2) {
870+
//if (_pos > 0 && b == START_BYTE && ATAP == 2) {
871+
if (_pos > 0 && b == START_BYTE) {
871872
// new packet start before previous packeted completed -- discard previous packet and start over
872873
_response.setErrorCode(UNEXPECTED_START_BYTE);
873874
return;
@@ -933,7 +934,8 @@ void XBee::readPacket() {
933934
// verify checksum
934935

935936
//std::cout << "read checksum " << static_cast<unsigned int>(b) << " at pos " << static_cast<unsigned int>(_pos) << std::endl;
936-
937+
//Serial.print("read checksum "); Serial.print(static_cast<unsigned int>(b));
938+
//Serial.print(" at pos "); Serial.println(static_cast<unsigned int>(_pos));
937939
if ((_checksumTotal & 0xff) == 0xff) {
938940
_response.setChecksum(b);
939941
_response.setAvailable(true);

0 commit comments

Comments
 (0)