diff options
author | Simon Busch <morphis@gravedo.de> | 2011-08-25 18:23:15 +0200 |
---|---|---|
committer | Simon Busch <morphis@gravedo.de> | 2011-08-25 18:23:15 +0200 |
commit | f6bbbfa9c5e038e838e5641764666f53a04b2985 (patch) | |
tree | db5969d31334fb424f338cc24f2467ab6ccd0c87 /samsung-ipc/ipc.c | |
parent | 7d80f41d7cda80978db6c93e6e50422c93f133d4 (diff) | |
download | external_libsamsung-ipc-f6bbbfa9c5e038e838e5641764666f53a04b2985.zip external_libsamsung-ipc-f6bbbfa9c5e038e838e5641764666f53a04b2985.tar.gz external_libsamsung-ipc-f6bbbfa9c5e038e838e5641764666f53a04b2985.tar.bz2 |
Use ipc ops in public API methods
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; } |