Commit 68c70788 authored by Szymon Janc's avatar Szymon Janc Committed by Johan Hedberg
Browse files

Bluetooth: Fail if advertise with unsupported address type



This allows to gracefully handle case when privacy is not enabled.

Change-Id: I3f4ebafd05abe186212b554161d8a8982f58ff45
Signed-off-by: default avatarSzymon Janc <ext.szymon.janc@tieto.com>
parent ac7a43a1
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -3445,9 +3445,11 @@ int bt_le_adv_start(const struct bt_le_adv_param *param,
		set_param->own_addr_type = BT_ADDR_LE_RANDOM;
		break;
#endif /* CONFIG_BLUETOOTH_PRIVACY */
	default:
	case BT_LE_ADV_ADDR_IDENTITY:
		set_param->own_addr_type = bt_dev.id_addr.type;
		break;
	default:
		return -EINVAL;
	}

	err = bt_hci_cmd_send_sync(BT_HCI_OP_LE_SET_ADV_PARAM, buf, NULL);