Bluetooth: Add support for appearance in scan rsp
This patch enables prepending appearance value to scan response data. It also adds support for setting appearance value through mgmt command. If currently advertised instance has apperance flag set it is expired immediately. Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl> Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
This commit is contained in:
committed by
Marcel Holtmann
parent
7c295c4801
commit
c4960ecf2b
@@ -1015,6 +1015,14 @@ static u8 create_instance_scan_rsp_data(struct hci_dev *hdev, u8 instance,
|
||||
|
||||
instance_flags = adv_instance->flags;
|
||||
|
||||
if ((instance_flags & MGMT_ADV_FLAG_APPEARANCE) && hdev->appearance) {
|
||||
ptr[0] = 3;
|
||||
ptr[1] = EIR_APPEARANCE;
|
||||
put_unaligned_le16(hdev->appearance, ptr + 2);
|
||||
scan_rsp_len += 4;
|
||||
ptr += 4;
|
||||
}
|
||||
|
||||
memcpy(ptr, adv_instance->scan_rsp_data,
|
||||
adv_instance->scan_rsp_len);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user