summaryrefslogtreecommitdiff
path: root/android/ipc.c
diff options
context:
space:
mode:
authorSzymon Janc <szymon.janc@tieto.com>2013-10-21 20:56:49 +0200
committerJohan Hedberg <johan.hedberg@intel.com>2013-10-21 22:48:50 +0300
commit16265b991696a13de4b92357496a498497c5bb21 (patch)
treecbe7ce403f93f74ebbd6ff007c1f3a9e64bf9069 /android/ipc.c
parent4e4307e2a85cf5e89918893527f14d6a58fff99c (diff)
downloadbluez-16265b991696a13de4b92357496a498497c5bb21.tar.gz
android: Add IPC helper for convenient error sending
This simple helper will simplify error paths in code.
Diffstat (limited to 'android/ipc.c')
-rw-r--r--android/ipc.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/android/ipc.c b/android/ipc.c
index 1840624d5..1a867fb44 100644
--- a/android/ipc.c
+++ b/android/ipc.c
@@ -77,3 +77,12 @@ void ipc_send(GIOChannel *io, uint8_t service_id, uint8_t opcode, uint16_t len,
raise(SIGTERM);
}
}
+
+void ipc_send_error(GIOChannel *io, uint8_t service_id, uint8_t status)
+{
+ struct hal_msg_rsp_error err;
+
+ err.status = status;
+
+ ipc_send(io, service_id, HAL_MSG_OP_ERROR, sizeof(err), &err, -1);
+}