Nordic Thingy:52 v2.1.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
NFC driver

Near Field Communnication (NFC) driver API. More...

Functions

ret_code_t drv_nfc_app_launch_android_record_add (char const *const p_android_package_name, uint32_t package_name_length)
 Function for adding an Android Application Record (AAR) to an NDEF NFC message. More...
 
ret_code_t drv_nfc_disable (void)
 Function for disabling NFC. More...
 
ret_code_t drv_nfc_enable (void)
 Function for enabling NFC. More...
 
ret_code_t drv_nfc_init (void)
 Function for initializing NFC. More...
 
ret_code_t drv_nfc_string_record_add (char const *const p_string, uint8_t str_len)
 Function for adding a string record to an NDEF NFC message. More...
 
ret_code_t drv_nfc_uri_record_add (nfc_uri_id_t uri_id, char const *const p_uri, uint32_t uri_length)
 Function for adding a URI record to an NDEF NFC message. More...
 

Detailed Description

Near Field Communnication (NFC) driver API.

Function Documentation

ret_code_t drv_nfc_app_launch_android_record_add ( char const *const  p_android_package_name,
uint32_t  package_name_length 
)

Function for adding an Android Application Record (AAR) to an NDEF NFC message.

Parameters
[in]p_android_package_nameAndroid package (app) name.
[in]package_name_lengthLength of Android package name.
Return values
NRF_SUCCESSIf the record was added successfully.
NRF_ERROR_NULLThe string is NULL.
NRF_ERROR_INVALID_STATEDriver has not been initialized.
NRF_ERROR_INVALID_LENGTHThe length is 1 or 0.
Othererrors from the underlying drivers.
ret_code_t drv_nfc_disable ( void  )

Function for disabling NFC.

Note
This function deletes all stored NDEF records.
Return values
NRF_SUCCESSIf NFC was disabled successfully.
NRF_ERROR_INVALID_STATEDriver has not been initialized or no records have been added.
Othererrors from the underlying drivers.
ret_code_t drv_nfc_enable ( void  )

Function for enabling NFC.

Note
Add the desired records before calling this function.
Return values
NRF_SUCCESSIf NFC was enabled successfully.
Othererrors from the underlying drivers.
ret_code_t drv_nfc_init ( void  )

Function for initializing NFC.

Note
Run init first, add the desired NDEF records, and finally enable NFC.
Return values
NRF_SUCCESSIf NFC was initialized successfully.
Othererrors from the underlying drivers.
ret_code_t drv_nfc_string_record_add ( char const *const  p_string,
uint8_t  str_len 
)

Function for adding a string record to an NDEF NFC message.

Parameters
[in]p_stringPointer to the string.
[in]str_lenLength of the string including NUL ('\0') termination.
Return values
NRF_SUCCESSIf the record was added successfully.
NRF_ERROR_NULLThe string is NULL.
NRF_ERROR_INVALID_STATEDriver has not been initialized.
NRF_ERROR_INVALID_LENGTHThe length is 1 or 0.
Othererrors from the underlying drivers.
ret_code_t drv_nfc_uri_record_add ( nfc_uri_id_t  uri_id,
char const *const  p_uri,
uint32_t  uri_length 
)

Function for adding a URI record to an NDEF NFC message.

Parameters
[in]uri_idURI identifier codes according to "URI Record Type Definition".
[in]p_uriPointer to the string.
[in]uri_lengthLength of the string including NUL ('\0') termination.
Return values
NRF_SUCCESSIf the record was added successfully.
NRF_ERROR_NULLThe string is NULL.
NRF_ERROR_INVALID_STATEDriver has not been initialized.
NRF_ERROR_INVALID_LENGTHThe length is 1 or 0.
Othererrors from the underlying drivers.