aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaulK <contact@paulk.fr>2012-06-06 21:08:18 +0200
committerPaulK <contact@paulk.fr>2012-06-06 21:08:18 +0200
commit3efc903a65428be0be4b5611e9d953a1476aa051 (patch)
tree891fb27fc508bc99efefc352f0afa77518e2235f
parent74664ce8d19f747e89a38d1c5fe439c6afb155f6 (diff)
downloadexternal_libsamsung-ipc-3efc903a65428be0be4b5611e9d953a1476aa051.zip
external_libsamsung-ipc-3efc903a65428be0be4b5611e9d953a1476aa051.tar.gz
external_libsamsung-ipc-3efc903a65428be0be4b5611e9d953a1476aa051.tar.bz2
Introducing device-specific GPRS activation/deactivation functions mechanism
Signed-off-by: PaulK <contact@paulk.fr>
-rw-r--r--include/radio.h3
-rw-r--r--samsung-ipc/ipc.c37
-rw-r--r--samsung-ipc/ipc_private.h8
3 files changed, 48 insertions, 0 deletions
diff --git a/include/radio.h b/include/radio.h
index 3cd8834..12b7aa0 100644
--- a/include/radio.h
+++ b/include/radio.h
@@ -79,6 +79,9 @@ 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_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);
int ipc_client_recv(struct ipc_client *client, struct ipc_message_info *response);
diff --git a/samsung-ipc/ipc.c b/samsung-ipc/ipc.c
index eb0eeff..a43cde2 100644
--- a/samsung-ipc/ipc.c
+++ b/samsung-ipc/ipc.c
@@ -217,6 +217,8 @@ int ipc_client_set_handlers_common_data(struct ipc_client *client, void *data)
client->handlers->close_data = common_data;
client->handlers->power_on_data = common_data;
client->handlers->power_off_data = common_data;
+ client->handlers->gprs_activate_data = common_data;
+ client->handlers->gprs_deactivate_data = common_data;
return 0;
}
@@ -247,6 +249,8 @@ int ipc_client_create_handlers_common_data(struct ipc_client *client)
client->handlers->close_data = common_data;
client->handlers->power_on_data = common_data;
client->handlers->power_off_data = common_data;
+ client->handlers->gprs_activate_data = common_data;
+ client->handlers->gprs_deactivate_data = common_data;
return 0;
}
@@ -275,6 +279,8 @@ int ipc_client_destroy_handlers_common_data(struct ipc_client *client)
client->handlers->close_data = common_data;
client->handlers->power_on_data = common_data;
client->handlers->power_off_data = common_data;
+ client->handlers->gprs_activate_data = common_data;
+ client->handlers->gprs_deactivate_data = common_data;
return 0;
}
@@ -355,6 +361,37 @@ 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_activate(struct ipc_client *client)
+{
+ if (client == NULL ||
+ client->handlers == NULL ||
+ client->handlers->gprs_activate == NULL)
+ return -1;
+
+ return client->handlers->gprs_activate(client->handlers->gprs_activate_data);
+}
+
+int ipc_client_gprs_deactivate(struct ipc_client *client)
+{
+ if (client == NULL ||
+ client->handlers == NULL ||
+ client->handlers->gprs_deactivate == NULL)
+ return -1;
+
+ return client->handlers->gprs_deactivate(client->handlers->gprs_deactivate_data);
+}
+
+int ipc_client_gprs_get_iface(struct ipc_client *client, char **iface)
+{
+ if (client == NULL ||
+ client->handlers == NULL ||
+ client->handlers->gprs_get_iface == NULL)
+ return -1;
+
+ return client->handlers->gprs_get_iface(iface);
+}
+
int _ipc_client_send(struct ipc_client *client, struct ipc_message_info *request)
{
if (client == NULL ||
diff --git a/samsung-ipc/ipc_private.h b/samsung-ipc/ipc_private.h
index a296260..c43833c 100644
--- a/samsung-ipc/ipc_private.h
+++ b/samsung-ipc/ipc_private.h
@@ -46,6 +46,14 @@ struct ipc_handlers {
ipc_handler_cb power_off;
void *power_off_data;
+ /* GPRS handlers */
+
+ ipc_handler_cb gprs_activate;
+ void *gprs_activate_data;
+ ipc_handler_cb gprs_deactivate;
+ void *gprs_deactivate_data;
+ int (*gprs_get_iface)(char **iface);
+
/* Handlers common data*/
void *common_data;