Bluetooth: Change eir_has_data_type() to more generic eir_get_data()
To make the EIR parsing helper more general purpose, make it return the found data and its length rather than just saying whether the data was present or not. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
This commit is contained in:

committed by
Marcel Holtmann

parent
29663b0cc1
commit
0d3b7f64c8
@@ -3833,9 +3833,9 @@ static void hci_extended_inquiry_result_evt(struct hci_dev *hdev,
|
||||
data.ssp_mode = 0x01;
|
||||
|
||||
if (hci_dev_test_flag(hdev, HCI_MGMT))
|
||||
name_known = eir_has_data_type(info->data,
|
||||
sizeof(info->data),
|
||||
EIR_NAME_COMPLETE);
|
||||
name_known = eir_get_data(info->data,
|
||||
sizeof(info->data),
|
||||
EIR_NAME_COMPLETE, NULL);
|
||||
else
|
||||
name_known = true;
|
||||
|
||||
|
@@ -7266,7 +7266,8 @@ void mgmt_device_found(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
|
||||
/* Copy EIR or advertising data into event */
|
||||
memcpy(ev->eir, eir, eir_len);
|
||||
|
||||
if (dev_class && !eir_has_data_type(ev->eir, eir_len, EIR_CLASS_OF_DEV))
|
||||
if (dev_class && !eir_get_data(ev->eir, eir_len, EIR_CLASS_OF_DEV,
|
||||
NULL))
|
||||
eir_len = eir_append_data(ev->eir, eir_len, EIR_CLASS_OF_DEV,
|
||||
dev_class, 3);
|
||||
|
||||
|
Reference in New Issue
Block a user