Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
meta-nemo
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
NemoMobile
meta-nemo
Commits
23f74190
Commit
23f74190
authored
Oct 18, 2017
by
Florent Revest
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bluez5: Use a maximum length of 8 for BLE advertisement local names
parent
ae538a79
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
14 deletions
+23
-14
0001-Advertise-hostname-in-BLE-ad-payload-to-have-a-recog.patch
...dvertise-hostname-in-BLE-ad-payload-to-have-a-recog.patch
+22
-13
bluez5_%.bbappend
recipes-connectivity/bluez5/bluez5_%.bbappend
+1
-1
No files found.
recipes-connectivity/bluez5/bluez5/
advertise-name
.patch
→
recipes-connectivity/bluez5/bluez5/
0001-Advertise-hostname-in-BLE-ad-payload-to-have-a-recog
.patch
View file @
23f74190
From e9623b14f63648da3bd805b3138941cfc932a82a Mon Sep 17 00:00:00 2001
From: Florent Revest <revestflo@gmail.com>
From: Florent Revest <revestflo@gmail.com>
Date: Thu, 24 Nov 2016 17:39:00 +0200
Date: Wed, 18 Oct 2017 22:10:56 +0200
Subject: [PATCH] Advertise hostname in BLE ad payload to have a recognizable name in AsteroidOSSync
Subject: [PATCH] Advertise hostname in BLE ad payload to have a recognizable
name in AsteroidOSSync
---
---
src/shared/ad.c | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/src/shared/ad.c b/src/shared/ad.c
index 1bf013d..d7b9a79 100644
--- a/src/shared/ad.c
--- a/src/shared/ad.c
+++ b/src/shared/ad.c
+++ b/src/shared/ad.c
@@ -110,6 +110,18 @@
@@ -110,6 +110,18 @@
void bt_ad_unref(struct bt_ad *ad)
free(ad);
free(ad);
}
}
+static size_t local_name_length()
+static size_t local_name_length()
+{
+{
+ size_t length = 0;
+ size_t length = 0;
+ char hostname[
1024
];
+ char hostname[
8
];
+
+
+ length += 2; /* one byte for length and one byte for 0x09 */
+ length += 2; /* one byte for length and one byte for 0x09 */
+ gethostname(hostname,
1024
);
+ gethostname(hostname,
8
);
+ length += str
len(&hostname
);
+ length += str
nlen(&hostname, 8
);
+
+
+ return length;
+ return length;
+}
+}
...
@@ -24,7 +31,7 @@ Subject: [PATCH] Advertise hostname in BLE ad payload to have a recognizable nam
...
@@ -24,7 +31,7 @@ Subject: [PATCH] Advertise hostname in BLE ad payload to have a recognizable nam
static size_t uuid_list_length(struct queue *uuid_queue)
static size_t uuid_list_length(struct queue *uuid_queue)
{
{
bool uuid16_included = false;
bool uuid16_included = false;
@@ -187,6 +199,8 @@
@@ -187,6 +199,8 @@
static size_t calculate_length(struct bt_ad *ad)
{
{
size_t length = 0;
size_t length = 0;
...
@@ -33,18 +40,17 @@ Subject: [PATCH] Advertise hostname in BLE ad payload to have a recognizable nam
...
@@ -33,18 +40,17 @@ Subject: [PATCH] Advertise hostname in BLE ad payload to have a recognizable nam
length += uuid_list_length(ad->service_uuids);
length += uuid_list_length(ad->service_uuids);
length += uuid_list_length(ad->solicit_uuids);
length += uuid_list_length(ad->solicit_uuids);
@@ -198,6 +212,2
2 @@
@@ -198,6 +212,2
1 @@
static size_t calculate_length(struct bt_ad *ad)
return length;
return length;
}
}
+
+static void serialize_local_name(uint8_t *buf, uint8_t *pos)
+static void serialize_local_name(uint8_t *buf, uint8_t *pos)
+{
+{
+ char hostname[
1024
];
+ char hostname[
8
];
+ uint8_t hostname_len;
+ uint8_t hostname_len;
+
+
+ gethostname(hostname,
1024
);
+ gethostname(hostname,
8
);
+ hostname_len = str
len(&hostname
);
+ hostname_len = str
nlen(&hostname, 8
);
+
+
+ buf[(*pos)++] = hostname_len + 1;
+ buf[(*pos)++] = hostname_len + 1;
+ buf[(*pos)++] = EIR_NAME_COMPLETE;
+ buf[(*pos)++] = EIR_NAME_COMPLETE;
...
@@ -56,7 +62,7 @@ Subject: [PATCH] Advertise hostname in BLE ad payload to have a recognizable nam
...
@@ -56,7 +62,7 @@ Subject: [PATCH] Advertise hostname in BLE ad payload to have a recognizable nam
static void serialize_uuids(struct queue *uuids, uint8_t uuid_type,
static void serialize_uuids(struct queue *uuids, uint8_t uuid_type,
uint8_t ad_type, uint8_t *buf,
uint8_t ad_type, uint8_t *buf,
uint8_t *pos)
uint8_t *pos)
@@ -330,6 +3
60,8 @@
@@ -330,6 +3
59,8 @@
uint8_t *bt_ad_generate(struct bt_ad *ad, size_t *length)
if (!adv_data)
if (!adv_data)
return NULL;
return NULL;
...
@@ -65,3 +71,6 @@ Subject: [PATCH] Advertise hostname in BLE ad payload to have a recognizable nam
...
@@ -65,3 +71,6 @@ Subject: [PATCH] Advertise hostname in BLE ad payload to have a recognizable nam
serialize_service_uuids(ad->service_uuids, adv_data, &pos);
serialize_service_uuids(ad->service_uuids, adv_data, &pos);
serialize_solicit_uuids(ad->solicit_uuids, adv_data, &pos);
serialize_solicit_uuids(ad->solicit_uuids, adv_data, &pos);
--
2.7.4
recipes-connectivity/bluez5/bluez5_%.bbappend
View file @
23f74190
...
@@ -2,7 +2,7 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/bluez5:"
...
@@ -2,7 +2,7 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/bluez5:"
SRC_URI += "file://main.conf \
SRC_URI += "file://main.conf \
file://bluetooth.service \
file://bluetooth.service \
file://bluetooth.conf \
file://bluetooth.conf \
file://
advertise-name
.patch"
file://
0001-Advertise-hostname-in-BLE-ad-payload-to-have-a-recog
.patch"
do_install_append() {
do_install_append() {
install -d ${D}/etc/bluetooth/
install -d ${D}/etc/bluetooth/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment