Minor tweaks.

- Rename the nfc_device_t's struct iErrorCode member to iPICCError (We are
    likely to have both PICC and PCD errors fields to avoid unneeded complexity
    at some point);
  - Make the PN53x error descriptions static;
  - Enhance some comments here and there.
This commit is contained in:
Romain Tartiere 2010-08-13 08:31:16 +00:00
parent b289784359
commit 0502401a29
3 changed files with 10 additions and 10 deletions

View file

@ -121,13 +121,13 @@ bool pn53x_transceive(nfc_device_t* pnd, const byte_t* pbtTx, const size_t szTxL
case 0x90: // TgResponseToInitiator
case 0x92: // TgSetGeneralBytes
case 0x94: // TgSetMetaData
pnd->iErrorCode = pbtRx[0] & 0x3f;
pnd->iPICCError = pbtRx[0] & 0x3f;
break;
default:
pnd->iErrorCode = 0;
pnd->iPICCError = 0;
}
return (0 == pnd->iErrorCode);
return (0 == pnd->iPICCError);
}
byte_t pn53x_get_reg(nfc_device_t* pnd, uint16_t ui16Reg)
@ -378,7 +378,7 @@ pn53x_InRelease(nfc_device_t* pnd, const uint8_t ui8Target)
return(pn53x_transceive(pnd,abtCmd,sizeof(abtCmd),NULL,NULL));
}
struct sErrorMessage {
static struct sErrorMessage {
int iErrorCode;
const char *pcErrorMsg;
} sErrorMessages[] = {
@ -421,7 +421,7 @@ pn53x_strerror (const nfc_device_t *pnd)
size_t i;
for (i=0; i < (sizeof (sErrorMessages) / sizeof (struct sErrorMessage)); i++) {
if (sErrorMessages[i].iErrorCode == pnd->iErrorCode) {
if (sErrorMessages[i].iErrorCode == pnd->iPICCError) {
pcRes = sErrorMessages[i].pcErrorMsg;
break;
}