aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaulK <contact@paulk.fr>2012-06-07 22:22:23 +0200
committerPaulK <contact@paulk.fr>2012-06-07 22:22:23 +0200
commit67bb78c3e7d0991d1f1bbd7fccf2f9986cb34c7c (patch)
treed5001837414fe2cfe8b1423687d97b50c2fc0029
parent63a3609348e04a1899b69a4f95e626408497f230 (diff)
downloadexternal_libsamsung-ipc-67bb78c3e7d0991d1f1bbd7fccf2f9986cb34c7c.zip
external_libsamsung-ipc-67bb78c3e7d0991d1f1bbd7fccf2f9986cb34c7c.tar.gz
external_libsamsung-ipc-67bb78c3e7d0991d1f1bbd7fccf2f9986cb34c7c.tar.bz2
Function to check if GPRS activation/deactivation functions are available
Signed-off-by: PaulK <contact@paulk.fr>
-rw-r--r--include/radio.h1
-rw-r--r--samsung-ipc/ipc.c15
2 files changed, 15 insertions, 1 deletions
diff --git a/include/radio.h b/include/radio.h
index 12b7aa0..7a18096 100644
--- a/include/radio.h
+++ b/include/radio.h
@@ -79,6 +79,7 @@ int ipc_client_open(struct ipc_client *client);
int ipc_client_close(struct ipc_client *client);
int ipc_client_power_on(struct ipc_client *client);
int ipc_client_power_off(struct ipc_client *client);
+int ipc_client_gprs_handlers_available(struct ipc_client *client);
int ipc_client_gprs_activate(struct ipc_client *client);
int ipc_client_gprs_deactivate(struct ipc_client *client);
int ipc_client_gprs_get_iface(struct ipc_client *client, char **iface);
diff --git a/samsung-ipc/ipc.c b/samsung-ipc/ipc.c
index a43cde2..301f452 100644
--- a/samsung-ipc/ipc.c
+++ b/samsung-ipc/ipc.c
@@ -361,7 +361,20 @@ int ipc_client_power_off(struct ipc_client *client)
return client->handlers->power_off(client->handlers->power_off_data);
}
-// README: This will return -1 whenever such setup isn't needed, though it works
+int ipc_client_gprs_handlers_available(struct ipc_client *client)
+{
+ if (client == NULL ||
+ client->handlers == NULL)
+ return -1;
+
+ if(client->handlers->gprs_activate != NULL &&
+ client->handlers->gprs_deactivate != NULL &&
+ client->handlers->gprs_get_iface != NULL)
+ return 1;
+ else
+ return 0;
+}
+
int ipc_client_gprs_activate(struct ipc_client *client)
{
if (client == NULL ||