Skip to content

Commit

Permalink
abstract: synchronize method to get next frame ID to avoid multiple t…
Browse files Browse the repository at this point in the history
…hreads

to increment the counter at the same time

This could fix an issue of a customer getting sometimes an
IllegalArgumentException when sending data (#130).

Signed-off-by: Ruben Moral <ruben.moral@digi.com>
  • Loading branch information
rubenmoral committed Jan 28, 2019
1 parent dd61eff commit a22dbba
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1460,7 +1460,7 @@ private void writePacket(XBeePacket packet) throws IOException {
*
* @return The next Frame ID.
*/
protected int getNextFrameID() {
protected synchronized int getNextFrameID() {
if (isRemote())
return localXBeeDevice.getNextFrameID();
if (currentFrameID == 0xff) {
Expand Down

0 comments on commit a22dbba

Please sign in to comment.