From e58c3f51b1354fd4349d6b8a5f95dfb12e87d4b6 Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Wed, 11 Dec 2013 11:31:25 +0100 Subject: [PATCH] android/bluetooth: Add support for get remote device properties command This allows to get all properties of specified remote device. --- android/bluetooth.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/android/bluetooth.c b/android/bluetooth.c index 254ccb44f..ffe1120f6 100644 --- a/android/bluetooth.c +++ b/android/bluetooth.c @@ -2338,10 +2338,34 @@ static uint8_t get_device_timestamp(struct device *dev) static void handle_get_remote_device_props_cmd(const void *buf, uint16_t len) { - /* TODO */ + const struct hal_cmd_get_remote_device_props *cmd = buf; + uint8_t status; + bdaddr_t addr; + GSList *l; + + android2bdaddr(cmd->bdaddr, &addr); + + l = g_slist_find_custom(devices, &addr, bdaddr_cmp); + if (!l) { + status = HAL_STATUS_INVALID; + goto failed; + } + get_device_name(l->data); + get_device_uuids(l->data); + get_device_class(l->data); + get_device_type(l->data); + get_device_service_rec(l->data); + get_device_friendly_name(l->data); + get_device_rssi(l->data); + get_device_version_info(l->data); + get_device_timestamp(l->data); + + status = HAL_STATUS_SUCCESS; + +failed: ipc_send_rsp(HAL_SERVICE_ID_BLUETOOTH, HAL_OP_GET_REMOTE_DEVICE_PROPS, - HAL_STATUS_FAILED); + status); } static void handle_get_remote_device_prop_cmd(const void *buf, uint16_t len) -- 2.47.3