Skip to content

Commit

Permalink
Merge pull request nfc-tools#590 from AdamLaurie/master
Browse files Browse the repository at this point in the history
add debugging for high level config requests
  • Loading branch information
AdamLaurie authored Apr 4, 2020
2 parents f8b2852 + 2a6a8e6 commit 8a1e149
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions libnfc/nfc.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,25 @@ struct nfc_driver_list {

const struct nfc_driver_list *nfc_drivers = NULL;

// descritions for debugging
const char * nfc_property_name[] = {
"NP_TIMEOUT_COMMAND",
"NP_TIMEOUT_ATR",
"NP_TIMEOUT_COM",
"NP_HANDLE_CRC",
"NP_HANDLE_PARITY",
"NP_ACTIVATE_FIELD",
"NP_ACTIVATE_CRYPTO1",
"NP_INFINITE_SELECT",
"NP_ACCEPT_INVALID_FRAMES",
"NP_ACCEPT_MULTIPLE_FRAMES",
"NP_AUTO_ISO14443_4",
"NP_EASY_FRAMING",
"NP_FORCE_ISO14443_A",
"NP_FORCE_ISO14443_B",
"NP_FORCE_SPEED_106"
};

static void
nfc_drivers_init(void)
{
Expand Down Expand Up @@ -409,6 +428,7 @@ nfc_list_devices(nfc_context *context, nfc_connstring connstrings[], const size_
int
nfc_device_set_property_int(nfc_device *pnd, const nfc_property property, const int value)
{
log_put(LOG_GROUP, LOG_CATEGORY, NFC_LOG_PRIORITY_DEBUG, "set_property_int %s %s", nfc_property_name[property], value ? "True" : "False");
HAL(device_set_property_int, pnd, property, value);
}

Expand All @@ -428,6 +448,7 @@ nfc_device_set_property_int(nfc_device *pnd, const nfc_property property, const
int
nfc_device_set_property_bool(nfc_device *pnd, const nfc_property property, const bool bEnable)
{
log_put(LOG_GROUP, LOG_CATEGORY, NFC_LOG_PRIORITY_DEBUG, "set_property_bool %s %s", nfc_property_name[property], bEnable ? "True" : "False");
HAL(device_set_property_bool, pnd, property, bEnable);
}

Expand Down

0 comments on commit 8a1e149

Please sign in to comment.