Permalink
Browse files

pointer to repeated packet with async ack bugfix

  • Loading branch information...
gioblu committed Mar 9, 2017
1 parent 0a1c77e commit ddfd2c180d99ef01d0c9ea057f2d7b24c9dff690
Showing with 8 additions and 4 deletions.
  1. +8 −4 PJON.h
12 PJON.h
@@ -287,10 +287,12 @@ limitations under the License. */
uint16_t length,
uint32_t timing,
uint16_t header = PJON_NOT_ASSIGNED,
uint16_t p_id = 0
uint16_t p_id = 0,
uint16_t p_index = PJON_FAIL
) {
for(uint8_t i = 0; i < PJON_MAX_PACKETS; i++)
if(packets[i].state == 0) {
bool index = (p_index != PJON_FAIL);
for(uint8_t i = (index) ? p_index : 0; i < PJON_MAX_PACKETS; i++)
if(packets[i].state == 0 || p_index) {
if(!(length = compose_packet(
id, b_id, packets[i].content, packet, length, header, p_id
))) return PJON_FAIL;
@@ -523,8 +525,10 @@ limitations under the License. */
packets[i].content + (offset - crc_offset),
packets[i].length - offset,
packets[i].timing,
actual_info.header
actual_info.header,
i
);
return true;
}
remove(i);
return true;

0 comments on commit ddfd2c1

Please sign in to comment.