Skip to content

Commit

Permalink
phy: Allow multiple mark bytes before SOM
Browse files Browse the repository at this point in the history
The specification requires the transmitting devices to allow an
equivalent of 2 character time as idle time between packets. It also
mentions that it must drive the line to all-high (done by sending 0xFF
over the wire) for a minimum of 1 character width.

The combination of these two should yield a pause of 2 char, and a mark
of 1 char (UART start bit is 0). But some devices my chose to send more
than one mark byte and we will be a bit more lenient to allow this.

Signed-off-by: Siddharth Chandrasekaran <[email protected]>
  • Loading branch information
sidcha committed May 18, 2024
1 parent cf675a0 commit f5def8f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/osdp_phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,15 +346,15 @@ 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;
pd->packet_buf_len = 1;
CLEAR_FLAG(pd, PD_FLAG_PKT_HAS_MARK);
}
break;
} else {
}
if (cur_byte != OSDP_PKT_MARK) {
pd->packet_scan_skip++;
}
prev_byte = cur_byte;
Expand Down

0 comments on commit f5def8f

Please sign in to comment.