/* Function for constructing the payload for a Bluetooth Carrier Configuration LE record. 
This function encodes the record payload according to the BLE AD structure. It implements an API compatible with p_payload_constructor_t */
static ret_code_t nfc_le_oob_payload_constructor(ble_advdata_t *p_ble_advdata, uint8_t *p_buff, uint32_t *p_len)
/* Function for constructing the payload for a Bluetooth Carrier Configuration LE record. 
This function encodes the record payload according to the BLE AD structure. It implements an API compatible with p_payload_constructor_t */
static ret_code_t nfc_le_oob_payload_constructor(ble_advdata_t *p_ble_advdata, uint8_t *p_buff, uint32_t *p_len)
{
    ret_code_t err_code = NRF_SUCCESS;
    err_code = nfc_le_oob_adv_data_check(p_ble_advdata);
    if(NRF_SUCCESS != err_code)
    {
        return err_code;
    }
    uint16_t buff_len = *p_len;
    if(*p_len > UINT16_MAX)
    {
        buff_len = UINT16_MAX;
    }
    err_code = adv_data_encode(p_ble_advdata, p_buff, &buff_len);
    *p_len = (uint32_t) buff_len;
    return err_code;
}