diff --git a/doc/protocol/commands-and-replies.rst b/doc/protocol/commands-and-replies.rst index ce8c3ced..59cd77a2 100644 --- a/doc/protocol/commands-and-replies.rst +++ b/doc/protocol/commands-and-replies.rst @@ -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 | +--------------------+---------+----------------------------------------------------------+-----------+ diff --git a/src/osdp_common.c b/src/osdp_common.c index dd64043e..25ff7503 100644 --- a/src/osdp_common.c +++ b/src/osdp_common.c @@ -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", diff --git a/src/osdp_common.h b/src/osdp_common.h index c5e08728..ad78c994 100644 --- a/src/osdp_common.h +++ b/src/osdp_common.h @@ -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 diff --git a/src/osdp_cp.c b/src/osdp_cp.c index 37a13ebb..1772388c 100644 --- a/src/osdp_cp.c +++ b/src/osdp_cp.c @@ -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 @@ -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); @@ -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); diff --git a/src/osdp_pd.c b/src/osdp_pd.c index bc00753b..c79ae208 100644 --- a/src/osdp_pd.c +++ b/src/osdp_pd.c @@ -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) { @@ -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;