summaryrefslogtreecommitdiffstats
path: root/gisi/client.c
diff options
context:
space:
mode:
authorAki Niemi <aki.niemi@nokia.com>2009-09-15 15:35:47 +0300
committerAki Niemi <aki.niemi@nokia.com>2009-09-15 15:35:47 +0300
commit8bbd9a8560fe1f15b32d327eda3647cef6018623 (patch)
treecb5700bf469eecc6984b201349f1532c4990c52a /gisi/client.c
parentbee4bf4d7d52798889c6f33ebfe4c54ace60a902 (diff)
downloadofono-8bbd9a8560fe1f15b32d327eda3647cef6018623.tar.bz2
gisi: Add ISI version and reachability check API
This patch adds an API for querying the ISI version of the resource with which the client is associated. This information is only available after g_isi_verify() has been called on the client. This is because we use the version query message as a vehicle for reachability checking.
Diffstat (limited to 'gisi/client.c')
-rw-r--r--gisi/client.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/gisi/client.c b/gisi/client.c
index b3f685be..c592c3c9 100644
--- a/gisi/client.c
+++ b/gisi/client.c
@@ -41,6 +41,10 @@
struct _GIsiClient {
uint8_t resource;
+ struct {
+ int major;
+ int minor;
+ } version;
GIsiModem *modem;
/* Requests */
@@ -100,6 +104,8 @@ GIsiClient *g_isi_client_create(GIsiModem *modem, uint8_t resource)
abort();
cl = ptr;
cl->resource = resource;
+ cl->version.major = -1;
+ cl->version.minor = -1;
cl->modem = modem;
cl->debug_func = NULL;
memset(cl->timeout, 0, sizeof(cl->timeout));
@@ -133,6 +139,43 @@ GIsiClient *g_isi_client_create(GIsiModem *modem, uint8_t resource)
}
/**
+ * Set the ISI resource version of @a client.
+ * @param client client for the resource
+ * @param major ISI major version
+ * @param minor ISI minor version
+ */
+void g_isi_version_set(GIsiClient *client, int major, int minor)
+{
+ if (!client)
+ return;
+
+ client->version.major = major;
+ client->version.minor = minor;
+}
+
+/**
+ * Returns the ISI major version of the resource associated with @a
+ * client.
+ * @param client client for the resource
+ * @return major version, -1 if not available
+ */
+int g_isi_version_major(GIsiClient *client)
+{
+ return client->version.major;
+}
+
+/**
+ * Returns the ISI minor version of the resource associated with @a
+ * client.
+ * @param client client for the resource
+ * @return minor version, -1 if not available
+ */
+int g_isi_version_minor(GIsiClient *client)
+{
+ return client->version.minor;
+}
+
+/**
* Returns the resource associated with @a client
* @param client client for the resource
* @return PhoNet resource ID for the client