return dbus_g_proxy_new_for_name (sys_conn,
"org.projectx.bt",
path,
- "org.bluez.Agent");
+ "org.bluez.Agent1");
}
static DBusGProxy*
notification_error_e err = NOTIFICATION_ERROR_NONE;
int bt_yesno;
bt_yesno = 1;
- char line[256];
+ char line[4];
fprintf(stdout, "Do you confirm yes or no ? ");
while ( bt_yesno != 0){
- gets(line);
+ if (!fgets(line, sizeof(line), stdin))
+ continue;
if ( strcmp(line,"yes") == 0){
(cb_1) (proxy);
bt_yesno = 0;
}
-static int __noti_changed_cb(void *data, notification_type_e type)
+static void __noti_changed_cb(void *data, notification_type_e type)
{
notification_h noti = NULL;
notification_list_h notification_list = NULL;
sys_conn = dbus_g_bus_get(DBUS_BUS_SYSTEM, NULL);
if (sys_conn == NULL) {
fprintf(stdout,"ERROR: Can't get on system bus");
- return EXIT_FAILURE;
+ return;
}
agent_proxy = __bluetooth_create_agent_proxy(sys_conn, agent_path);
if (!agent_proxy){
fprintf(stdout,"create new agent_proxy failed\n");
- return EXIT_FAILURE;
+ return;
}
__display_notification(__notify_passkey_confirm_request_accept_cb, __notify_passkey_confirm_request_cancel_cb,agent_proxy);
sys_conn = dbus_g_bus_get(DBUS_BUS_SYSTEM, NULL);
if (sys_conn == NULL) {
fprintf(stdout,"ERROR: Can't get on system bus");
- return EXIT_FAILURE;
+ return;
}
agent_proxy = __bluetooth_create_agent_proxy(sys_conn, agent_path);
if (!agent_proxy){
fprintf(stdout,"create new agent_proxy failed\n");
- return EXIT_FAILURE;
+ return;
}
__display_notification( __notify_authorize_request_accept_cb, __notify_authorize_request_cancel_cb,agent_proxy);
sys_conn = dbus_g_bus_get(DBUS_BUS_SYSTEM, NULL);
if (sys_conn == NULL) {
fprintf(stdout,"ERROR: Can't get on system bus");
- return EXIT_FAILURE;
+ return;
}
obex_proxy = __bluetooth_create_obex_proxy(sys_conn);
if (!obex_proxy){
fprintf(stdout,"create new obex_proxy failed\n");
- return EXIT_FAILURE;
+ return;
}
__display_notification( __notify_push_authorize_request_accept_cb, __notify_push_authorize_request_cancel_cb,obex_proxy);
sys_conn = dbus_g_bus_get(DBUS_BUS_SYSTEM, NULL);
if (sys_conn == NULL) {
fprintf(stdout,"ERROR: Can't get on system bus");
- return EXIT_FAILURE;
+ return;
}
agent_proxy = __bluetooth_create_agent_proxy(sys_conn, agent_path);
if (!agent_proxy){
fprintf(stdout,"create new agent_proxy failed\n");
- return EXIT_FAILURE;
+ return;
}
__display_notification( __notify_authorize_request_accept_cb, __notify_authorize_request_cancel_cb,agent_proxy);
sys_conn = dbus_g_bus_get(DBUS_BUS_SYSTEM, NULL);
if (sys_conn == NULL) {
fprintf(stdout,"ERROR: Can't get on system bus");
- return EXIT_FAILURE;
+ return;
}
agent_proxy = __bluetooth_create_agent_proxy(sys_conn, agent_path);
if (!agent_proxy){
fprintf(stdout,"create new agent_proxy failed\n");
- return EXIT_FAILURE;
+ return;
}
__display_notification( __notify_authorize_request_accept_cb, __notify_authorize_request_cancel_cb,agent_proxy);
sys_conn = dbus_g_bus_get(DBUS_BUS_SYSTEM, NULL);
if (sys_conn == NULL) {
fprintf(stdout,"ERROR: Can't get on system bus");
- return EXIT_FAILURE;
+ return;
}
agent_proxy = __bluetooth_create_agent_proxy(sys_conn, agent_path);
if (!agent_proxy){
fprintf(stdout,"create new agent_proxy failed\n");
- return EXIT_FAILURE;
+ return;
}
__display_notification( __notify_authorize_request_accept_cb, __notify_authorize_request_cancel_cb,agent_proxy);
notification_list = NULL;
}
- return EXIT_SUCCESS;
+ return;
}
int