diff --git a/subsys/mgmt/osdp/src/osdp.c b/subsys/mgmt/osdp/src/osdp.c index 2e06c81775f..22749201eff 100644 --- a/subsys/mgmt/osdp/src/osdp.c +++ b/subsys/mgmt/osdp/src/osdp.c @@ -150,7 +150,7 @@ static struct osdp *osdp_build_ctx(struct osdp_channel *channel) for (i = 0; i < CONFIG_OSDP_NUM_CONNECTED_PD; i++) { pd = TO_PD(ctx, i); - pd->offset = i; + pd->idx = i; pd->seq_number = -1; pd->__parent = ctx; pd->address = pd_adddres[i]; diff --git a/subsys/mgmt/osdp/src/osdp_common.h b/subsys/mgmt/osdp/src/osdp_common.h index ad973f8733d..85e8537201a 100644 --- a/subsys/mgmt/osdp/src/osdp_common.h +++ b/subsys/mgmt/osdp/src/osdp_common.h @@ -415,7 +415,7 @@ struct osdp_secure_channel { struct osdp_pd { void *__parent; - int offset; + int idx; uint32_t flags; /* OSDP specified data */ diff --git a/subsys/mgmt/osdp/src/osdp_cp.c b/subsys/mgmt/osdp/src/osdp_cp.c index ccb2b957847..85fc73eed8d 100644 --- a/subsys/mgmt/osdp/src/osdp_cp.c +++ b/subsys/mgmt/osdp/src/osdp_cp.c @@ -407,7 +407,7 @@ static int cp_decode_response(struct osdp_pd *pd, uint8_t *buf, int len) if (cp->notifier.keypress) { for (i = 0; i < t1; i++) { t2 = buf[pos + i]; /* key data */ - cp->notifier.keypress(pd->offset, t2); + cp->notifier.keypress(pd->idx, t2); } } ret = OSDP_CP_ERR_NONE; @@ -424,7 +424,7 @@ static int cp_decode_response(struct osdp_pd *pd, uint8_t *buf, int len) break; } if (cp->notifier.cardread) { - cp->notifier.cardread(pd->offset, t1, buf + pos, t2); + cp->notifier.cardread(pd->idx, t1, buf + pos, t2); } ret = OSDP_CP_ERR_NONE; break; @@ -439,7 +439,7 @@ static int cp_decode_response(struct osdp_pd *pd, uint8_t *buf, int len) break; } if (cp->notifier.cardread) { - cp->notifier.cardread(pd->offset, OSDP_CARD_FMT_ASCII, + cp->notifier.cardread(pd->idx, OSDP_CARD_FMT_ASCII, buf + pos, t1); } ret = OSDP_CP_ERR_NONE;