Skip to content
This repository has been archived by the owner on May 16, 2019. It is now read-only.

xbeeZB source route packet is corrupt #32

Open
mechazine opened this issue Dec 28, 2017 · 0 comments
Open

xbeeZB source route packet is corrupt #32

mechazine opened this issue Dec 28, 2017 · 0 comments

Comments

@mechazine
Copy link

mechazine commented Dec 28, 2017

The current xbee_sZB_createSourceRoute_tx_func in master overwrites the last byte of the last 16-bit address in the source route list as well as the last byte of the 16-bit destination address.

The offset 11 should be 12 as far as I can tell, and I am not sure why the last byte was overwritten by 0. The spec doesn't seem to indicate that.

This is the diff of my change.

diff --git a/modes/xbeeZB/route.c b/modes/xbeeZB/route.c
index cede0a9..1c94638 100644
--- a/modes/xbeeZB/route.c
+++ b/modes/xbeeZB/route.c
@@ -51,8 +51,8 @@ xbee_err xbee_sZB_createSourceRoute_tx_func(struct xbee *xbee, struct xbee_con *
        iBuf->data[0] = identifier;
        iBuf->data[1] = 0; /* the datasheet specifies that the frameID is always zero */
        memcpy(&(iBuf->data[2]), buf, len);
-       iBuf->data[11] = 0; /* the datasheet specifies that this is zero */
-       iBuf->data[bufLen - 1] = '\0';
+       iBuf->data[12] = 0; /* the datasheet specifies that this is zero */
+       //iBuf->data[bufLen - 1] = '\0';
 
        *oBuf = iBuf;
 
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant