Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 352343
b: refs/heads/master
c: cdf1963
h: refs/heads/master
i:
  352341: 8cb7b61
  352339: 990af4a
  352335: 5df4340
v: v3
  • Loading branch information
Johan Hedberg authored and Gustavo Padovan committed Feb 1, 2013
1 parent 6c2aa60 commit 79dcf99
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 213202edc9b5ae60eef2a915b83b4aa19b1c3617
refs/heads/master: cdf1963f7ba075772b4b5f91f395ed8fb84d0e70
34 changes: 34 additions & 0 deletions trunk/net/bluetooth/mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,39 @@ static u8 *create_uuid16_list(struct hci_dev *hdev, u8 *data, ptrdiff_t len)
return ptr;
}

static u8 *create_uuid32_list(struct hci_dev *hdev, u8 *data, ptrdiff_t len)
{
u8 *ptr = data, *uuids_start = NULL;
struct bt_uuid *uuid;

if (len < 6)
return ptr;

list_for_each_entry(uuid, &hdev->uuids, list) {
if (uuid->size != 32)
continue;

if (!uuids_start) {
uuids_start = ptr;
uuids_start[0] = 1;
uuids_start[1] = EIR_UUID32_ALL;
ptr += 2;
}

/* Stop if not enough space to put next UUID */
if ((ptr - data) + sizeof(u32) > len) {
uuids_start[1] = EIR_UUID32_SOME;
break;
}

memcpy(ptr, &uuid->uuid[12], sizeof(u32));
ptr += sizeof(u32);
uuids_start[0] += sizeof(u32);
}

return ptr;
}

static void create_eir(struct hci_dev *hdev, u8 *data)
{
u8 *ptr = data;
Expand Down Expand Up @@ -521,6 +554,7 @@ static void create_eir(struct hci_dev *hdev, u8 *data)
}

ptr = create_uuid16_list(hdev, ptr, HCI_MAX_EIR_LENGTH - (ptr - data));
ptr = create_uuid32_list(hdev, ptr, HCI_MAX_EIR_LENGTH - (ptr - data));
}

static int update_eir(struct hci_dev *hdev)
Expand Down

0 comments on commit 79dcf99

Please sign in to comment.