nfc_uri_msg.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* Copyright (c) 2015 Nordic Semiconductor. All Rights Reserved.
  2. *
  3. * The information contained herein is property of Nordic Semiconductor ASA.
  4. * Terms and conditions of usage are described in detail in NORDIC
  5. * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
  6. *
  7. * Licensees are granted free, non-transferable use of the information. NO
  8. * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
  9. * the file.
  10. *
  11. */
  12. #ifndef NFC_URI_MSG_H__
  13. #define NFC_URI_MSG_H__
  14. /**@file
  15. *
  16. * @defgroup nfc_uri_msg URI messages
  17. * @{
  18. * @ingroup nfc_ndef_messages
  19. *
  20. * @brief Generation of NFC NDEF messages with a URI record.
  21. *
  22. */
  23. #include "nfc_ndef_msg.h"
  24. #include "nfc_uri_rec.h"
  25. #include "nrf_error.h"
  26. /** @brief Function for encoding an NFC NDEF URI message.
  27. *
  28. * This function encodes an NFC NDEF message into a buffer.
  29. *
  30. * @param[in] uri_id_code URI identifier code that defines the protocol field of the URI.
  31. * @param[in] p_uri_data Pointer to the URI string.
  32. * The string should not contain the protocol field if the protocol
  33. * was specified in @p uri_id_code.
  34. * @param[in] uri_data_len Length of the URI string.
  35. * @param[out] p_buf Pointer to the buffer for the message.
  36. * @param[in,out] p_len Size of the available memory for the message as input.
  37. * Size of the generated message as output.
  38. *
  39. * @retval NRF_SUCCESS If the description was successfully created.
  40. * @retval NRF_ERROR_INVALID_PARAM If the URI string was invalid (equal to NULL).
  41. * @retval NRF_ERROR_NO_MEM If the predicted message size is bigger than the provided
  42. * buffer space.
  43. * @retval Other Other codes might be returned depending on
  44. * the function @ref nfc_ndef_msg_encode.
  45. */
  46. ret_code_t nfc_uri_msg_encode( nfc_uri_id_t uri_id_code,
  47. uint8_t const * const p_uri_data,
  48. uint8_t uri_data_len,
  49. uint8_t * p_buf,
  50. uint32_t * p_len);
  51. /**
  52. * @}
  53. */
  54. #endif // NFC_URI_MSG_H__