summaryrefslogtreecommitdiffstats
path: root/binding-bluetooth/bluetooth-manager.c
diff options
context:
space:
mode:
authorJan-Simon Moeller <jsmoeller@linuxfoundation.org>2016-12-22 21:54:27 +0000
committerGerrit Code Review <gerrit@automotivelinux.org>2016-12-22 21:54:27 +0000
commita0a4afb1f26bf6d8c75e7f4907dd6c3b0771b0f6 (patch)
treeafcc5bbb578172cbe2e5c31680fe95f53361190b /binding-bluetooth/bluetooth-manager.c
parent9b6ef23ba4a5cc3389dacad20220dd4308986da7 (diff)
parent3e63800b18c385cb0b52c593daa1f535498d01f0 (diff)
Merge "Add status icon for bluetooth"
Diffstat (limited to 'binding-bluetooth/bluetooth-manager.c')
-rw-r--r--binding-bluetooth/bluetooth-manager.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/binding-bluetooth/bluetooth-manager.c b/binding-bluetooth/bluetooth-manager.c
index 4c49196..893760d 100644
--- a/binding-bluetooth/bluetooth-manager.c
+++ b/binding-bluetooth/bluetooth-manager.c
@@ -743,5 +743,36 @@ int isHFPConnected(struct btd_device *addr) {
}
+GError* setHMIStatus(enum btStates state) {
+
+ gchar *iconString = NULL;
+ GDBusConnection *connection;
+ GVariant *params = NULL;
+ GVariant *message = NULL;
+ GError *error = NULL;
+
+ if (state==INACTIVE) iconString = "qrc:/images/Status/HMI_Status_Bluetooth_Inactive-01.png";
+ else if (state==ACTIVE) iconString = "qrc:/images/Status/HMI_Status_Bluetooth_On-01.png";
+ else iconString = "qrc:/images/Status/HMI_Status_Bluetooth_Inactive-01.png";
+
+ connection = g_bus_get_sync(G_BUS_TYPE_SESSION, NULL, &error);
+
+ params = g_variant_new("(is)", HOMESCREEN_BT_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;
+ }
+
+}
+
/************************************** The End Of File **************************************/