From: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
To: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
Cc: linux-bluetooth <linux-bluetooth@vger.kernel.org>
Subject: Re: [PATCH 15/15] android/health: Add health.c|h file with basic calls
Date: Wed, 12 Mar 2014 19:37:46 +0200 [thread overview]
Message-ID: <53209B6A.8030403@linux.intel.com> (raw)
In-Reply-To: <CAMv5Gbf16uUaLpYVPq_5J_6d93-PXXUEsKXRvCHuyLfODE4nuA@mail.gmail.com>
Hi,
On 03/12/2014 05:18 PM, Grzegorz Kolodziejczyk wrote:
> On 12 March 2014 16:10, Ravi kumar Veeramally
> <ravikumar.veeramally@linux.intel.com> wrote:
>> Add health.c|h with basic calls for register and unregister profile.
>> ---
>> android/Android.mk | 1 +
>> android/Makefile.am | 1 +
>> android/health.c | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++++
>> android/health.h | 25 ++++++++++++
>> android/main.c | 10 +++++
>> 5 files changed, 152 insertions(+)
>> create mode 100644 android/health.c
>> create mode 100644 android/health.h
>>
>> diff --git a/android/Android.mk b/android/Android.mk
>> index 0352beb..34e21ea 100644
>> --- a/android/Android.mk
>> +++ b/android/Android.mk
>> @@ -43,6 +43,7 @@ LOCAL_SRC_FILES := \
>> bluez/android/pan.c \
>> bluez/android/handsfree.c \
>> bluez/android/gatt.c \
>> + bluez/android/health.c \
>> bluez/src/log.c \
>> bluez/src/shared/mgmt.c \
>> bluez/src/shared/util.c \
>> diff --git a/android/Makefile.am b/android/Makefile.am
>> index d2cfed6..adfb14c 100644
>> --- a/android/Makefile.am
>> +++ b/android/Makefile.am
>> @@ -41,6 +41,7 @@ android_bluetoothd_SOURCES = android/main.c \
>> android/pan.h android/pan.c \
>> android/handsfree.h android/handsfree.c \
>> android/gatt.h android/gatt.c \
>> + android/health.h android/health.c \
>> btio/btio.h btio/btio.c \
>> src/sdp-client.h src/sdp-client.c \
>> profiles/network/bnep.h profiles/network/bnep.c
>> diff --git a/android/health.c b/android/health.c
>> new file mode 100644
>> index 0000000..6359b11
>> --- /dev/null
>> +++ b/android/health.c
>> @@ -0,0 +1,115 @@
>> +/*
>> + *
>> + * BlueZ - Bluetooth protocol stack for Linux
>> + *
>> + * Copyright (C) 2013-2014 Intel Corporation. All rights reserved.
>> + *
>> + *
>> + * This library is free software; you can redistribute it and/or
>> + * modify it under the terms of the GNU Lesser General Public
>> + * License as published by the Free Software Foundation; either
>> + * version 2.1 of the License, or (at your option) any later version.
>> + *
>> + * This library is distributed in the hope that it will be useful,
>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
>> + * Lesser General Public License for more details.
>> + *
>> + * You should have received a copy of the GNU Lesser General Public
>> + * License along with this library; if not, write to the Free Software
>> + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
>> + *
>> + */
>> +
>> +#ifdef HAVE_CONFIG_H
>> +#include <config.h>
>> +#endif
>> +
>> +#include <stdint.h>
>> +#include <stdbool.h>
>> +#include <errno.h>
>> +#include <unistd.h>
>> +#include <glib.h>
>> +
>> +#include "lib/bluetooth.h"
>> +#include "lib/sdp.h"
>> +#include "lib/sdp_lib.h"
>> +#include "src/log.h"
>> +
>> +#include "hal-msg.h"
>> +#include "ipc-common.h"
>> +#include "ipc.h"
>> +#include "utils.h"
>> +#include "bluetooth.h"
>> +#include "health.h"
>> +
>> +static bdaddr_t adapter_addr;
>> +static struct ipc *hal_ipc = NULL;
>> +
>> +static void bt_health_register_app(const void *buf, uint16_t len)
>> +{
>> + DBG("Not implemented");
>> +
>> + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HEALTH, HAL_OP_HEALTH_REG_APP,
>> + HAL_STATUS_UNSUPPORTED);
>> +}
>> +
>> +static void bt_health_unregister_app(const void *buf, uint16_t len)
>> +{
>> + DBG("Not implemented");
>> +
>> + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HEALTH, HAL_OP_HEALTH_UNREG_APP,
>> + HAL_STATUS_UNSUPPORTED);
>> +}
>> +
>> +static void bt_health_connect_channel(const void *buf, uint16_t len)
>> +{
>> + DBG("Not implemented");
>> +
>> + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HEALTH,
>> + HAL_OP_HEALTH_CONNECT_CHANNEL, HAL_STATUS_UNSUPPORTED);
>> +}
>> +
>> +static void bt_health_destroy_channel(const void *buf, uint16_t len)
>> +{
>> + DBG("Not implemented");
>> +
>> + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HEALTH,
>> + HAL_OP_HEALTH_DESTROY_CHANNEL, HAL_STATUS_UNSUPPORTED);
>> +}
>> +
>> +static const struct ipc_handler cmd_handlers[] = {
>> + /* HAL_OP_HEALTH_REG_APP */
>> + { bt_health_register_app, false,
>> + sizeof(struct hal_cmd_health_reg_app) },
>> + /* HAL_OP_HEALTH_UNREG_APP */
>> + { bt_health_unregister_app, false,
>> + sizeof(struct hal_cmd_health_unreg_app) },
>> + /* HAL_OP_HEALTH_CONNECT_CHANNEL */
>> + { bt_health_connect_channel, false,
>> + sizeof(struct hal_cmd_health_connect_channel) },
>> + /* HAL_OP_HEALTH_DESTROY_CHANNEL */
>> + { bt_health_destroy_channel, false,
>> + sizeof(struct hal_cmd_health_destroy_channel) },
>> +};
>> +
>> +bool bt_health_register(struct ipc *ipc, const bdaddr_t *addr, uint8_t mode)
>> +{
>> + DBG("");
>> +
>> + bacpy(&adapter_addr, addr);
>> +
>> + hal_ipc = ipc;
>> + ipc_register(hal_ipc, HAL_SERVICE_ID_HEALTH, cmd_handlers,
>> + G_N_ELEMENTS(cmd_handlers));
>> +
>> + return true;
>> +}
>> +
>> +void bt_health_unregister(void)
>> +{
>> + DBG("");
>> +
>> + ipc_unregister(hal_ipc, HAL_SERVICE_ID_HEALTH);
>> + hal_ipc = NULL;
>> +}
>> diff --git a/android/health.h b/android/health.h
>> new file mode 100644
>> index 0000000..38a58c0
>> --- /dev/null
>> +++ b/android/health.h
>> @@ -0,0 +1,25 @@
>> +/*
>> + *
>> + * BlueZ - Bluetooth protocol stack for Linux
>> + *
>> + * Copyright (C) 2013-2014 Intel Corporation. All rights reserved.
>> + *
>> + *
>> + * This library is free software; you can redistribute it and/or
>> + * modify it under the terms of the GNU Lesser General Public
>> + * License as published by the Free Software Foundation; either
>> + * version 2.1 of the License, or (at your option) any later version.
>> + *
>> + * This library is distributed in the hope that it will be useful,
>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
>> + * Lesser General Public License for more details.
>> + *
>> + * You should have received a copy of the GNU Lesser General Public
>> + * License along with this library; if not, write to the Free Software
>> + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
>> + *
>> + */
>> +
>> +bool bt_health_register(struct ipc *ipc, const bdaddr_t *addr, uint8_t mode);
>> +void bt_health_unregister(void);
>> diff --git a/android/main.c b/android/main.c
>> index a34f885..9423619 100644
>> --- a/android/main.c
>> +++ b/android/main.c
>> @@ -59,6 +59,7 @@
>> #include "avrcp.h"
>> #include "handsfree.h"
>> #include "gatt.h"
>> +#include "health.h"
>>
>> #define STARTUP_GRACE_SECONDS 5
>> #define SHUTDOWN_GRACE_SECONDS 10
>> @@ -133,6 +134,12 @@ static void service_register(const void *buf, uint16_t len)
>> goto failed;
>> }
> Missing brake here.
Ok, I will fix it.
Thanks,
Ravi.
>> + case HAL_SERVICE_ID_HEALTH:
>> + if (!bt_health_register(hal_ipc, &adapter_bdaddr, m->mode)) {
>> + status = HAL_STATUS_FAILED;
>> + goto failed;
>> + }
>> +
>> break;
>> default:
>> DBG("service %u not supported", m->service_id);
>> @@ -186,6 +193,9 @@ static void service_unregister(const void *buf, uint16_t len)
>> case HAL_SERVICE_ID_GATT:
>> bt_gatt_unregister();
>> break;
>> + case HAL_SERVICE_ID_HEALTH:
>> + bt_health_unregister();
>> + break;
>> default:
>> /* This would indicate bug in HAL, as unregister should not be
>> * called in init failed */
>> --
>> 1.8.3.2
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Best regards,
> Grzegorz Kolodziejczyk
>
> On 12 March 2014 16:10, Ravi kumar Veeramally
> <ravikumar.veeramally@linux.intel.com> wrote:
>> Add health.c|h with basic calls for register and unregister profile.
>> ---
>> android/Android.mk | 1 +
>> android/Makefile.am | 1 +
>> android/health.c | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++++
>> android/health.h | 25 ++++++++++++
>> android/main.c | 10 +++++
>> 5 files changed, 152 insertions(+)
>> create mode 100644 android/health.c
>> create mode 100644 android/health.h
>>
>> diff --git a/android/Android.mk b/android/Android.mk
>> index 0352beb..34e21ea 100644
>> --- a/android/Android.mk
>> +++ b/android/Android.mk
>> @@ -43,6 +43,7 @@ LOCAL_SRC_FILES := \
>> bluez/android/pan.c \
>> bluez/android/handsfree.c \
>> bluez/android/gatt.c \
>> + bluez/android/health.c \
>> bluez/src/log.c \
>> bluez/src/shared/mgmt.c \
>> bluez/src/shared/util.c \
>> diff --git a/android/Makefile.am b/android/Makefile.am
>> index d2cfed6..adfb14c 100644
>> --- a/android/Makefile.am
>> +++ b/android/Makefile.am
>> @@ -41,6 +41,7 @@ android_bluetoothd_SOURCES = android/main.c \
>> android/pan.h android/pan.c \
>> android/handsfree.h android/handsfree.c \
>> android/gatt.h android/gatt.c \
>> + android/health.h android/health.c \
>> btio/btio.h btio/btio.c \
>> src/sdp-client.h src/sdp-client.c \
>> profiles/network/bnep.h profiles/network/bnep.c
>> diff --git a/android/health.c b/android/health.c
>> new file mode 100644
>> index 0000000..6359b11
>> --- /dev/null
>> +++ b/android/health.c
>> @@ -0,0 +1,115 @@
>> +/*
>> + *
>> + * BlueZ - Bluetooth protocol stack for Linux
>> + *
>> + * Copyright (C) 2013-2014 Intel Corporation. All rights reserved.
>> + *
>> + *
>> + * This library is free software; you can redistribute it and/or
>> + * modify it under the terms of the GNU Lesser General Public
>> + * License as published by the Free Software Foundation; either
>> + * version 2.1 of the License, or (at your option) any later version.
>> + *
>> + * This library is distributed in the hope that it will be useful,
>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
>> + * Lesser General Public License for more details.
>> + *
>> + * You should have received a copy of the GNU Lesser General Public
>> + * License along with this library; if not, write to the Free Software
>> + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
>> + *
>> + */
>> +
>> +#ifdef HAVE_CONFIG_H
>> +#include <config.h>
>> +#endif
>> +
>> +#include <stdint.h>
>> +#include <stdbool.h>
>> +#include <errno.h>
>> +#include <unistd.h>
>> +#include <glib.h>
>> +
>> +#include "lib/bluetooth.h"
>> +#include "lib/sdp.h"
>> +#include "lib/sdp_lib.h"
>> +#include "src/log.h"
>> +
>> +#include "hal-msg.h"
>> +#include "ipc-common.h"
>> +#include "ipc.h"
>> +#include "utils.h"
>> +#include "bluetooth.h"
>> +#include "health.h"
>> +
>> +static bdaddr_t adapter_addr;
>> +static struct ipc *hal_ipc = NULL;
>> +
>> +static void bt_health_register_app(const void *buf, uint16_t len)
>> +{
>> + DBG("Not implemented");
>> +
>> + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HEALTH, HAL_OP_HEALTH_REG_APP,
>> + HAL_STATUS_UNSUPPORTED);
>> +}
>> +
>> +static void bt_health_unregister_app(const void *buf, uint16_t len)
>> +{
>> + DBG("Not implemented");
>> +
>> + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HEALTH, HAL_OP_HEALTH_UNREG_APP,
>> + HAL_STATUS_UNSUPPORTED);
>> +}
>> +
>> +static void bt_health_connect_channel(const void *buf, uint16_t len)
>> +{
>> + DBG("Not implemented");
>> +
>> + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HEALTH,
>> + HAL_OP_HEALTH_CONNECT_CHANNEL, HAL_STATUS_UNSUPPORTED);
>> +}
>> +
>> +static void bt_health_destroy_channel(const void *buf, uint16_t len)
>> +{
>> + DBG("Not implemented");
>> +
>> + ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HEALTH,
>> + HAL_OP_HEALTH_DESTROY_CHANNEL, HAL_STATUS_UNSUPPORTED);
>> +}
>> +
>> +static const struct ipc_handler cmd_handlers[] = {
>> + /* HAL_OP_HEALTH_REG_APP */
>> + { bt_health_register_app, false,
>> + sizeof(struct hal_cmd_health_reg_app) },
>> + /* HAL_OP_HEALTH_UNREG_APP */
>> + { bt_health_unregister_app, false,
>> + sizeof(struct hal_cmd_health_unreg_app) },
>> + /* HAL_OP_HEALTH_CONNECT_CHANNEL */
>> + { bt_health_connect_channel, false,
>> + sizeof(struct hal_cmd_health_connect_channel) },
>> + /* HAL_OP_HEALTH_DESTROY_CHANNEL */
>> + { bt_health_destroy_channel, false,
>> + sizeof(struct hal_cmd_health_destroy_channel) },
>> +};
>> +
>> +bool bt_health_register(struct ipc *ipc, const bdaddr_t *addr, uint8_t mode)
>> +{
>> + DBG("");
>> +
>> + bacpy(&adapter_addr, addr);
>> +
>> + hal_ipc = ipc;
>> + ipc_register(hal_ipc, HAL_SERVICE_ID_HEALTH, cmd_handlers,
>> + G_N_ELEMENTS(cmd_handlers));
>> +
>> + return true;
>> +}
>> +
>> +void bt_health_unregister(void)
>> +{
>> + DBG("");
>> +
>> + ipc_unregister(hal_ipc, HAL_SERVICE_ID_HEALTH);
>> + hal_ipc = NULL;
>> +}
>> diff --git a/android/health.h b/android/health.h
>> new file mode 100644
>> index 0000000..38a58c0
>> --- /dev/null
>> +++ b/android/health.h
>> @@ -0,0 +1,25 @@
>> +/*
>> + *
>> + * BlueZ - Bluetooth protocol stack for Linux
>> + *
>> + * Copyright (C) 2013-2014 Intel Corporation. All rights reserved.
>> + *
>> + *
>> + * This library is free software; you can redistribute it and/or
>> + * modify it under the terms of the GNU Lesser General Public
>> + * License as published by the Free Software Foundation; either
>> + * version 2.1 of the License, or (at your option) any later version.
>> + *
>> + * This library is distributed in the hope that it will be useful,
>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
>> + * Lesser General Public License for more details.
>> + *
>> + * You should have received a copy of the GNU Lesser General Public
>> + * License along with this library; if not, write to the Free Software
>> + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
>> + *
>> + */
>> +
>> +bool bt_health_register(struct ipc *ipc, const bdaddr_t *addr, uint8_t mode);
>> +void bt_health_unregister(void);
>> diff --git a/android/main.c b/android/main.c
>> index a34f885..9423619 100644
>> --- a/android/main.c
>> +++ b/android/main.c
>> @@ -59,6 +59,7 @@
>> #include "avrcp.h"
>> #include "handsfree.h"
>> #include "gatt.h"
>> +#include "health.h"
>>
>> #define STARTUP_GRACE_SECONDS 5
>> #define SHUTDOWN_GRACE_SECONDS 10
>> @@ -133,6 +134,12 @@ static void service_register(const void *buf, uint16_t len)
>> goto failed;
>> }
>>
>> + case HAL_SERVICE_ID_HEALTH:
>> + if (!bt_health_register(hal_ipc, &adapter_bdaddr, m->mode)) {
>> + status = HAL_STATUS_FAILED;
>> + goto failed;
>> + }
>> +
>> break;
>> default:
>> DBG("service %u not supported", m->service_id);
>> @@ -186,6 +193,9 @@ static void service_unregister(const void *buf, uint16_t len)
>> case HAL_SERVICE_ID_GATT:
>> bt_gatt_unregister();
>> break;
>> + case HAL_SERVICE_ID_HEALTH:
>> + bt_health_unregister();
>> + break;
>> default:
>> /* This would indicate bug in HAL, as unregister should not be
>> * called in init failed */
>> --
>> 1.8.3.2
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2014-03-12 17:37 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-12 15:10 [PATCH 00/15] Add HDP profile support at HAL side Ravi kumar Veeramally
2014-03-12 15:10 ` [PATCH 01/15] android/hal-msg: Add HDP app registration struct Ravi kumar Veeramally
2014-03-12 15:39 ` Luiz Augusto von Dentz
2014-03-12 17:39 ` Ravi kumar Veeramally
2014-03-12 15:10 ` [PATCH 02/15] android/hal-msg: Add HDP app unregistration struct Ravi kumar Veeramally
2014-03-12 15:10 ` [PATCH 03/15] android/hal-msg: Add HDP connect channel struct Ravi kumar Veeramally
2014-03-12 15:10 ` [PATCH 04/15] android/hal-msg: Add HDP destroy " Ravi kumar Veeramally
2014-03-12 15:10 ` [PATCH 05/15] android/hal-msg: Add HDP app registration state event struct Ravi kumar Veeramally
2014-03-12 15:10 ` [PATCH 06/15] android/hal-msg: Add HDP app channel " Ravi kumar Veeramally
2014-03-12 15:57 ` Andrzej Kaczmarek
2014-03-12 17:36 ` Ravi kumar Veeramally
2014-03-12 15:10 ` [PATCH 07/15] android/hal-health: Add hal-health file Ravi kumar Veeramally
2014-03-12 19:53 ` Szymon Janc
2014-03-12 15:10 ` [PATCH 08/15] android/hal-health: Add HDP .init method Ravi kumar Veeramally
2014-03-12 19:56 ` Szymon Janc
2014-03-12 15:10 ` [PATCH 09/15] android/hal-health: Add HDP .cleanup method Ravi kumar Veeramally
2014-03-12 15:10 ` [PATCH 10/15] android/hal-health: Add HDP .register_application method Ravi kumar Veeramally
2014-03-12 15:10 ` [PATCH 11/15] android/hal-health: Add HDP .unregister_application method Ravi kumar Veeramally
2014-03-12 15:10 ` [PATCH 12/15] android/hal-health: Add HDP .connect_channel method Ravi kumar Veeramally
2014-03-12 20:05 ` Szymon Janc
2014-03-13 9:22 ` Ravi kumar Veeramally
2014-03-12 15:10 ` [PATCH 13/15] android/hal-health: Add HDP .destroy_channel method Ravi kumar Veeramally
2014-03-12 15:10 ` [PATCH 14/15] android/hal-health: Add app state and channel state event handlers Ravi kumar Veeramally
2014-03-12 15:10 ` [PATCH 15/15] android/health: Add health.c|h file with basic calls Ravi kumar Veeramally
2014-03-12 15:18 ` Grzegorz Kolodziejczyk
2014-03-12 17:37 ` Ravi kumar Veeramally [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53209B6A.8030403@linux.intel.com \
--to=ravikumar.veeramally@linux.intel.com \
--cc=grzegorz.kolodziejczyk@tieto.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox