Mercurial > audlegacy-plugins
annotate src/bluetooth/bluetooth.c @ 2854:43557eb3180f
playback
author | Paula Stanciu <paula.stanciu@gmail.com> |
---|---|
date | Wed, 30 Jul 2008 17:49:43 +0300 |
parents | 671cdfc2d62d |
children | 162766a69f12 |
rev | line source |
---|---|
2839 | 1 /* |
2 * Audacious Bluetooth headset suport plugin | |
3 * | |
4 * Copyright (c) 2008 Paula Stanciu paula.stanciu@gmail.com | |
5 * | |
6 * This program is free software; you can redistribute it and/or modify | |
7 * it under the terms of the GNU General Public License as published by | |
8 * the Free Software Foundation; under version 3 of the License. | |
9 * | |
10 * This program is distributed in the hope that it will be useful, | |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 * GNU General Public License for more details. | |
14 * | |
15 * You should have received a copy of the GNU General Public License | |
16 * along with this program. If not, see <http://www.gnu.org/licenses>. | |
17 */ | |
18 | |
2644 | 19 #include "bluetooth.h" |
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
20 #include "marshal.h" |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
21 #include "gui.h" |
2728 | 22 #include "scan_gui.h" |
2838
22a2ffe86750
added passkey agent and basic pairing functionality
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2756
diff
changeset
|
23 #include "agent.h" |
2854 | 24 #include "../alsa/alsa.h" |
2644 | 25 #define DEBUG 1 |
26 static gboolean plugin_active = FALSE,exiting=FALSE; | |
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
27 GList * current_device = NULL; |
2728 | 28 gint config = 0; |
29 gint devices_no = 0; | |
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
30 GStaticMutex mutex = G_STATIC_MUTEX_INIT; |
2845
d0cbf303869b
removed interface freeze while pairing
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2842
diff
changeset
|
31 static GThread *connect_th; |
2644 | 32 void bluetooth_init ( void ); |
33 void bluetooth_cleanup ( void ); | |
34 void bt_cfg(void); | |
35 void bt_about(void); | |
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
36 static void remote_device_found(DBusGProxy *object, char *address, const unsigned int class, const int rssi, gpointer user_data); |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
37 static void discovery_started(DBusGProxy *object, gpointer user_data); |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
38 static void remote_name_updated(DBusGProxy *object, const char *address, char *name, gpointer user_data); |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
39 static void print_results(void); |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
40 static void discovery_completed(DBusGProxy *object, gpointer user_data); |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
41 void discover_devices(void); |
2728 | 42 void disconnect_dbus_signals(void); |
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
43 |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
44 |
2644 | 45 GeneralPlugin bluetooth_gp = |
46 { | |
2649
d891ba4be5a5
fixed crash when prefs window was closed while scanning
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2648
diff
changeset
|
47 .description = "Bluetooth audio support", |
2644 | 48 .init = bluetooth_init, |
49 .about = bt_about, | |
50 .configure = bt_cfg, | |
51 .cleanup = bluetooth_cleanup | |
52 }; | |
53 GeneralPlugin *bluetooth_gplist[] = { &bluetooth_gp, NULL }; | |
54 DECLARE_PLUGIN(bluetooth_gp, NULL, NULL, NULL, NULL, NULL, bluetooth_gplist, NULL, NULL) | |
2728 | 55 |
2644 | 56 void bluetooth_init ( void ) |
57 { | |
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
58 audio_devices = NULL; |
2838
22a2ffe86750
added passkey agent and basic pairing functionality
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2756
diff
changeset
|
59 bus = NULL; |
22a2ffe86750
added passkey agent and basic pairing functionality
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2756
diff
changeset
|
60 obj = NULL; |
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
61 discover_devices(); |
2644 | 62 } |
63 | |
64 void bluetooth_cleanup ( void ) | |
65 { | |
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
66 printf("bluetooth: exit\n"); |
2732
1a27c497e526
indentation and some small bug fixing
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2728
diff
changeset
|
67 if (config ==1 ){ |
2756
d3d71539d675
rescan functionality
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2734
diff
changeset
|
68 close_window(); |
2732
1a27c497e526
indentation and some small bug fixing
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2728
diff
changeset
|
69 config =0; |
2649
d891ba4be5a5
fixed crash when prefs window was closed while scanning
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2648
diff
changeset
|
70 } |
2732
1a27c497e526
indentation and some small bug fixing
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2728
diff
changeset
|
71 if(discover_finish == 2) { |
1a27c497e526
indentation and some small bug fixing
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2728
diff
changeset
|
72 dbus_g_connection_flush (bus); |
2734 | 73 dbus_g_connection_unref(bus); |
2732
1a27c497e526
indentation and some small bug fixing
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2728
diff
changeset
|
74 disconnect_dbus_signals(); |
2644 | 75 |
2732
1a27c497e526
indentation and some small bug fixing
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2728
diff
changeset
|
76 } |
2734 | 77 } |
2732
1a27c497e526
indentation and some small bug fixing
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2728
diff
changeset
|
78 |
2734 | 79 void bt_about( void ) |
80 { | |
81 printf("about call\n"); | |
82 } | |
2728 | 83 |
2734 | 84 void bt_cfg(void) |
85 { | |
86 printf("bt_cfg\n"); | |
87 config =1; | |
88 if(discover_finish == 2){ | |
89 if (devices_no == 0){ | |
90 printf("no devs!\n"); | |
2847
671cdfc2d62d
Basic pairing interface
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2846
diff
changeset
|
91 show_scan(0); |
2734 | 92 show_no_devices(); |
93 }else | |
94 results_ui(); | |
2728 | 95 } |
2847
671cdfc2d62d
Basic pairing interface
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2846
diff
changeset
|
96 else show_scan(0); |
2734 | 97 printf("end of bt_cfg\n"); |
98 } | |
2728 | 99 |
2734 | 100 void disconnect_dbus_signals() |
101 { | |
102 dbus_g_proxy_disconnect_signal(obj, "RemoteDeviceFound", G_CALLBACK(remote_device_found), bus); | |
103 dbus_g_proxy_disconnect_signal(obj, "DiscoveryStarted", G_CALLBACK(discovery_started), bus); | |
104 dbus_g_proxy_disconnect_signal(obj, "DiscoveryCompleted", G_CALLBACK(discovery_completed), bus); | |
105 dbus_g_proxy_disconnect_signal(obj, "RemoteNameUpdated", G_CALLBACK(remote_name_updated), NULL); | |
2644 | 106 |
2734 | 107 } |
2644 | 108 |
2756
d3d71539d675
rescan functionality
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2734
diff
changeset
|
109 void clean_devices_list(){ |
d3d71539d675
rescan functionality
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2734
diff
changeset
|
110 g_list_free(audio_devices); |
d3d71539d675
rescan functionality
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2734
diff
changeset
|
111 dbus_g_connection_flush (bus); |
d3d71539d675
rescan functionality
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2734
diff
changeset
|
112 dbus_g_connection_unref(bus); |
d3d71539d675
rescan functionality
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2734
diff
changeset
|
113 audio_devices = NULL; |
d3d71539d675
rescan functionality
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2734
diff
changeset
|
114 //g_list_free(current_device); |
d3d71539d675
rescan functionality
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2734
diff
changeset
|
115 } |
2644 | 116 |
2734 | 117 void refresh_call(void) |
118 { | |
119 printf("refresh function called\n"); | |
120 disconnect_dbus_signals(); | |
2756
d3d71539d675
rescan functionality
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2734
diff
changeset
|
121 clean_devices_list(); |
2734 | 122 if(discover_finish == 0 ||discover_finish== 2){ |
123 discover_finish = 0; | |
2756
d3d71539d675
rescan functionality
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2734
diff
changeset
|
124 |
2734 | 125 discover_devices(); |
2756
d3d71539d675
rescan functionality
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2734
diff
changeset
|
126 close_window(); |
2847
671cdfc2d62d
Basic pairing interface
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2846
diff
changeset
|
127 show_scan(0); |
2728 | 128 } |
2734 | 129 else |
130 printf("Scanning please wait!\n"); | |
131 } | |
2644 | 132 |
2845
d0cbf303869b
removed interface freeze while pairing
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2842
diff
changeset
|
133 gpointer connect_call_th(void) |
2734 | 134 { |
2841 | 135 |
136 //I will have to enable the audio service if necessary | |
2838
22a2ffe86750
added passkey agent and basic pairing functionality
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2756
diff
changeset
|
137 |
2845
d0cbf303869b
removed interface freeze while pairing
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2842
diff
changeset
|
138 dbus_g_object_register_marshaller(marshal_VOID__STRING_UINT_INT, G_TYPE_NONE, G_TYPE_STRING, G_TYPE_UINT, G_TYPE_INT, G_TYPE_INVALID); |
2841 | 139 run_agents(); |
2845
d0cbf303869b
removed interface freeze while pairing
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2842
diff
changeset
|
140 dbus_g_proxy_call(obj,"CreateBonding",NULL,G_TYPE_STRING,((DeviceData*)(selected_dev->data))->address,G_TYPE_INVALID,G_TYPE_INVALID); |
d0cbf303869b
removed interface freeze while pairing
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2842
diff
changeset
|
141 |
d0cbf303869b
removed interface freeze while pairing
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2842
diff
changeset
|
142 } |
d0cbf303869b
removed interface freeze while pairing
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2842
diff
changeset
|
143 void connect_call(void) |
d0cbf303869b
removed interface freeze while pairing
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2842
diff
changeset
|
144 { |
2847
671cdfc2d62d
Basic pairing interface
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2846
diff
changeset
|
145 connect_th = g_thread_create((GThreadFunc)connect_call_th,NULL,TRUE,NULL) ; |
671cdfc2d62d
Basic pairing interface
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2846
diff
changeset
|
146 close_call(); |
671cdfc2d62d
Basic pairing interface
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2846
diff
changeset
|
147 close_window(); |
671cdfc2d62d
Basic pairing interface
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2846
diff
changeset
|
148 show_scan(1); |
2734 | 149 } |
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
150 |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
151 |
2854 | 152 void play_call() |
153 { | |
154 // static GFile *asoundrc; | |
155 | |
156 | |
157 | |
158 mcs_handle_t *cfgfile = aud_cfg_db_open(); | |
159 | |
160 aud_cfg_db_set_int(cfgfile, ALSA_CFGID, "buffer_time", 500); | |
161 aud_cfg_db_set_int(cfgfile, ALSA_CFGID, "period_time", 100); | |
162 aud_cfg_db_set_string(cfgfile,ALSA_CFGID,"pcm_device", "bt"); | |
163 aud_cfg_db_set_int(cfgfile, ALSA_CFGID, "mixer_card", 0); | |
164 aud_cfg_db_set_string(cfgfile,ALSA_CFGID,"mixer_device", "PCM"); | |
165 aud_cfg_db_set_int(cfgfile, ALSA_CFGID, "volume_left", 100); | |
166 aud_cfg_db_set_int(cfgfile, ALSA_CFGID, "volume_right", 100); | |
167 aud_cfg_db_close(cfgfile); | |
168 | |
169 printf("play callback\n"); | |
170 | |
171 | |
172 } | |
173 | |
174 | |
2734 | 175 static void remote_device_found(DBusGProxy *object, char *address, const unsigned int class, const int rssi, gpointer user_data) |
176 { | |
177 int found_in_list=FALSE; | |
178 g_static_mutex_lock(&mutex); | |
179 current_device = audio_devices; | |
180 if((class & 0x200404)==0x200404) | |
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
181 { |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
182 while(current_device != NULL) |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
183 { |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
184 if(g_str_equal(address,((DeviceData*)(current_device->data))->address)) |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
185 { |
2734 | 186 found_in_list = TRUE; |
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
187 break; |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
188 } |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
189 current_device=g_list_next(current_device); |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
190 } |
2734 | 191 if(!found_in_list) |
192 { | |
193 DeviceData *dev= g_new0(DeviceData, 1); | |
194 dev->class = class; | |
195 dev->address = g_strdup(address); | |
196 dev->name = NULL; | |
197 audio_devices=g_list_prepend(audio_devices, dev); | |
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
198 } |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
199 } |
2734 | 200 g_static_mutex_unlock(&mutex); |
201 } | |
202 | |
203 static void discovery_started(DBusGProxy *object, gpointer user_data) | |
204 { | |
205 g_print("Signal: DiscoveryStarted()\n"); | |
206 discover_finish = 1; | |
207 } | |
208 | |
209 static void remote_name_updated(DBusGProxy *object, const char *address, char *name, gpointer user_data) | |
210 { | |
211 g_static_mutex_lock(&mutex); | |
212 current_device=audio_devices; | |
213 while(current_device != NULL) | |
214 { | |
215 if(g_str_equal(address,((DeviceData*)(current_device->data))->address)) | |
216 { | |
217 ((DeviceData*)(current_device->data))->name=g_strdup(name); | |
218 break; | |
219 } | |
220 current_device=g_list_next(current_device); | |
221 } | |
222 g_static_mutex_unlock(&mutex); | |
223 } | |
224 | |
225 static void print_results() | |
226 { | |
227 int i=0; | |
228 g_print("Final Scan results:\n"); | |
229 devices_no = g_list_length(audio_devices); | |
230 g_print("Number of audio devices: %d \n",devices_no); | |
231 if(devices_no==0 ) { | |
232 if(config ==1) show_no_devices(); | |
233 } else { | |
234 current_device=audio_devices; | |
235 while(current_device != NULL) | |
236 { | |
237 g_print("Device %d: Name: %s, Class: 0x%x, Address: %s\n",++i, | |
238 ((DeviceData*)(current_device->data))-> name, | |
239 ((DeviceData*)(current_device->data))-> class, | |
240 ((DeviceData*)(current_device->data))-> address); | |
241 current_device=g_list_next(current_device); | |
242 } | |
243 destroy_scan_window(); | |
244 if(config==1) { | |
245 destroy_scan_window(); | |
246 results_ui(); | |
247 } | |
248 // refresh_tree(); | |
249 } | |
250 } | |
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
251 |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
252 |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
253 |
2734 | 254 static void discovery_completed(DBusGProxy *object, gpointer user_data) |
255 { | |
256 g_print("Signal: DiscoveryCompleted()\n"); | |
257 discover_finish =2; | |
258 print_results(); | |
259 } | |
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
260 |
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
261 |
2728 | 262 |
2734 | 263 void discover_devices(void) |
264 { | |
265 GError *error = NULL; | |
266 // g_type_init(); | |
267 g_log_set_always_fatal (G_LOG_LEVEL_WARNING); | |
268 bus = dbus_g_bus_get(DBUS_BUS_SYSTEM, &error); | |
269 if (error != NULL) | |
270 { | |
271 g_printerr("Connecting to system bus failed: %s\n", error->message); | |
272 g_error_free(error); | |
273 } | |
274 obj = dbus_g_proxy_new_for_name(bus, "org.bluez", "/org/bluez/hci0", "org.bluez.Adapter"); | |
275 printf("bluetooth plugin - start discovery \n"); | |
276 dbus_g_object_register_marshaller(marshal_VOID__STRING_UINT_INT, G_TYPE_NONE, G_TYPE_STRING, G_TYPE_UINT, G_TYPE_INT, G_TYPE_INVALID); | |
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
277 |
2734 | 278 dbus_g_proxy_add_signal(obj, "RemoteDeviceFound", G_TYPE_STRING, G_TYPE_UINT, G_TYPE_INT, G_TYPE_INVALID); |
279 dbus_g_proxy_connect_signal(obj, "RemoteDeviceFound", G_CALLBACK(remote_device_found), bus, NULL); | |
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
280 |
2734 | 281 dbus_g_proxy_add_signal(obj, "DiscoveryStarted", G_TYPE_INVALID); |
282 dbus_g_proxy_connect_signal(obj, "DiscoveryStarted", G_CALLBACK(discovery_started), bus, NULL); | |
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
283 |
2734 | 284 dbus_g_proxy_add_signal(obj, "DiscoveryCompleted", G_TYPE_INVALID); |
285 dbus_g_proxy_connect_signal(obj, "DiscoveryCompleted", G_CALLBACK(discovery_completed), bus, NULL); | |
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
286 |
2734 | 287 dbus_g_object_register_marshaller(marshal_VOID__STRING_STRING, G_TYPE_NONE, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); |
2728 | 288 |
2734 | 289 dbus_g_proxy_add_signal(obj, "RemoteNameUpdated", G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID); |
290 dbus_g_proxy_connect_signal(obj, "RemoteNameUpdated", G_CALLBACK(remote_name_updated), NULL, NULL); | |
2646
7fbff3287a56
added device discovery in the plugin's prefs window
Paula Stanciu <paula.stanciu@gmail.com>
parents:
2644
diff
changeset
|
291 |
2734 | 292 dbus_g_proxy_call(obj, "DiscoverDevices", &error, G_TYPE_INVALID, G_TYPE_INVALID); |
293 if (error != NULL) | |
294 { | |
295 g_printerr("Failed to discover devices: %s\n", error->message); | |
296 g_error_free(error); | |
297 } | |
2728 | 298 |
2734 | 299 } |