Commit c088b028 authored by Andrzej Kaczmarek's avatar Andrzej Kaczmarek Committed by Carles Cufi
Browse files

Bluetooth: controller: Fix error code on invalid adv set handle



Proper error code should be returned if advertising set with given
handle does not exist instead of generic "invalid parameters" one.

Signed-off-by: default avatarAndrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
parent 5f8dd00a
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ uint8_t ll_adv_aux_random_addr_set(uint8_t handle, uint8_t const *const addr)

	adv = ull_adv_is_created_get(handle);
	if (!adv) {
		return BT_HCI_ERR_CMD_DISALLOWED;
		return BT_HCI_ERR_UNKNOWN_ADV_IDENTIFIER;
	}

	/* TODO: Fail if connectable advertising is enabled */
@@ -117,7 +117,7 @@ uint8_t ll_adv_aux_ad_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, ui
	/* Get the advertising set instance */
	adv = ull_adv_is_created_get(handle);
	if (!adv) {
		return BT_HCI_ERR_CMD_DISALLOWED;
		return BT_HCI_ERR_UNKNOWN_ADV_IDENTIFIER;
	}

	lll = &adv->lll;
@@ -517,7 +517,7 @@ uint8_t ll_adv_aux_sr_data_set(uint8_t handle, uint8_t op, uint8_t frag_pref, ui
	/* Get the advertising set instance */
	adv = ull_adv_is_created_get(handle);
	if (!adv) {
		return BT_HCI_ERR_CMD_DISALLOWED;
		return BT_HCI_ERR_UNKNOWN_ADV_IDENTIFIER;
	}

	lll = &adv->lll;
+2 −2
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ uint8_t ll_adv_sync_param_set(uint8_t handle, uint16_t interval, uint16_t flags)

	adv = ull_adv_is_created_get(handle);
	if (!adv) {
		return BT_HCI_ERR_CMD_DISALLOWED;
		return BT_HCI_ERR_UNKNOWN_ADV_IDENTIFIER;
	}

	lll_sync = adv->lll.sync;
@@ -532,7 +532,7 @@ uint8_t ll_adv_sync_enable(uint8_t handle, uint8_t enable)

	adv = ull_adv_is_created_get(handle);
	if (!adv) {
		return BT_HCI_ERR_CMD_DISALLOWED;
		return BT_HCI_ERR_UNKNOWN_ADV_IDENTIFIER;
	}

	lll_sync = adv->lll.sync;