diff options
author | Szymon Janc <szymon.janc@tieto.com> | 2013-10-21 20:56:49 +0200 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2013-10-21 22:48:50 +0300 |
commit | 16265b991696a13de4b92357496a498497c5bb21 (patch) | |
tree | cbe7ce403f93f74ebbd6ff007c1f3a9e64bf9069 /android/ipc.c | |
parent | 4e4307e2a85cf5e89918893527f14d6a58fff99c (diff) | |
download | bluez-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.c | 9 |
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); +} |