/* Helper function to add payload data to extended advertising PDU.  */
static void common_pdu_adv_data_set(struct pdu_adv *pdu, const uint8_t *data, uint8_t len)
/* Helper function to add payload data to extended advertising PDU.  */
static void common_pdu_adv_data_set(struct pdu_adv *pdu, const uint8_t *data, uint8_t len)
{
	struct pdu_adv_com_ext_adv *com_hdr;
	uint8_t len_max;
	uint8_t *dptr;
	com_hdr = &pdu->adv_ext_ind;
	dptr = &com_hdr->ext_hdr_adv_data[com_hdr->ext_hdr_len];
	len_max = PDU_AC_PAYLOAD_SIZE_MAX - (dptr - pdu->payload);
	zassert_false(len > len_max,
		      "Provided data length exceeds maximum supported payload length: %" PRIu8,
		      len_max);
	memcpy(dptr, data, len);
	dptr += len;
	pdu->len = dptr - pdu->payload;
}