I'm having trouble using the conic connection API under OS2008. I used the samples from the maemo 4.0 howto.
When I send the signal to create a new connection with con_ic_connection_connect() everything works as expected: I see a new WIFI connection being started.
The problem is however that my callback function is never actually called, so my program hangs effectively. Tried both the asynchronous and synchronous examples; both do not work.
Does somebody have a clue what I'm doing wrong here?
The code:
Code:
static void connection_handler(ConIcConnection *connection,
ConIcConnectionEvent *event,
gpointer user_data) {
printf("debug: connection event received!\n");
ConIcConnectionStatus status = con_ic_connection_event_get_status(event);
ConIcConnectionStatus *status_ptr = (ConIcConnectionStatus*)user_data;
}
static void start_podcast_sync( GtkWidget *widget, gpointer data ) {
struct stat check;
if(stat(get_config_item("download_directory"), &check)) {
hildon_banner_show_information(GTK_WIDGET(window), NULL, "Download directory does not exist!");
return;
}
if((! download_podcasts_done) || (! sync_podcasts_done)) {
hildon_banner_show_information(GTK_WIDGET(window), NULL, "Background sync already in progress!");
return;
}
/* Create connection object */
ConIcConnection * connection = con_ic_connection_new();
/* Connect signal to receive connection events */
static ConIcConnectionStatus status = 0xFFFF;
g_signal_connect(G_OBJECT(connection), "connection-event", G_CALLBACK(connection_handler), &status);
/* Request connection ... */
printf("debug: reqeusting a connection from conic ...\n");
con_ic_connection_connect(connection, CON_IC_CONNECT_FLAG_NONE);
printf("waiting for a signal back ...\n");
/* Iterate main loop for the first connection event */
while (status == 0xFFFF) g_main_context_iteration(NULL, TRUE);
}
When I send the signal to create a new connection with con_ic_connection_connect() everything works as expected: I see a new WIFI connection being started.
The problem is however that my callback function is never actually called, so my program hangs effectively. Tried both the asynchronous and synchronous examples; both do not work.
Does somebody have a clue what I'm doing wrong here?
The code: