[PATCH v3 09/11] android: Add IPC helper for convenient error sending

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This simple helper will simplify error paths in code.
---
 android/ipc.c | 9 +++++++++
 android/ipc.h | 1 +
 2 files changed, 10 insertions(+)

diff --git a/android/ipc.c b/android/ipc.c
index 449ba23..406a19b 100644
--- a/android/ipc.c
+++ b/android/ipc.c
@@ -78,3 +78,12 @@ void ipc_send(GIOChannel *io, uint8_t service_id, uint8_t opcode, uint16_t len,
 		main_quit();
 	}
 }
+
+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);
+}
diff --git a/android/ipc.h b/android/ipc.h
index db92c97..4b0ee2a 100644
--- a/android/ipc.h
+++ b/android/ipc.h
@@ -23,3 +23,4 @@
 
 void ipc_send(GIOChannel *io, uint8_t service_id, uint8_t opcode, uint16_t len,
 							void *param, int fd);
+void ipc_send_error(GIOChannel *io, uint8_t service_id, uint8_t status);
-- 
1.8.4

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux