summaryrefslogtreecommitdiff
path: root/android/hal-hidhost.c
diff options
context:
space:
mode:
authorSzymon Janc <szymon.janc@tieto.com>2013-11-07 17:17:04 +0100
committerJohan Hedberg <johan.hedberg@intel.com>2013-11-07 18:45:06 +0200
commitbdbe86efab7a73230bdf1cd13fd8cb90b0b07115 (patch)
tree62872a8c6607f366e4fd27c30e05a9922cc8c2f8 /android/hal-hidhost.c
parenta54747586e1490c39610ed309bea21928b5d828a (diff)
downloadbluez-bdbe86efab7a73230bdf1cd13fd8cb90b0b07115.tar.gz
android/hal: Use hidhost instead of hh in hidhost HAL
Match functions names to HAL name. Where not needed hh prefix is removed.
Diffstat (limited to 'android/hal-hidhost.c')
-rw-r--r--android/hal-hidhost.c78
1 files changed, 39 insertions, 39 deletions
diff --git a/android/hal-hidhost.c b/android/hal-hidhost.c
index ed730cf97..3c147e8ea 100644
--- a/android/hal-hidhost.c
+++ b/android/hal-hidhost.c
@@ -24,19 +24,19 @@
#include "hal-msg.h"
#include "hal-ipc.h"
-static const bthh_callbacks_t *bt_hh_cbacks;
+static const bthh_callbacks_t *cbacks;
static bool interface_ready(void)
{
- return bt_hh_cbacks != NULL;
+ return cbacks != NULL;
}
static void handle_conn_state(void *buf)
{
struct hal_ev_hidhost_conn_state *ev = buf;
- if (bt_hh_cbacks->connection_state_cb)
- bt_hh_cbacks->connection_state_cb((bt_bdaddr_t *) ev->bdaddr,
+ if (cbacks->connection_state_cb)
+ cbacks->connection_state_cb((bt_bdaddr_t *) ev->bdaddr,
ev->state);
}
@@ -55,16 +55,16 @@ static void handle_info(void *buf)
info.dl_len = ev->descr_len;
memcpy(info.dsc_list, ev->descr, info.dl_len);
- if (bt_hh_cbacks->hid_info_cb)
- bt_hh_cbacks->hid_info_cb((bt_bdaddr_t *) ev->bdaddr, info);
+ if (cbacks->hid_info_cb)
+ cbacks->hid_info_cb((bt_bdaddr_t *) ev->bdaddr, info);
}
static void handle_proto_mode(void *buf)
{
struct hal_ev_hidhost_proto_mode *ev = buf;
- if (bt_hh_cbacks->protocol_mode_cb)
- bt_hh_cbacks->protocol_mode_cb((bt_bdaddr_t *) ev->bdaddr,
+ if (cbacks->protocol_mode_cb)
+ cbacks->protocol_mode_cb((bt_bdaddr_t *) ev->bdaddr,
ev->status, ev->mode);
}
@@ -72,13 +72,13 @@ static void handle_get_report(void *buf)
{
struct hal_ev_hidhost_get_report *ev = buf;
- if (bt_hh_cbacks->get_report_cb)
- bt_hh_cbacks->get_report_cb((bt_bdaddr_t *) ev->bdaddr,
- ev->status, ev->data, ev->len);
+ if (cbacks->get_report_cb)
+ cbacks->get_report_cb((bt_bdaddr_t *) ev->bdaddr, ev->status,
+ ev->data, ev->len);
}
/* will be called from notification thread context */
-void bt_notify_hh(uint16_t opcode, void *buf, uint16_t len)
+void bt_notify_hidhost(uint16_t opcode, void *buf, uint16_t len)
{
if (!interface_ready())
return;
@@ -102,7 +102,7 @@ void bt_notify_hh(uint16_t opcode, void *buf, uint16_t len)
}
}
-static bt_status_t hh_connect(bt_bdaddr_t *bd_addr)
+static bt_status_t hidhost_connect(bt_bdaddr_t *bd_addr)
{
struct hal_cmd_hidhost_connect cmd;
@@ -120,7 +120,7 @@ static bt_status_t hh_connect(bt_bdaddr_t *bd_addr)
sizeof(cmd), &cmd, 0, NULL, NULL);
}
-static bt_status_t hh_disconnect(bt_bdaddr_t *bd_addr)
+static bt_status_t disconnect(bt_bdaddr_t *bd_addr)
{
struct hal_cmd_hidhost_disconnect cmd;
@@ -138,7 +138,7 @@ static bt_status_t hh_disconnect(bt_bdaddr_t *bd_addr)
sizeof(cmd), &cmd, 0, NULL, NULL);
}
-static bt_status_t hh_virtual_unplug(bt_bdaddr_t *bd_addr)
+static bt_status_t virtual_unplug(bt_bdaddr_t *bd_addr)
{
struct hal_cmd_hidhost_vp cmd;
@@ -156,7 +156,7 @@ static bt_status_t hh_virtual_unplug(bt_bdaddr_t *bd_addr)
sizeof(cmd), &cmd, 0, NULL, NULL);
}
-static bt_status_t hh_set_info(bt_bdaddr_t *bd_addr, bthh_hid_info_t hid_info)
+static bt_status_t set_info(bt_bdaddr_t *bd_addr, bthh_hid_info_t hid_info)
{
struct hal_cmd_hidhost_set_info cmd;
@@ -182,7 +182,7 @@ static bt_status_t hh_set_info(bt_bdaddr_t *bd_addr, bthh_hid_info_t hid_info)
sizeof(cmd), &cmd, 0, NULL, NULL);
}
-static bt_status_t hh_get_protocol(bt_bdaddr_t *bd_addr,
+static bt_status_t get_protocol(bt_bdaddr_t *bd_addr,
bthh_protocol_mode_t protocol_mode)
{
struct hal_cmd_hidhost_get_protocol cmd;
@@ -213,7 +213,7 @@ static bt_status_t hh_get_protocol(bt_bdaddr_t *bd_addr,
sizeof(cmd), &cmd, 0, NULL, NULL);
}
-static bt_status_t hh_set_protocol(bt_bdaddr_t *bd_addr,
+static bt_status_t set_protocol(bt_bdaddr_t *bd_addr,
bthh_protocol_mode_t protocol_mode)
{
struct hal_cmd_hidhost_set_protocol cmd;
@@ -244,7 +244,7 @@ static bt_status_t hh_set_protocol(bt_bdaddr_t *bd_addr,
sizeof(cmd), &cmd, 0, NULL, NULL);
}
-static bt_status_t hh_get_report(bt_bdaddr_t *bd_addr,
+static bt_status_t get_report(bt_bdaddr_t *bd_addr,
bthh_report_type_t report_type,
uint8_t report_id,
int buffer_size)
@@ -281,7 +281,7 @@ static bt_status_t hh_get_report(bt_bdaddr_t *bd_addr,
sizeof(cmd), &cmd, 0, NULL, NULL);
}
-static bt_status_t hh_set_report(bt_bdaddr_t *bd_addr,
+static bt_status_t set_report(bt_bdaddr_t *bd_addr,
bthh_report_type_t report_type,
char *report)
{
@@ -317,7 +317,7 @@ static bt_status_t hh_set_report(bt_bdaddr_t *bd_addr,
sizeof(cmd), &cmd, 0, NULL, NULL);
}
-static bt_status_t hh_send_data(bt_bdaddr_t *bd_addr, char *data)
+static bt_status_t send_data(bt_bdaddr_t *bd_addr, char *data)
{
struct hal_cmd_hidhost_send_data cmd;
@@ -335,14 +335,14 @@ static bt_status_t hh_send_data(bt_bdaddr_t *bd_addr, char *data)
sizeof(cmd), &cmd, 0, NULL, NULL);
}
-static bt_status_t hh_init(bthh_callbacks_t *callbacks)
+static bt_status_t init(bthh_callbacks_t *callbacks)
{
struct hal_cmd_register_module cmd;
DBG("");
/* store reference to user callbacks */
- bt_hh_cbacks = callbacks;
+ cbacks = callbacks;
cmd.service_id = HAL_SERVICE_ID_HIDHOST;
@@ -350,7 +350,7 @@ static bt_status_t hh_init(bthh_callbacks_t *callbacks)
sizeof(cmd), &cmd, 0, NULL, NULL);
}
-static void hh_cleanup(void)
+static void cleanup(void)
{
struct hal_cmd_unregister_module cmd;
@@ -359,7 +359,7 @@ static void hh_cleanup(void)
if (!interface_ready())
return;
- bt_hh_cbacks = NULL;
+ cbacks = NULL;
cmd.service_id = HAL_SERVICE_ID_HIDHOST;
@@ -367,22 +367,22 @@ static void hh_cleanup(void)
sizeof(cmd), &cmd, 0, NULL, NULL);
}
-static bthh_interface_t hh_if = {
- .size = sizeof(hh_if),
- .init = hh_init,
- .connect = hh_connect,
- .disconnect = hh_disconnect,
- .virtual_unplug = hh_virtual_unplug,
- .set_info = hh_set_info,
- .get_protocol = hh_get_protocol,
- .set_protocol = hh_set_protocol,
- .get_report = hh_get_report,
- .set_report = hh_set_report,
- .send_data = hh_send_data,
- .cleanup = hh_cleanup
+static bthh_interface_t hidhost_if = {
+ .size = sizeof(hidhost_if),
+ .init = init,
+ .connect = hidhost_connect,
+ .disconnect = disconnect,
+ .virtual_unplug = virtual_unplug,
+ .set_info = set_info,
+ .get_protocol = get_protocol,
+ .set_protocol = set_protocol,
+ .get_report = get_report,
+ .set_report = set_report,
+ .send_data = send_data,
+ .cleanup = cleanup
};
bthh_interface_t *bt_get_hidhost_interface(void)
{
- return &hh_if;
+ return &hidhost_if;
}