[PATCH BlueZ v2 12/13] gatttool: Show info message when no primary service is found

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Eder Ruiz Maria <eder.ruiz@xxxxxxxxxxxxx>

---
 attrib/interactive.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/attrib/interactive.c b/attrib/interactive.c
index 9b16ddf..1d31889 100644
--- a/attrib/interactive.c
+++ b/attrib/interactive.c
@@ -190,6 +190,11 @@ static void primary_all_cb(GSList *services, guint8 status, gpointer user_data)
 		return;
 	}
 
+	if (services == NULL) {
+		rl_printf("No primary service found\n");
+		return;
+	}
+
 	for (l = services; l; l = l->next) {
 		struct gatt_primary *prim = l->data;
 		rl_printf("attr handle: 0x%04x, end grp handle: 0x%04x uuid: %s\n",
@@ -208,6 +213,11 @@ static void primary_by_uuid_cb(GSList *ranges, guint8 status,
 		return;
 	}
 
+	if (ranges == NULL) {
+		rl_printf("No service UUID found\n");
+		return;
+	}
+
 	for (l = ranges; l; l = l->next) {
 		struct att_range *range = l->data;
 		rl_printf("Starting handle: 0x%04x Ending handle: 0x%04x\n",
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux