NGCP / xbeeplus

Cross-Platform C++11 Xbee Radio API
3 stars 0 forks source link

AsyncRead doesnt work correctly #20

Closed zhangh94 closed 7 years ago

zhangh94 commented 7 years ago
zhangh94 commented 7 years ago

Implemented fix to sub " " Whitespace characters for ":" colon characters but now the last character gets dropped. Ex (R0 becomes W0).

Debugging the GetData() method in ReceivePacket shows the Data field of the frame is already corrupt. Debugging the callbackFunction attached to the SerialXBee class shows Frame pointer passed into callbackFunction also has data field which is already corrupt

Bug is most likely in ParseFrame function: The for loop near lines 91-92 iterates from 0 to frame_length < 13, but 13 is a magic number. When set to 12, the last character is no longer cut off