Skip to content

Commit

Permalink
pd: Drop check for allowed baud rates in COMSET
Browse files Browse the repository at this point in the history
In the past, the specification used to state explicit baud rates that the
PD can operate in (last, that's how I remember it). Now it just says at
least one of those bauds need to be supported.

This means, LibOSDP is not in the right place to satisfy this
requirement correctly. So we will just transfer this responsibility to
the implementer.

Fixes: #212
Signed-off-by: Siddharth Chandrasekaran <[email protected]>
  • Loading branch information
sidcha committed Jan 10, 2025
1 parent f710b53 commit 4b5f1d5
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/osdp_pd.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,13 +507,7 @@ static int pd_decode_command(struct osdp_pd *pd, uint8_t *buf, int len)
cmd.comset.baud_rate |= buf[pos++] << 8;
cmd.comset.baud_rate |= buf[pos++] << 16;
cmd.comset.baud_rate |= buf[pos++] << 24;
if (cmd.comset.address >= 0x7F ||
(cmd.comset.baud_rate != 9600 &&
cmd.comset.baud_rate != 19200 &&
cmd.comset.baud_rate != 38400 &&
cmd.comset.baud_rate != 57600 &&
cmd.comset.baud_rate != 115200 &&
cmd.comset.baud_rate != 230400)) {
if (cmd.comset.address >= 0x7F) {
LOG_ERR("COMSET Failed! command discarded");
cmd.comset.address = pd->address;
cmd.comset.baud_rate = pd->baud_rate;
Expand Down

0 comments on commit 4b5f1d5

Please sign in to comment.