nfc_set_setting()
Set one of the NFC user settings that is available to the user from the device.
Synopsis:
#include <nfc/nfc.h>
NFC_API nfc_result_t nfc_set_setting(nfc_settings_t setting, bool enable)
Arguments:
- setting
-
User setting that is available to the user from the device. Valid settings must be of type nfc_settings_t.
- enable
-
The desired value of the specified user setting.
Library:
libnfcDescription:
This function sets the specified value for the specified user setting. It is important to note that restrictions may apply for some user settings; refer to the nfc_settings_t descriptions for more details.
Returns:
NFC_RESULT_SUCCESS, or one of the following:
- NFC_RESULT_SERVICE_CONNECTION_ERROR: The application is not connected to the NFC system.
- NFC_RESULT_LOCKED: The activation request could not be completed as a mode change was already in progress. It is recommended to try calling nfc_set_setting() again.
- NFC_RESULT_RESOURCE_BUSY: A prompt is already being displayed for a setting change; try again later.
- NFC_RESULT_INVALID_PARAMETER: An attempt was made at setting NFC_SETTING_ENABLED to false. NFC can only be disabled from the NFC menu on the device.
- NFC_RESULT_OPERATION_REJECTED: An attempt was made to enable NFC when it is already enabled, or that the calling application was not in the foreground.
- NFC_RESULT_UNSUPPORTED_API: An attempt was made at setting NFC_SETTING_PROMPT_TO_SEND_FILES. This prompt can only be set at the NFC menu on the device.