comparison src/bluetooth/bluetooth.c @ 2847:671cdfc2d62d

Basic pairing interface
author Paula Stanciu <paula.stanciu@gmail.com>
date Mon, 28 Jul 2008 21:48:39 +0300
parents 3d7f01edb388
children 43557eb3180f
comparison
equal deleted inserted replaced
2846:3d7f01edb388 2847:671cdfc2d62d
85 printf("bt_cfg\n"); 85 printf("bt_cfg\n");
86 config =1; 86 config =1;
87 if(discover_finish == 2){ 87 if(discover_finish == 2){
88 if (devices_no == 0){ 88 if (devices_no == 0){
89 printf("no devs!\n"); 89 printf("no devs!\n");
90 show_scan(); 90 show_scan(0);
91 show_no_devices(); 91 show_no_devices();
92 }else 92 }else
93 results_ui(); 93 results_ui();
94 } 94 }
95 else show_scan(); 95 else show_scan(0);
96 printf("end of bt_cfg\n"); 96 printf("end of bt_cfg\n");
97 } 97 }
98 98
99 void disconnect_dbus_signals() 99 void disconnect_dbus_signals()
100 { 100 {
121 if(discover_finish == 0 ||discover_finish== 2){ 121 if(discover_finish == 0 ||discover_finish== 2){
122 discover_finish = 0; 122 discover_finish = 0;
123 123
124 discover_devices(); 124 discover_devices();
125 close_window(); 125 close_window();
126 show_scan(); 126 show_scan(0);
127 } 127 }
128 else 128 else
129 printf("Scanning please wait!\n"); 129 printf("Scanning please wait!\n");
130 } 130 }
131
132 void bounding_created(gchar* address)
133 {
134 printf("Signal BoundingCreated : %s\n",address);
135
136 }
137
138 void bounding_removed(gchar* address)
139 {
140 printf("Signal: BoundingRemoved: %s\n",address);
141
142 }
143
144 131
145 gpointer connect_call_th(void) 132 gpointer connect_call_th(void)
146 { 133 {
147 134
148 //I will have to enable the audio service if necessary 135 //I will have to enable the audio service if necessary
152 dbus_g_proxy_call(obj,"CreateBonding",NULL,G_TYPE_STRING,((DeviceData*)(selected_dev->data))->address,G_TYPE_INVALID,G_TYPE_INVALID); 139 dbus_g_proxy_call(obj,"CreateBonding",NULL,G_TYPE_STRING,((DeviceData*)(selected_dev->data))->address,G_TYPE_INVALID,G_TYPE_INVALID);
153 140
154 } 141 }
155 void connect_call(void) 142 void connect_call(void)
156 { 143 {
157 connect_th = g_thread_create((GThreadFunc)connect_call_th,NULL,TRUE,NULL) ; 144 connect_th = g_thread_create((GThreadFunc)connect_call_th,NULL,TRUE,NULL) ;
145 close_call();
146 close_window();
147 show_scan(1);
158 } 148 }
159 149
160 150
161 static void remote_device_found(DBusGProxy *object, char *address, const unsigned int class, const int rssi, gpointer user_data) 151 static void remote_device_found(DBusGProxy *object, char *address, const unsigned int class, const int rssi, gpointer user_data)
162 { 152 {