Skip to content

Commit

Permalink
chore: Fix typo in REPLY_KEYPAD
Browse files Browse the repository at this point in the history
Signed-off-by: Siddharth Chandrasekaran <[email protected]>
  • Loading branch information
sidcha committed Aug 7, 2024
1 parent 3c697a1 commit 53d3cc5
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion doc/protocol/commands-and-replies.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Responses
+--------------------+---------+----------------------------------------------------------+-----------+
| REPLY_FMT | 0x51 | Card Data Report, Character Array | Yes |
+--------------------+---------+----------------------------------------------------------+-----------+
| REPLY_KEYPPAD | 0x53 | Keypad Data Report | Yes |
| REPLY_KEYPAD | 0x53 | Keypad Data Report | Yes |
+--------------------+---------+----------------------------------------------------------+-----------+
| REPLY_COM | 0x54 | Communication Configuration Report | Yes |
+--------------------+---------+----------------------------------------------------------+-----------+
Expand Down
2 changes: 1 addition & 1 deletion src/osdp_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const char *osdp_reply_name(int reply_id)
[REPLY_RSTATR - REPLY_ACK] = "RSTATR",
[REPLY_RAW - REPLY_ACK] = "RAW",
[REPLY_FMT - REPLY_ACK] = "FMT",
[REPLY_KEYPPAD - REPLY_ACK] = "KEYPPAD",
[REPLY_KEYPAD - REPLY_ACK] = "KEYPAD",
[REPLY_COM - REPLY_ACK] = "COM",
[REPLY_BIOREADR - REPLY_ACK] = "BIOREADR",
[REPLY_BIOMATCHR - REPLY_ACK] = "BIOMATCHR",
Expand Down
2 changes: 1 addition & 1 deletion src/osdp_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ union osdp_ephemeral_data {
#define REPLY_RSTATR 0x4B
#define REPLY_RAW 0x50
#define REPLY_FMT 0x51
#define REPLY_KEYPPAD 0x53
#define REPLY_KEYPAD 0x53
#define REPLY_COM 0x54
#define REPLY_BIOREADR 0x57
#define REPLY_BIOMATCHR 0x58
Expand Down
10 changes: 5 additions & 5 deletions src/osdp_cp.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#define REPLY_NAK_DATA_LEN 1
#define REPLY_CCRYPT_DATA_LEN 32
#define REPLY_RMAC_I_DATA_LEN 16
#define REPLY_KEYPPAD_DATA_LEN 2 /* variable length command */
#define REPLY_KEYPAD_DATA_LEN 2 /* variable length command */
#define REPLY_RAW_DATA_LEN 4 /* variable length command */
#define REPLY_FMT_DATA_LEN 3 /* variable length command */
#define REPLY_BUSY_DATA_LEN 0
Expand Down Expand Up @@ -558,14 +558,14 @@ static int cp_decode_response(struct osdp_pd *pd, uint8_t *buf, int len)
pd->baud_rate = temp32;
ret = OSDP_CP_ERR_NONE;
break;
case REPLY_KEYPPAD:
if (len < REPLY_KEYPPAD_DATA_LEN) {
case REPLY_KEYPAD:
if (len < REPLY_KEYPAD_DATA_LEN) {
break;
}
event.type = OSDP_EVENT_KEYPRESS;
event.keypress.reader_no = buf[pos++];
event.keypress.length = buf[pos++];
if ((len - REPLY_KEYPPAD_DATA_LEN) != event.keypress.length) {
if ((len - REPLY_KEYPAD_DATA_LEN) != event.keypress.length) {
break;
}
memcpy(event.keypress.data, buf + pos, event.keypress.length);
Expand Down Expand Up @@ -1022,7 +1022,7 @@ static bool cp_check_online_response(struct osdp_pd *pd)
pd->reply_id == REPLY_MFGREP ||
pd->reply_id == REPLY_RAW ||
pd->reply_id == REPLY_FMT ||
pd->reply_id == REPLY_KEYPPAD) {
pd->reply_id == REPLY_KEYPAD) {
return true;
}
return ISSET_FLAG(pd, OSDP_FLAG_IGN_UNSOLICITED);
Expand Down
4 changes: 2 additions & 2 deletions src/osdp_pd.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ static int pd_translate_event(struct osdp_pd *pd, struct osdp_event *event)
}
break;
case OSDP_EVENT_KEYPRESS:
reply_code = REPLY_KEYPPAD;
reply_code = REPLY_KEYPAD;
break;
case OSDP_EVENT_STATUS:
switch(event->status.type) {
Expand Down Expand Up @@ -785,7 +785,7 @@ static int pd_build_reply(struct osdp_pd *pd, uint8_t *buf, int max_len)
buf[len++] = BIT_IS_SET(event->status.mask, 0); // power
ret = OSDP_PD_ERR_NONE;
break;
case REPLY_KEYPPAD:
case REPLY_KEYPAD:
event = (struct osdp_event *)pd->ephemeral_data;
assert_buf_len(REPLY_KEYPAD_LEN + event->keypress.length, max_len);
buf[len++] = pd->reply_id;
Expand Down

0 comments on commit 53d3cc5

Please sign in to comment.