Skip to contentSkip to conversation

gatt: Mark Includes property of org.bluez.GattService1 as optional

PATCH Superseded Szymon Janc 2 participants 4 messages Mar 22, 2018 Bluetooth drivers

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 gatt: Mark Includes property of org.bluez.GattService1 as optional

If property is not present treat it as no Include Services present.

---
 doc/gatt-api.txt    | 2 +-
 src/gatt-database.c | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
doc/gatt-api.txt +1 -1
index f58de23c3..60a997cbf 100644
@@ -45,7 +45,7 @@ Properties	string UUID [read-only]
 			belongs to. Only present on services from remote
 			devices.
 
-		array{object} Includes [read-only]
+		array{object} Includes [read-only, optional]
 
 			Array of object paths representing the included
 			services of this service.
src/gatt-database.c +2 -1
index c1ae91211..2e1c20d78 100644
@@ -1676,8 +1676,9 @@ static bool parse_includes(GDBusProxy *proxy, struct external_service *service)
 	DBusMessageIter array;
 	char *obj;
 
+	/* Includes property is optional */
 	if (!g_dbus_proxy_get_property(proxy, "Includes", &iter))
-		return false;
+		return true;
 
 	if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_ARRAY)
 		return false;
Signature · 1 line
2.14.3
#1 lore raw

Hi Szymon,

Quoted 35 lines · Szymon Janc

If property is not present treat it as no Include Services present.

---
 doc/gatt-api.txt    | 2 +-
 src/gatt-database.c | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
doc/gatt-api.txt +1 -1
index f58de23c3..60a997cbf 100644
@@ -45,7 +45,7 @@ Properties    string UUID [read-only]
                        belongs to. Only present on services from remote
                        devices.
 
-               array{object} Includes [read-only]
+               array{object} Includes [read-only, optional]
 
                        Array of object paths representing the included
                        services of this service.
src/gatt-database.c +2 -2
index c1ae91211..2e1c20d78 100644
@@ -1676,8 +1676,9 @@ static bool parse_includes(GDBusProxy *proxy, struct external_service *service)
        DBusMessageIter array;
        char *obj;
 
+       /* Includes property is optional */
        if (!g_dbus_proxy_get_property(proxy, "Includes", &iter))
-               return false;
+               return true;
 
        if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_ARRAY)
                return false;
--
Quoted 1 line

2.14.3

Ive pushed a similar patch about an hour ago:

https://git.kernel.org/pub/scm/bluetooth/bluez.git/commit/?id=4f7162071f885714f8a3aaedc50333576e2dd8f5

Signature · 1 line
Luiz Augusto von Dentz
#2 lore raw

Hi,

Quoted 3 lines · On Thursday, 22 March 2018 11:28:20 CET Luiz Augusto von Dentz wrote:

Hi Szymon,

On Thu, Mar 22, 2018 at 12:06 PM, Szymon Janc <[email protected]>

Quoted 38 lines · wrote:
Quoted 38 lines

If property is not present treat it as no Include Services present.
---

 doc/gatt-api.txt    | 2 +-
 src/gatt-database.c | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
doc/gatt-api.txt +1 -1
index f58de23c3..60a997cbf 100644
@@ -45,7 +45,7 @@ Properties    string UUID [read-only]
 
                        belongs to. Only present on services from remote
                        devices.
 
-               array{object} Includes [read-only]
+               array{object} Includes [read-only, optional]
 
                        Array of object paths representing the included

services of this service.

src/gatt-database.c +0 -0
index c1ae91211..2e1c20d78 100644
@@ -1676,8 +1676,9 @@ static bool parse_includes(GDBusProxy *proxy, struct

external_service *service)>

        DBusMessageIter array;
        char *obj;
src/gatt-database.c +2 -1
+       /* Includes property is optional */
 
        if (!g_dbus_proxy_get_property(proxy, "Includes", &iter))
 
-               return false;
+               return true;
Quoted 8 lines
Quoted 6 lines
        if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_ARRAY)
        
                return false;

--
2.14.3

Ive pushed a similar patch about an hour ago:

OK. And what about v3 change? should we failed to register if Includes are not in valid format?

Signature · 2 lines
pozdrawiam
Szymon Janc
#3 lore raw

Hi Szymon,

Quoted 49 lines · Szymon Janc

Hi,

Quoted 3 lines · On Thursday, 22 March 2018 11:28:20 CET Luiz Augusto von Dentz wrote:

Hi Szymon,

On Thu, Mar 22, 2018 at 12:06 PM, Szymon Janc <[email protected]>

Quoted 42 lines · wrote:
Quoted 42 lines

If property is not present treat it as no Include Services present.
---

 doc/gatt-api.txt    | 2 +-
 src/gatt-database.c | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
doc/gatt-api.txt +1 -1
index f58de23c3..60a997cbf 100644
@@ -45,7 +45,7 @@ Properties    string UUID [read-only]
 
                        belongs to. Only present on services from remote
                        devices.
 
-               array{object} Includes [read-only]
+               array{object} Includes [read-only, optional]
 
                        Array of object paths representing the included

services of this service.

src/gatt-database.c +0 -0
index c1ae91211..2e1c20d78 100644
@@ -1676,8 +1676,9 @@ static bool parse_includes(GDBusProxy *proxy, struct

external_service *service)>

        DBusMessageIter array;
        char *obj;
src/gatt-database.c +2 -1
+       /* Includes property is optional */
 
        if (!g_dbus_proxy_get_property(proxy, "Includes", &iter))
 
-               return false;
+               return true;
 
        if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_ARRAY)
 
                return false;
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

--
2.14.3

Ive pushed a similar patch about an hour ago:

OK. And what about v3 change? should we failed to register if Includes are not in valid format?

Yep, I guess you just need to rebase so we can integrate that change you did in v3.

Quoted 5 lines

--
pozdrawiam
Szymon Janc

Signature · 1 line
Luiz Augusto von Dentz