[PATCH BlueZ v1 04/10] gatt: Add storing Appearance

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

 



This patch stores the Appearance characteristic value read from the
remote GAP service.
---
 profiles/gatt/gas.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/profiles/gatt/gas.c b/profiles/gatt/gas.c
index 2fb12ce..bf603e8 100644
--- a/profiles/gatt/gas.c
+++ b/profiles/gatt/gas.c
@@ -68,8 +68,11 @@ static gint cmp_device(gconstpointer a, gconstpointer b)
 static void gap_appearance_cb(guint8 status, const guint8 *pdu, guint16 plen,
 							gpointer user_data)
 {
+	struct gas *gas = user_data;
 	struct att_data_list *list =  NULL;
+	bdaddr_t src, dst;
 	uint16_t app;
+	uint8_t type;
 	uint8_t *atval;
 
 	if (status != 0) {
@@ -92,6 +95,11 @@ static void gap_appearance_cb(guint8 status, const guint8 *pdu, guint16 plen,
 
 	DBG("GAP Appearance: 0x%04x", app);
 
+	adapter_get_address(device_get_adapter(gas->device), &src);
+	device_get_address(gas->device, &dst, &type);
+
+	write_remote_appearance(&src, &dst, type, app);
+
 done:
 	att_data_list_free(list);
 }
-- 
1.7.8.6

--
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