Shouldn't rx_len be used as loop counter? Otherwise received packed has zero rx_length.
UPD: I see, that rx_len is used below, in CRC check. Ok, then we can't use it in loop. But it is very confusing to get packet in receive callback with zero length. Maybe restore packet->msg.rx_length = rx_len after CRC check?
Shouldn't rx_len be used as loop counter? Otherwise received packed has zero rx_length.
UPD: I see, that rx_len is used below, in CRC check. Ok, then we can't use it in loop. But it is very confusing to get packet in receive callback with zero length. Maybe restore packet->msg.rx_length = rx_len after CRC check?