static void device_flags_changed_callback(uint16_t index, uint16_t length,
					  const void *param, void *user_data)
{
	const struct mgmt_ev_device_flags_changed *ev = param;
	struct btd_adapter *adapter = user_data;
	struct btd_device *dev;
	char addr[18];

	if (length < sizeof(*ev)) {
		btd_error(adapter->dev_id,
			  "Too small Device Flags Changed event: %d",
			  length);
		return;
	}

	ba2str(&ev->addr.bdaddr, addr);

	dev = btd_adapter_find_device(adapter, &ev->addr.bdaddr, ev->addr.type);
	if (!dev) {
		btd_error(adapter->dev_id,
			"Device Flags Changed for unknown device %s", addr);
		return;
	}

	btd_device_flags_changed(dev, ev->supported_flags, ev->current_flags);
}
static void device_flags_changed_callback(uint16_t index, uint16_t length,
					  const void *param, void *user_data)
{
	const struct mgmt_ev_device_flags_changed *ev = param;
	struct btd_adapter *adapter = user_data;
	struct btd_device *dev;
	char addr[18];

	if (length < sizeof(*ev)) {
		btd_error(adapter->dev_id,
			  "Too small Device Flags Changed event: %d",
			  length);
		return;
	}

	ba2str(&ev->addr.bdaddr, addr);

	dev = btd_adapter_find_device(adapter, &ev->addr.bdaddr, ev->addr.type);
	if (!dev) {
		btd_error(adapter->dev_id,
			"Device Flags Changed for unknown device %s", addr);
		return;
	}

	btd_device_flags_changed(dev, ev->supported_flags, ev->current_flags);
}