diff --git a/src/osdp_phy.c b/src/osdp_phy.c index ff4743b..dc469fe 100644 --- a/src/osdp_phy.c +++ b/src/osdp_phy.c @@ -346,7 +346,6 @@ static int phy_check_header(struct osdp_pd *pd) buf[0] = OSDP_PKT_MARK; buf[1] = OSDP_PKT_SOM; pd->packet_buf_len = 2; - pd->packet_scan_skip--; SET_FLAG(pd, PD_FLAG_PKT_HAS_MARK); } else { buf[0] = OSDP_PKT_SOM; @@ -354,7 +353,8 @@ static int phy_check_header(struct osdp_pd *pd) CLEAR_FLAG(pd, PD_FLAG_PKT_HAS_MARK); } break; - } else { + } + if (cur_byte != OSDP_PKT_MARK) { pd->packet_scan_skip++; } prev_byte = cur_byte;