nfc_event_type_t

This enumeration defines event codes for the various NFC events.

Synopsis:

#include <nfc/nfc_types.h>

typedef enum {
      NFC_SNEP_CONNECTION_EVENT = 1   
      NFC_TAG_READWRITE_EVENT = 2   
      NFC_HANDOVER_DETECTED_EVENT = 3   
      NFC_HANDOVER_COMPLETE_EVENT = 4   
      NFC_LLCP_CONNECTION_EVENT = 5   
      NFC_OFF_EVENT = 6   
      NFC_ON_EVENT = 7   
      NFC_FIELD_LOST_EVENT = 8   
      NFC_FIELD_DETECTED_EVENT = 9   
      NFC_VIRTUAL_TAG_SELECTION_EVENT = 10   
      NFC_VIRTUAL_TAG_LEFT_EVENT = 11   
      NFC_VIRTUAL_TAG_READ_EVENT = 12   
      NFC_VIRTUAL_TAG_WRITE_EVENT = 13   
      NFC_NDEF_PUSH_SUCCEED_EVENT = 20   
      NFC_NDEF_PUSH_FAILURE_MSG_OVER_SIZE_EVENT = 21   
      NFC_NDEF_PUSH_FAILURE_REJECTED_EVENT = 22   
      NFC_NDEF_PUSH_FAILURE_IO_ERROR_EVENT = 23   
      NFC_NDEF_PUSH_FAILURE_VERSION_MISMATCH_EVENT = 24   
      NFC_HANDOVER_FAILURE_NO_TRANSPORT_EVENT = 30   
      NFC_HANDOVER_FAILURE_VERSION_MISMATCH_EVENT = 31   
      NFC_HANDOVER_FAILURE_DURING_VERSION_NEGOTIATION_EVENT = 33   
      NFC_ISO14443_4_COMMAND_EVENT = 40   
      NFC_ISO14443_4_EVENT_CODE_EVENT = 41   
      NFC_LLCP_READ_COMPLETE_EVENT = 42   
      NFC_LLCP_WRITE_COMPLETE_EVENT = 43   
      NFC_CE_ENABLE_BACKLIGHT_OFF_EVENT = 44   
      NFC_CE_ENABLE_POWERED_OFF_EVENT = 45   
      NFC_CE_DISABLE_BACKLIGHT_OFF_EVENT = 46   
      NFC_CE_DISABLE_POWERED_OFF_EVENT = 47   
      NFC_CE_SET_UICC_ACTIVE_SE_TYPE_EVENT = 48   
      NFC_TARGET_LOST_EVENT = 49   
      NFC_SETTING_ENABLED_ASYNC_EVENT = 50   
      NFC_CHANNEL_ERROR_EVENT = 60   
} nfc_event_type_t;

Since:

BlackBerry 10.0.0

Data:

NFC_SNEP_CONNECTION_EVENT
A SNEP connection is detected and ready for sending an NDEF message to NFC-enabled device.

You can retrieve the target by calling nfc_get_target().

NFC_TAG_READWRITE_EVENT
An NFC tag target is detected and ready to read from or write to.

You can retrieve the target by calling nfc_get_target().

NFC_HANDOVER_DETECTED_EVENT
An NFC connection handover target is detected and ready for the handover negotiation process to start.

The application retrieves the target by calling nfc_get_target() and informs the NFC system whether the application wants to proceed with the handover or ignore the target.

NFC_HANDOVER_COMPLETE_EVENT
An NFC connection handover negotiation was completed.

You can call the nfc_get_target() function to retrieve handover details from the target containing connection handover details.

NFC_LLCP_CONNECTION_EVENT
An Logical Link Control Protocol (LLCP) connection has been detected and is ready for communication.

You can call the nfc_get_target() function to retrieve the LLCP connection.

NFC_OFF_EVENT
The NFC system is off.

No further NFC events will be delivered.

No value is returned as part of this event.

NFC_ON_EVENT
The NFC system is on.

No value is returned as part of this event.

NFC_FIELD_LOST_EVENT
An external field was lost.

No value is returned as part of this event.

NFC_FIELD_DETECTED_EVENT
An external field was detected.

No value is returned as part of this event.

NFC_VIRTUAL_TAG_SELECTION_EVENT
The emulated NDEF tag has been selected by a remote reader device.

No value is returned as part of this event.

NFC_VIRTUAL_TAG_LEFT_EVENT
The NDEF tag emulation detects that the remote reader device has left the field.

No value is returned as part of this event.

NFC_VIRTUAL_TAG_READ_EVENT
A remote reader device has read from the emulated NDEF tag.

Feature set 2 does not support this event.

No value is returned as part of this event.

NFC_VIRTUAL_TAG_WRITE_EVENT
The emulated NDEF tag has been written to by a remote reader device.

No value is returned as part of this event.

This event has been defined for the sake of completeness. Since NDEF tags are emulated only in read-only mode, it is not possible to write to an emulated NDEF tag; hence this event will never be sent to the client.

