/* Function for generating a description of an NFC NDEF URI message. 
This function declares and initializes a static instance of an NFC NDEF message description and NFC NDEF records descriptions. */
static ret_code_t nfc_uri_msg_declare(nfc_uri_id_t uri_id_code, uint8_t const *const p_uri_data, uint8_t uri_data_len, nfc_ndef_msg_desc_t **pp_uri_msg_desc)
/* Function for generating a description of an NFC NDEF URI message. 
This function declares and initializes a static instance of an NFC NDEF message description and NFC NDEF records descriptions. */
static ret_code_t nfc_uri_msg_declare(nfc_uri_id_t uri_id_code, uint8_t const *const p_uri_data, uint8_t uri_data_len, nfc_ndef_msg_desc_t **pp_uri_msg_desc)
{
    ret_code_t               err_code;
    nfc_ndef_record_desc_t * p_uri_rec;
    NFC_NDEF_MSG_DEF(nfc_uri_msg, 1);
    nfc_ndef_msg_clear(&NFC_NDEF_MSG(nfc_uri_msg));
    if(p_uri_data != NULL)
    {
        p_uri_rec = nfc_uri_rec_declare(uri_id_code,
                                        p_uri_data,
                                        uri_data_len);
        err_code = nfc_ndef_msg_record_add(&NFC_NDEF_MSG(nfc_uri_msg), p_uri_rec);
        if (err_code != NRF_SUCCESS)
        {
            return err_code;
        }
    }
    else
    {
        return NRF_ERROR_INVALID_PARAM;
    }
    *pp_uri_msg_desc = &NFC_NDEF_MSG(nfc_uri_msg);
    return NRF_SUCCESS;
}