Merge 822f0cd6e1623ec102b15ba7d58127520feb52a9 into 216145fba522a8eaefc5c751b8c10198376bc066

This commit is contained in:
Garrett Davidson 2018-03-28 01:01:03 +00:00 committed by GitHub
commit 4f73054026
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 0 deletions

View File

@ -141,6 +141,7 @@ NFC_EXPORT uint8_t *iso14443a_locate_historical_bytes(uint8_t *pbtAts, size_t sz
NFC_EXPORT void nfc_free(void *p);
NFC_EXPORT const char *nfc_version(void);
NFC_EXPORT int nfc_device_get_information_about(nfc_device *pnd, char **buf);
NFC_EXPORT uint8_t nfc_device_get_last_status(const nfc_device *pnd);
/* String converter functions */
NFC_EXPORT const char *str_nfc_modulation_type(const nfc_modulation_type nmt);

View File

@ -3715,3 +3715,9 @@ pn53x_data_free(struct nfc_device *pnd)
}
free(pnd->chip_data);
}
uint8_t
get_last_status(const struct nfc_device *pnd)
{
return CHIP_DATA(pnd)->last_status_byte;
}

View File

@ -225,4 +225,6 @@ void prepare_initiator_data(const nfc_modulation nm, uint8_t **ppbtInitiatorData
int connstring_decode(const nfc_connstring connstring, const char *driver_name, const char *bus_name, char **pparam1, char **pparam2);
uint8_t get_last_status(const nfc_device *pnd);
#endif // __NFC_INTERNAL_H__

View File

@ -1310,6 +1310,17 @@ nfc_device_get_information_about(nfc_device *pnd, char **buf)
HAL(device_get_information_about, pnd, buf);
}
/** @ingroup misc
* @brief Get the status byte returned for the last command run on the device
* @return Returns the status byte of the last run command
* @param pnd \a nfc_device struct pointer that represent currently used device
*/
uint8_t
nfc_device_get_last_status(const nfc_device *pnd)
{
return get_last_status(pnd);
}
/** @ingroup string-converter
* @brief Convert \a nfc_baud_rate value to string
* @return Returns nfc baud rate