+ if self.packet_full {
+ continue;
+ }
+ let mut pending = PendingPacket::new();
+ let mut payload = [0u8; 855];
+ let Ok(len) = kiss_frame.decode_payload(&mut payload) else {
+ continue;
+ };
+ if len < 33 {
+ continue;
+ }
+ let mut lsf = LsfFrame([0u8; 30]);
+ lsf.0.copy_from_slice(&payload[0..30]);
+ if lsf.check_crc() != 0 {
+ continue;
+ }
+ pending.lsf = Some(lsf);
+ let app_data_len = len - 30;
+ pending.app_data[0..app_data_len].copy_from_slice(&payload[30..]);
+ pending.app_data_len = app_data_len;
+ self.packet_queue[self.packet_next] = pending;
+ self.packet_next = (self.packet_next + 1) % 4;
+ if self.packet_next == self.packet_curr {
+ self.packet_full = true;
+ }