nfc_launchapp_msg.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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_LAUNCHAPP_MSG_H__
  13. #define NFC_LAUNCHAPP_MSG_H__
  14. /** @file
  15. *
  16. * @defgroup nfc_launch_app_msg Launch app messages
  17. * @{
  18. * @ingroup nfc_ndef_messages
  19. *
  20. * @brief Generation of NFC NDEF messages that can be used to launch apps.
  21. *
  22. */
  23. #include <stdint.h>
  24. #include "nfc_ndef_msg.h"
  25. /** @brief Function for encoding an NFC NDEF launch app message.
  26. *
  27. * This function encodes an NFC NDEF message into a buffer.
  28. *
  29. * @param[in] p_android_package_name Pointer to the Android package name string.
  30. * If NULL, the Android Application Record will be skipped.
  31. * @param[in] android_package_name_length Length of the Android package name.
  32. * @param[in] p_win_app_id Pointer to the Windows application ID string (GUID).
  33. * If NULL, the Windows LaunchApp record will be skipped.
  34. * @param[in] win_app_id_length Length of the Windows application ID.
  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 both p_android_package_name and windows_application_id were
  41. * invalid (equal to NULL).
  42. * @retval NRF_ERROR_NO_MEM If the predicted message size is bigger than the provided
  43. * buffer space.
  44. * @retval Other Other codes might be returned depending on
  45. * the function @ref nfc_ndef_msg_encode
  46. */
  47. ret_code_t nfc_launchapp_msg_encode(uint8_t const * p_android_package_name,
  48. uint8_t android_package_name_length,
  49. uint8_t const * p_win_app_id,
  50. uint8_t win_app_id_length,
  51. uint8_t * p_buf,
  52. uint32_t * p_len);
  53. /**
  54. * @}
  55. */
  56. #endif // NFC_LAUNCHAPP_MSG_H__