NFC_NDEF_PUSH_SUCCEED_EVENT
The NDEF message has been successfully pushed to the remote device.

No value is returned as part of this event.

NFC_NDEF_PUSH_FAILURE_MSG_OVER_SIZE_EVENT
The remote device has rejected the NDEF push message because the message is too large.

No value is returned as part of this event.

NFC_NDEF_PUSH_FAILURE_REJECTED_EVENT
The remote device has rejected the NDEF push message.

No value is returned as part of this event.

NFC_NDEF_PUSH_FAILURE_IO_ERROR_EVENT
The NDEF message push failed because of the I/O error.

No value is returned as part of this event.

NFC_NDEF_PUSH_FAILURE_VERSION_MISMATCH_EVENT
The NDEF message push failed because of version mismatch.

No value is returned as part of this event.

Since: BlackBerry 10.2.0

NFC_HANDOVER_FAILURE_NO_TRANSPORT_EVENT
The NFC connection handover negotiation failed because the transport is not supported.
Use the nfc_get_notification_value() function to retrieve the following nfc_handover_failure_reason_t values as part of this event code:
NFC_HANDOVER_FAILURE_VERSION_MISMATCH_EVENT
The NFC connection handover negotiation failed because the handover version used is not supported.

No value is returned as part of this event.

Since: BlackBerry 10.2.0

NFC_HANDOVER_FAILURE_DURING_VERSION_NEGOTIATION_EVENT
The NFC connection handover negotiation failed due to an error during version negotiation.

This means that the request message was either not received or not valid.

No value is returned as part of this event.

Since: BlackBerry 10.3.0

NFC_ISO14443_4_COMMAND_EVENT
The NFC ISO14443_4 command event.

You can retrieve the target by calling nfc_get_target().

NFC_ISO14443_4_EVENT_CODE_EVENT
The NFC ISO14443_4 command event code.
Use the nfc_get_notification_value() function to retrieve the following iso14443_4_event_t values as part of this event code:
NFC_LLCP_READ_COMPLETE_EVENT
The NFC LLCP read complete event code.

You can retrieve the target by calling nfc_get_target().

NFC_LLCP_WRITE_COMPLETE_EVENT
The NFC LLCP write complete event code.

You can retrieve the target by calling nfc_get_target().

NFC_CE_ENABLE_BACKLIGHT_OFF_EVENT
A programmatic attempt to enable the "Allow Card Transactions When locked or backlight is off" user setting.
Use the nfc_get_notification_value() function to retrieve the following nfc_result_t values as part of this event code:
NFC_CE_ENABLE_POWERED_OFF_EVENT
A programmatic attempt to enable the "Allow Card Transactions When device is turned off" user setting.
Use the nfc_get_notification_value() function to retrieve the following nfc_result_t values as part of this event code:
NFC_CE_DISABLE_BACKLIGHT_OFF_EVENT
A programmatic attempt to disable the "Allow Card Transactions When locked or backlight is off" user setting.
Use the nfc_get_notification_value() function to retrieve the following nfc_result_t values as part of this event code:
NFC_CE_DISABLE_POWERED_OFF_EVENT
A programmatic attempt to disable the "Allow Card Transactions When device is turned off" user setting.
Use the nfc_get_notification_value() function to retrieve the following nfc_result_t values as part of this event code:
NFC_CE_SET_UICC_ACTIVE_SE_TYPE_EVENT
A programmatic attempt to set the UICC as the active secure element.
Use the nfc_get_notification_value() function to retrieve the following nfc_result_t values as part of this event code:
  • NFC_RESULT_SUCCESS: The change was successful as the active secure element was already the UICC or the user allowed the active secure element to become the UICC.
  • NFC_RESULT_SE_NOT_PRESENT: The change was unsuccessful as no UICC secure element was detected.
  • NFC_RESULT_OPERATION_REJECTED: The user denied the request to change the active secure element to the UICC.
NFC_TARGET_LOST_EVENT
An NFC target is no longer being detected within the NFC field.

Use the nfc_get_notification_value() function to retrieve the target connection id.

NFC_SETTING_ENABLED_ASYNC_EVENT
A programmatic attempt to enable the "NFC Connectivity" user setting.
Use the nfc_get_notification_value() function to retrieve the following nfc_result_t values as part of this event code:

Since: BlackBerry 10.2.0

NFC_CHANNEL_ERROR_EVENT
An error occurred on the communication channel.
Use the nfc_get_notification_value() function to retrieve the following nfc_result_t values as part of this event code:

Since: BlackBerry 10.3.0

Library:

libnfc (For the qcc command, use the -l nfc option to link against this library)

Description:

The event codes can be associated with the following values:

The nfc_get_target() function and the nfc_get_notification_value() function will return NFC_RESULT_INVALID_PARAMETER if called with an event code that is not associated with a corresponding value.

Last modified: 2015-04-16



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus