summaryrefslogtreecommitdiff
path: root/android/hal-ipc.c
diff options
context:
space:
mode:
authorSzymon Janc <szymon.janc@tieto.com>2014-02-24 17:05:03 +0100
committerSzymon Janc <szymon.janc@tieto.com>2014-02-28 15:22:45 +0100
commit7d95d027b19a23810c59c64af8c8095076a657b8 (patch)
tree02f40c3ad7580da9b394161003e000b8d804e081 /android/hal-ipc.c
parentd61f3fc72e6d3961bd82cfdd094b586d65ede4bc (diff)
downloadbluez-7d95d027b19a23810c59c64af8c8095076a657b8.tar.gz
android: Create comon header for IPC
This header contains IPC specific structures and code not related to BT and audio HAL protocols. This allows to fully decouple IPC from HAL messages. This is first step to make HAL part of IPC unit-testable and reusable between BT HAL and audio HAL.
Diffstat (limited to 'android/hal-ipc.c')
-rw-r--r--android/hal-ipc.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/android/hal-ipc.c b/android/hal-ipc.c
index 1ba03f5c6..fda32284b 100644
--- a/android/hal-ipc.c
+++ b/android/hal-ipc.c
@@ -31,6 +31,7 @@
#include "hal.h"
#include "hal-msg.h"
#include "hal-log.h"
+#include "ipc-common.h"
#include "hal-ipc.h"
#define CONNECT_TIMEOUT (5 * 1000)
@@ -64,7 +65,7 @@ void hal_ipc_unregister(uint8_t service)
static void handle_msg(void *buf, ssize_t len)
{
- struct hal_hdr *msg = buf;
+ struct ipc_hdr *msg = buf;
const struct hal_ipc_handler *handler;
uint8_t opcode;
@@ -130,7 +131,7 @@ static void *notification_handler(void *data)
struct iovec iv;
struct cmsghdr *cmsg;
char cmsgbuf[CMSG_SPACE(sizeof(int))];
- char buf[BLUEZ_HAL_MTU];
+ char buf[IPC_MTU];
ssize_t ret;
int fd;
@@ -320,9 +321,9 @@ int hal_ipc_cmd(uint8_t service_id, uint8_t opcode, uint16_t len, void *param,
ssize_t ret;
struct msghdr msg;
struct iovec iv[2];
- struct hal_hdr cmd;
+ struct ipc_hdr cmd;
char cmsgbuf[CMSG_SPACE(sizeof(int))];
- struct hal_status s;
+ struct ipc_status s;
size_t s_len = sizeof(s);
if (cmd_sk < 0) {
@@ -418,7 +419,7 @@ int hal_ipc_cmd(uint8_t service_id, uint8_t opcode, uint16_t len, void *param,
}
if (cmd.opcode == HAL_OP_STATUS) {
- struct hal_status *s = rsp;
+ struct ipc_status *s = rsp;
if (sizeof(*s) != cmd.len) {
error("Invalid status length, aborting");