nfc_device_is_equal_data

Function nfc_device_is_equal_data 

Source
pub unsafe extern "C" fn nfc_device_is_equal_data(
    instance: *const NfcDevice,
    protocol: NfcProtocol,
    protocol_data: *const NfcDeviceData,
) -> bool
Expand description

Check whether an NfcDevice instance holds certain data.

This function’s behaviour is similar to nfc_device_is_equal(), with the difference that it takes NfcProtocol and NfcDeviceData* instead of the second NfcDevice*.

The following code snippets [1] and [2] are equivalent:

[1]

bool is_equal = nfc_device_is_equal(device1, device2);

[2]

NfcProtocol protocol = nfc_device_get_protocol(device2);
const NfcDeviceData* data = nfc_device_get_data(device2, protocol);
bool is_equal = nfc_device_is_equal_data(device1, protocol, data);

§Arguments

  • instance (direction in) - pointer to the instance to be compared.
  • protocol (direction in) - protocol identifier of the data to be compared.
  • protocol_data (direction in) - pointer to the NFC device data to be compared.

§Returns

true if the instance is of the right type and the data matches, false otherwise.