mgmt/osdp: Rename pd offset as index
CP has an array of PDs and pd->offset was the position of the PD in CP's list. Since offset has many meanings, rename it to pd->idx. Signed-off-by: Siddharth Chandrasekaran <sidcha.dev@gmail.com>
This commit is contained in:
parent
059abd8d8b
commit
b31e708c03
3 changed files with 5 additions and 5 deletions
|
@ -150,7 +150,7 @@ static struct osdp *osdp_build_ctx(struct osdp_channel *channel)
|
||||||
|
|
||||||
for (i = 0; i < CONFIG_OSDP_NUM_CONNECTED_PD; i++) {
|
for (i = 0; i < CONFIG_OSDP_NUM_CONNECTED_PD; i++) {
|
||||||
pd = TO_PD(ctx, i);
|
pd = TO_PD(ctx, i);
|
||||||
pd->offset = i;
|
pd->idx = i;
|
||||||
pd->seq_number = -1;
|
pd->seq_number = -1;
|
||||||
pd->__parent = ctx;
|
pd->__parent = ctx;
|
||||||
pd->address = pd_adddres[i];
|
pd->address = pd_adddres[i];
|
||||||
|
|
|
@ -415,7 +415,7 @@ struct osdp_secure_channel {
|
||||||
|
|
||||||
struct osdp_pd {
|
struct osdp_pd {
|
||||||
void *__parent;
|
void *__parent;
|
||||||
int offset;
|
int idx;
|
||||||
uint32_t flags;
|
uint32_t flags;
|
||||||
|
|
||||||
/* OSDP specified data */
|
/* OSDP specified data */
|
||||||
|
|
|
@ -407,7 +407,7 @@ static int cp_decode_response(struct osdp_pd *pd, uint8_t *buf, int len)
|
||||||
if (cp->notifier.keypress) {
|
if (cp->notifier.keypress) {
|
||||||
for (i = 0; i < t1; i++) {
|
for (i = 0; i < t1; i++) {
|
||||||
t2 = buf[pos + i]; /* key data */
|
t2 = buf[pos + i]; /* key data */
|
||||||
cp->notifier.keypress(pd->offset, t2);
|
cp->notifier.keypress(pd->idx, t2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ret = OSDP_CP_ERR_NONE;
|
ret = OSDP_CP_ERR_NONE;
|
||||||
|
@ -424,7 +424,7 @@ static int cp_decode_response(struct osdp_pd *pd, uint8_t *buf, int len)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (cp->notifier.cardread) {
|
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;
|
ret = OSDP_CP_ERR_NONE;
|
||||||
break;
|
break;
|
||||||
|
@ -439,7 +439,7 @@ static int cp_decode_response(struct osdp_pd *pd, uint8_t *buf, int len)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (cp->notifier.cardread) {
|
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);
|
buf + pos, t1);
|
||||||
}
|
}
|
||||||
ret = OSDP_CP_ERR_NONE;
|
ret = OSDP_CP_ERR_NONE;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue