This enumeration specifies the types of user settings that are available from the NFC menu on the device.
#include <nfc/nfc.h>
typedef enum {
NFC_SETTING_ENABLED = 0
NFC_SETTING_CE_BACKLIGHT_OFF = 1
NFC_SETTING_CE_POWERED_OFF = 2
NFC_SETTING_PROMPT_TO_SEND_FILES = 3
NFC_SETTING_ENABLED_ASYNC = 4
} nfc_settings_t;
BlackBerry 10.0.0
This setting is reflected to the user as "NFC Connectivity" menu from the device.
It is important to note that NFC_SETTING_ENABLED can be set to true, but not to false, by using the nfc_set_setting() function. An attempt to set NFC_SETTING_ENABLED to false through this function will result in an error of NFC_RESULT_INVALID_PARAMETER. NFC cannot be turned off programmatically; NFC remains enabled until the user explicitly disables NFC from the NFC menu on the device.
Enabling NFC_SETTING_ENABLED from the nfc_set_setting() function will trigger a prompt to be displayed on the device to request permission to modify this user setting. If NFC_SETTING_ENABLED is already enabled, no prompt will be displayed. The nfc_set_setting() function blocks the caller until the user makes a selection. If you don't want a blocking call, you can use the NFC_SETTING_ENABLED_ASYNC variant with nfc_set_setting().
This user setting is reflected to the user as "Allow NFC Card Transactions When locked or backlight is off" from the NFC menu on the device.
An application attempting to change this setting must currently be in the foreground.
Enabling NFC_SETTING_CE_BACKLIGHT_OFF from the nfc_set_setting() function will trigger a prompt to be displayed on the device to request permission to modify this user setting. If NFC_SETTING_CE_BACKLIGHT_OFF is already enabled, no prompt will be displayed.
Disabling NFC_SETTING_CE_BACKLIGHT_OFF from the nfc_set_setting() function will trigger a prompt to be displayed on the device to request permission to modify this user setting. If NFC_SETTING_CE_POWERED_OFF is enabled, then the user prompt will additionally request permission to disable both NFC_SETTING_CE_BACKLIGHT_OFF and NFC_SETTING_CE_POWERED_OFF at the same time. If NFC_SETTING_CE_BACKLIGHT_OFF is already disabled, no prompt will be displayed.
Use the nfc_get_notification_value() function to retrieve the return code from either the NFC_CE_ENABLE_BACKLIGHT_OFF_EVENT or the NFC_CE_DISABLE_BACKLIGHT_OFF_EVENT notification.
An application attempting to change this setting must currently be in the foreground.
This user setting is represented by "Allow NFC Card Transactions When device is turned off" from the NFC menu on the device. Note that in order for this user setting to be enabled, "Allow NFC Card Transactions When locked or backlight is off" must also be enabled.
The user will be prompted by a display on the device to permit modification to this user setting if you are setting a value that is different from the current value of this setting. If the user permits this change, then Card Transactions while the device is powered off will reflect the settings change at once.
Enabling NFC_SETTING_CE_POWERED_OFF from the nfc_set_setting() function will trigger a prompt to be displayed on the device to request permission to modify this user setting. If NFC_SETTING_CE_BACKLIGHT_OFF is disabled, then the user prompt will additionally request permission to enable both NFC_SETTING_CE_BACKLIGHT_OFF and NFC_SETTING_CE_POWERED_OFF at the same time. If NFC_SETTING_CE_POWERED_OFF is already enabled, no prompt will be displayed.
Disabling NFC_SETTING_CE_POWERED_OFF from the nfc_set_setting() function will trigger a prompt to be displayed on the device to request permission to modify this user setting. If NFC_SETTING_CE_POWERED_OFF is already disabled, no prompt will be displayed.
Use the nfc_get_notification_value() function to retrieve the return code from either the NFC_CE_ENABLE_POWERED_OFF_EVENT or the NFC_CE_DISABLE_POWERED_OFF_EVENT notification.
This user setting can be changed only by the user from the NFC menu on the device. It cannot be changed using the nfc_set_setting() function.
This is the asynchronous variant of NFC_SETTING_ENABLED and may be used in conjunction with nfc_set_setting().
Enabling NFC_SETTING_ENABLED_ASYNC from the nfc_set_setting() function will trigger a prompt to be displayed on the device to request permission to modify this user setting. If NFC_SETTING_ENABLED_ASYNC is already enabled, no prompt will be displayed.
An attempt to call NFC_SETTING_ENABLED_ASYNC from the nfc_get_setting() function will result in an error of NFC_RESULT_INVALID_PARAMETER.
It is important to note that NFC_SETTING_ENABLED_ASYNC can be set to true, but not to false, by using the nfc_set_setting() function. An attempt to set NFC_SETTING_ENABLED_ASYNC to false through this function will result in an error of NFC_RESULT_INVALID_PARAMETER. NFC cannot be turned off programmatically; NFC remains enabled until the user explicitly disables NFC from the NFC menu on the device.
Use the nfc_get_notification_value() function to retrieve the return code from the NFC_SETTING_ENABLED_ASYNC_EVENT notification.
Since: BlackBerry 10.2.0