summaryrefslogtreecommitdiff
path: root/android/ipc-common.h
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/ipc-common.h
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/ipc-common.h')
-rw-r--r--android/ipc-common.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/android/ipc-common.h b/android/ipc-common.h
new file mode 100644
index 000000000..27736e4d6
--- /dev/null
+++ b/android/ipc-common.h
@@ -0,0 +1,38 @@
+/*
+ *
+ * BlueZ - Bluetooth protocol stack for Linux
+ *
+ * Copyright (C) 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
+ *
+ */
+
+#define IPC_MTU 1024
+
+#define IPC_STATUS_SUCCESS 0x00
+
+struct ipc_hdr {
+ uint8_t service_id;
+ uint8_t opcode;
+ uint16_t len;
+ uint8_t payload[0];
+} __attribute__((packed));
+
+#define IPC_OP_STATUS 0x00
+struct ipc_status {
+ uint8_t code;
+} __attribute__((packed));