From: Johan Hedberg Date: Wed, 19 Feb 2014 13:09:34 +0000 (+0200) Subject: emulator/bthost: Rename rfcomm_channel to rfcomm_chan for shorter symbol names X-Git-Tag: android-x86-4.4-r3~5346 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=4ead1cb1ecea705367c1b716bb7bd5538f0b49dd;p=android-x86%2Fexternal-bluetooth-bluez.git emulator/bthost: Rename rfcomm_channel to rfcomm_chan for shorter symbol names --- diff --git a/emulator/bthost.c b/emulator/bthost.c index 92c63cd3d..2d94d197e 100644 --- a/emulator/bthost.c +++ b/emulator/bthost.c @@ -126,11 +126,11 @@ struct cid_hook { struct cid_hook *next; }; -struct rfcomm_channel_hook { +struct rfcomm_chan_hook { uint8_t channel; - bthost_rfcomm_channel_hook_func_t func; + bthost_rfcomm_chan_hook_func_t func; void *user_data; - struct rfcomm_channel_hook *next; + struct rfcomm_chan_hook *next; }; struct btconn { @@ -142,7 +142,7 @@ struct btconn { struct l2conn *l2conns; struct rcconn *rcconns; struct cid_hook *cid_hooks; - struct rfcomm_channel_hook *rfcomm_channel_hooks; + struct rfcomm_chan_hook *rfcomm_chan_hooks; struct btconn *next; void *smp_data; }; @@ -255,10 +255,10 @@ static void btconn_free(struct btconn *conn) free(rcconn); } - while (conn->rfcomm_channel_hooks) { - struct rfcomm_channel_hook *hook = conn->rfcomm_channel_hooks; + while (conn->rfcomm_chan_hooks) { + struct rfcomm_chan_hook *hook = conn->rfcomm_chan_hooks; - conn->rfcomm_channel_hooks = hook->next; + conn->rfcomm_chan_hooks = hook->next; free(hook); } @@ -1611,12 +1611,12 @@ static struct cid_hook *find_cid_hook(struct btconn *conn, uint16_t cid) return NULL; } -static struct rfcomm_channel_hook *find_rfcomm_channel_hook(struct btconn *conn, +static struct rfcomm_chan_hook *find_rfcomm_chan_hook(struct btconn *conn, uint16_t channel) { - struct rfcomm_channel_hook *hook; + struct rfcomm_chan_hook *hook; - for (hook = conn->rfcomm_channel_hooks; hook != NULL; hook = hook->next) + for (hook = conn->rfcomm_chan_hooks; hook != NULL; hook = hook->next) if (hook->channel == channel) return hook; @@ -1892,9 +1892,9 @@ static void rfcomm_uih_recv(struct bthost *bthost, struct btconn *conn, p = data + hdr_len; if (RFCOMM_GET_DLCI(hdr->address)) { - struct rfcomm_channel_hook *hook; + struct rfcomm_chan_hook *hook; - hook = find_rfcomm_channel_hook(conn, + hook = find_rfcomm_chan_hook(conn, RFCOMM_GET_CHANNEL(hdr->address)); if (!hook) return; @@ -2201,12 +2201,12 @@ bool bthost_connect_rfcomm(struct bthost *bthost, uint16_t handle, &req, sizeof(req), NULL, NULL); } -void bthost_add_rfcomm_channel_hook(struct bthost *bthost, uint16_t handle, +void bthost_add_rfcomm_chan_hook(struct bthost *bthost, uint16_t handle, uint8_t channel, - bthost_rfcomm_channel_hook_func_t func, + bthost_rfcomm_chan_hook_func_t func, void *user_data) { - struct rfcomm_channel_hook *hook; + struct rfcomm_chan_hook *hook; struct btconn *conn; conn = bthost_find_conn(bthost, handle); @@ -2223,8 +2223,8 @@ void bthost_add_rfcomm_channel_hook(struct bthost *bthost, uint16_t handle, hook->func = func; hook->user_data = user_data; - hook->next = conn->rfcomm_channel_hooks; - conn->rfcomm_channel_hooks = hook; + hook->next = conn->rfcomm_chan_hooks; + conn->rfcomm_chan_hooks = hook; } void bthost_send_rfcomm_data(struct bthost *bthost, uint16_t handle, diff --git a/emulator/bthost.h b/emulator/bthost.h index 0d4594fec..50480942d 100644 --- a/emulator/bthost.h +++ b/emulator/bthost.h @@ -99,13 +99,12 @@ bool bthost_connect_rfcomm(struct bthost *bthost, uint16_t handle, uint8_t channel, bthost_rfcomm_connect_cb func, void *user_data); -typedef void (*bthost_rfcomm_channel_hook_func_t) (const void *data, - uint16_t len, +typedef void (*bthost_rfcomm_chan_hook_func_t) (const void *data, uint16_t len, void *user_data); -void bthost_add_rfcomm_channel_hook(struct bthost *bthost, uint16_t handle, +void bthost_add_rfcomm_chan_hook(struct bthost *bthost, uint16_t handle, uint8_t channel, - bthost_rfcomm_channel_hook_func_t func, + bthost_rfcomm_chan_hook_func_t func, void *user_data); void bthost_send_rfcomm_data(struct bthost *bthost, uint16_t handle, diff --git a/tools/rfcomm-tester.c b/tools/rfcomm-tester.c index e8fbe1df2..8be6e72bf 100644 --- a/tools/rfcomm-tester.c +++ b/tools/rfcomm-tester.c @@ -525,7 +525,7 @@ static void rfcomm_connect_cb(uint16_t handle, uint16_t cid, struct bthost *bthost = hciemu_client_get_host(data->hciemu); if (client_data->send_data) - bthost_add_rfcomm_channel_hook(bthost, handle, + bthost_add_rfcomm_chan_hook(bthost, handle, client_data->client_channel, client_hook_func, NULL); else if (client_data->read_data) @@ -670,7 +670,7 @@ static void client_new_conn(uint16_t handle, void *user_data) struct bthost *bthost; bthost = hciemu_client_get_host(data->hciemu); - bthost_add_rfcomm_channel_hook(bthost, handle, + bthost_add_rfcomm_chan_hook(bthost, handle, server_data->client_channel, server_hook_func, NULL); bthost_connect_rfcomm(bthost, handle, server_data->client_channel,