| Nordic Thingy:52 v2.0.0

Functions
NFC driver
Drivers

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

## ◆ drv_nfc_app_launch_android_record_add()

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_name | Android package (app) name.
  [in] | package_name_length | Length of Android package name.

Return values

  NRF_SUCCESS | If the record was added successfully.
  NRF_ERROR_NULL | The string is NULL.
  NRF_ERROR_INVALID_STATE | Driver has not been initialized.
  NRF_ERROR_INVALID_LENGTH | The length is 1 or 0.
  Other | errors from the underlying drivers.

## ◆ drv_nfc_disable()

ret_code_t drv_nfc_disable | ( | void |  | ) |

Function for disabling NFC.

Note
  This function deletes all stored NDEF records.

Return values

  NRF_SUCCESS | If NFC was disabled successfully.
  NRF_ERROR_INVALID_STATE | Driver has not been initialized or no records have been added.
  Other | errors from the underlying drivers.

## ◆ drv_nfc_enable()

ret_code_t drv_nfc_enable | ( | void |  | ) |

Function for enabling NFC.

Note
  Add the desired records before calling this function.

Return values

  NRF_SUCCESS | If NFC was enabled successfully.
  Other | errors from the underlying drivers.

## ◆ drv_nfc_init()

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_SUCCESS | If NFC was initialized successfully.
  Other | errors from the underlying drivers.

## ◆ drv_nfc_string_record_add()

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_string | Pointer to the string.
  [in] | str_len | Length of the string including NUL ('\0') termination.

Return values

  NRF_SUCCESS | If the record was added successfully.
  NRF_ERROR_NULL | The string is NULL.
  NRF_ERROR_INVALID_STATE | Driver has not been initialized.
  NRF_ERROR_INVALID_LENGTH | The length is 1 or 0.
  Other | errors from the underlying drivers.

## ◆ drv_nfc_uri_record_add()

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_id | URI identifier codes according to "URI Record Type Definition".
  [in] | p_uri | Pointer to the string.
  [in] | uri_length | Length of the string including NUL ('\0') termination.

Return values

  NRF_SUCCESS | If the record was added successfully.
  NRF_ERROR_NULL | The string is NULL.
  NRF_ERROR_INVALID_STATE | Driver has not been initialized.
  NRF_ERROR_INVALID_LENGTH | The length is 1 or 0.
  Other | errors from the underlying drivers.