Permalink
Browse files

send_packet_blocking backoff bugfix (#216) (#206)

  • Loading branch information...
gioblu committed Jul 16, 2018
1 parent 487f2af commit 6e03ca910593943b628e5b0373d4b9f166fc5bad
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/PJON.h
@@ -803,7 +803,7 @@ class PJON {
uint8_t header = PJON_NO_HEADER,
uint16_t p_id = 0,
uint16_t requested_port = PJON_BROADCAST,
uint32_t timeout = 3000000
uint32_t timeout = 3500000
) {
uint16_t state = PJON_FAIL;
uint32_t attempts = 0;
@@ -837,8 +837,9 @@ class PJON {
if(state != PJON_FAIL) strategy.handle_collision();
#if(PJON_RECEIVE_WHILE_SENDING_BLOCKING)
if(_recursion <= 1) receive(strategy.back_off(attempts));
else
#endif
else PJON_DELAY_MICROSECONDS(strategy.back_off(attempts));
PJON_DELAY((uint32_t)(strategy.back_off(attempts) / 1000));
}
_recursion--;
return state;

0 comments on commit 6e03ca9

Please sign in to comment.