summaryrefslogtreecommitdiffstats
path: root/wifi-connman.c
diff options
context:
space:
mode:
authorsrimaldia <hariasti.srimaldia-1@jp.alps.com>2016-12-22 18:47:12 +0900
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>2016-12-22 21:24:42 +0000
commitb90397fb136d4e8b3bef68dfffd8e0e9b8658f6d (patch)
tree6eee38c86904a1987b95b749eabef173c73e2bac /wifi-connman.c
parentf67d4105a572345d1fed1231e06b99bd9411d040 (diff)
Add status icon for wifi
to test this, you need to add conf file under /etc/dbus-1/session.d/ <?xml version="1.0"?> <!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> <busconfig> <policy context="default"> <allow send_destination="org.agl.homescreen"/> </policy> </busconfig> Change-Id: I8fa1707883fa4c74460255949bc4ce1cd29cabf2 Signed-off-by: srimaldia <hariasti.srimaldia-1@jp.alps.com>
Diffstat (limited to 'wifi-connman.c')
-rw-r--r--wifi-connman.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/wifi-connman.c b/wifi-connman.c
index 74d2be7..68e5e3d 100644
--- a/wifi-connman.c
+++ b/wifi-connman.c
@@ -350,5 +350,40 @@ void registerPasskey(gchar *passkey) {
printf("Passkey: %s\n", passkey);
sendPasskey(passkey);
+
+}
+
+GError* setHMIStatus(enum wifiStates state) {
+
+ gchar *iconString = NULL;
+ GDBusConnection *connection;
+ GVariant *params = NULL;
+ GVariant *message = NULL;
+ GError *error = NULL;
+
+ if (state==BAR_NO) iconString = "qrc:/images/Status/HMI_Status_Wifi_NoBars-01.png";
+ else if (state==BAR_1) iconString = "qrc:/images/Status/HMI_Status_Wifi_1Bar-01.png";
+ else if (state==BAR_2) iconString = "qrc:/images/Status/HMI_Status_Wifi_2Bars-01.png";
+ else if (state==BAR_3) iconString = "qrc:/images/Status/HMI_Status_Wifi_3Bars-01.png";
+ else if (state==BAR_FULL) iconString = "qrc:/images/Status/HMI_Status_Wifi_Full-01.png";
+ else iconString = "qrc:/images/Status/HMI_Status_Wifi_NoBars-01.png";
+
+ connection = g_bus_get_sync(G_BUS_TYPE_SESSION, NULL, &error);
+
+ params = g_variant_new("(is)", HOMESCREEN_WIFI_ICON_POSITION, iconString);
+
+ message = g_dbus_connection_call_sync(connection, HOMESCREEN_SERVICE,
+ HOMESCREEN_ICON_PATH, HOMESCREEN_ICON_INTERFACE, "setStatusIcon", params,
+ NULL, G_DBUS_CALL_FLAGS_NONE,
+ DBUS_REPLY_TIMEOUT, NULL, &error);
+
+ if (error) {
+ printf("error: %s\n", error->message);
+
+ return error;
+ } else {
+ return NULL;
+ }
+
}