OSDN Git Service

android: Add IPC helper for sending notifications
authorSzymon Janc <szymon.janc@tieto.com>
Thu, 28 Nov 2013 14:15:24 +0000 (15:15 +0100)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Thu, 28 Nov 2013 16:02:26 +0000 (18:02 +0200)
This will use notification socket passed on IPC init.

android/ipc.c
android/ipc.h

index 51734e3..d1a59d7 100644 (file)
@@ -109,3 +109,12 @@ void ipc_send_rsp(uint8_t service_id, uint8_t opcode, uint8_t status)
 
        ipc_send(cmd_sk, service_id, HAL_OP_STATUS, sizeof(s), &s, -1);
 }
+
+void ipc_send_notif(uint8_t service_id, uint8_t opcode,  uint16_t len,
+                                                               void *param)
+{
+       if (notif_sk < 0)
+               return;
+
+       ipc_send(notif_sk, service_id, opcode, len, param, -1);
+}
index 873f715..1233bec 100644 (file)
@@ -27,3 +27,5 @@ void ipc_cleanup(void);
 void ipc_send(int sk, uint8_t service_id, uint8_t opcode, uint16_t len,
                                                        void *param, int fd);
 void ipc_send_rsp(uint8_t service_id, uint8_t opcode, uint8_t status);
+void ipc_send_notif(uint8_t service_id, uint8_t opcode,  uint16_t len,
+                                                               void *param);