Skip to content

Commit

Permalink
receive acknowledge condition bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
gioblu committed Sep 17, 2017
1 parent 1aca184 commit 92dcdcd
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions PJON.h
Original file line number Diff line number Diff line change
Expand Up @@ -461,15 +461,17 @@ class PJON {
if(data[1] & PJON_ACK_REQ_BIT && data[0] != PJON_BROADCAST)
if(_mode != PJON_SIMPLEX && !_router)
if(
!(config & PJON_MODE_BIT) ||
(
(config & PJON_MODE_BIT) &&
(data[1] & PJON_MODE_BIT) &&
bus_id_equality(
data + 3 + extended_length + extended_header,
bus_id
computed_crc && (
!(config & PJON_MODE_BIT) ||
(
(config & PJON_MODE_BIT) &&
(data[1] & PJON_MODE_BIT) &&
bus_id_equality(
data + 3 + extended_length + extended_header,
bus_id
)
)
) && computed_crc
)
) strategy.send_response(PJON_ACK);

if(!computed_crc) return PJON_NAK;
Expand Down

0 comments on commit 92dcdcd

Please sign in to comment.