diff options
author | Simon Busch <morphis@gravedo.de> | 2011-10-09 18:43:28 +0200 |
---|---|---|
committer | Simon Busch <morphis@gravedo.de> | 2011-10-10 08:23:23 +0200 |
commit | 743ede5407a6e8b8baeb9c5b10cfc80d428ae847 (patch) | |
tree | 3d7d5eb9b849528c3db1f8969c775c74199287d6 /tools/modemctrl.c | |
parent | 1cec835e06ddbf9d5229ff0a080e0e36106d64f3 (diff) | |
download | external_libsamsung-ipc-743ede5407a6e8b8baeb9c5b10cfc80d428ae847.zip external_libsamsung-ipc-743ede5407a6e8b8baeb9c5b10cfc80d428ae847.tar.gz external_libsamsung-ipc-743ede5407a6e8b8baeb9c5b10cfc80d428ae847.tar.bz2 |
Rework API of this library to integrate better with other environments than Android
* send/recv is now done outside this library; the user has to provide callbacks for send
and recv
* it's now possible to create more than one ipc client as every ipc API method needs an
object of type ipc_client (which is the context it operates in)
* there are now two different client types for the crespo machine: RFS and FMT
* disabled h1 client for now
* removed power on/off functionality; should be done by another userland component with
handling the correct sysfs nodes rather than dealing with ioctls for this.
* updated vala interface description file to reflect API changes
* various source code cleanups
Signed-off-by: Simon Busch <morphis@gravedo.de>
Diffstat (limited to 'tools/modemctrl.c')
-rw-r--r-- | tools/modemctrl.c | 53 |
1 files changed, 22 insertions, 31 deletions
diff --git a/tools/modemctrl.c b/tools/modemctrl.c index e7758a7..14237eb 100644 --- a/tools/modemctrl.c +++ b/tools/modemctrl.c @@ -21,43 +21,34 @@ #include <stdlib.h> #include <stdio.h> #include <unistd.h> - #include <radio.h> void print_help() { - printf("usage: modemctrl <command>\n"); - printf("commands:\n"); - printf("\tbootstrap bootstrap modem to be ready for processing\n"); - printf("\tpower-on power on the modem\n"); - printf("\tpower-off power off the modem\n"); + printf("usage: modemctrl <command>\n"); + printf("commands:\n"); + printf("\tbootstrap bootstrap modem to be ready for processing\n"); + printf("\tpower-on power on the modem\n"); + printf("\tpower-off power off the modem\n"); } int main(int argc, char *argv[]) { - struct ipc_response response; - int error; - - if (argc != 2) { - print_help(); - exit(1); - } - - ipc_init(IPC_CLIENT_TYPE_CRESPO); - - if (!strncmp(argv[1], "bootstrap", 9)) { - ipc_bootstrap(); - } - else if (!strncmp(argv[1], "power-on", 8)) { - ipc_open(); - ipc_power_on(); - ipc_close(); - } - else if (!strncmp(argv[1], "power-off", 9)) { - ipc_open(); - ipc_power_off(); - ipc_close(); - } - - return 0; + struct ipc_client *client; + int error; + + if (argc != 2) { + print_help(); + exit(1); + } + + client = ipc_client_new(IPC_CLIENT_TYPE_CRESPO_FMT); + + if (!strncmp(argv[1], "bootstrap", 9)) { + ipc_client_bootstrap_modem(client); + } + + ipc_client_free(client); + + return 0; } |