diff options
Diffstat (limited to 'samsung-ipc/ipc.c')
-rw-r--r-- | samsung-ipc/ipc.c | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/samsung-ipc/ipc.c b/samsung-ipc/ipc.c index 28da210..e25ba7e 100644 --- a/samsung-ipc/ipc.c +++ b/samsung-ipc/ipc.c @@ -51,6 +51,34 @@ int ipc_init(int client_type) return rc; } +int ipc_open(void) +{ + return ops != NULL && ops->open != NULL ? ops->open() : -1; +} + +int ipc_close(void) +{ + return ops != NULL && ops->close != NULL ? ops->close() : -1; +} + +void ipc_power_on(void) +{ + if (ops != NULL && ops->power_on != NULL) + ops->power_on(); +} + +void ipc_power_off(void) +{ + if (ops != NULL && ops->power_off != NULL) + ops->power_off(); +} + +void ipc_send(struct ipc_request *request) +{ + if (ops != NULL && ops->send != NULL) + ops->send(request); +} + /* Convenience functions for ipc_send */ inline void ipc_msg_send_get(const int command, unsigned char aseq) { @@ -75,6 +103,11 @@ void ipc_msg_send(const int command, const int type, unsigned char *data, const request.length = length; request.data = data; - ipc_send(&request); + ipc_send(&request); +} + +int ipc_recv(struct ipc_response *response) +{ + return ops != NULL && ops->recv != NULL ? ops->recv(response) : -1; } |