[maemo-developers] [maemo-developers] Connectivity API: ( osso_iap_connect() ), cannot see generated events
From: Jarkko Palviainen jarkko.palviainen at lut.fiDate: Thu Nov 2 23:19:28 EET 2006
- Previous message: [maemo-developers] kernel source for 2.2006.39-14?
- Next message: [maemo-developers] Connectivity API: ( osso_iap_connect() ), cannot see generated events
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi, I'm trying to create WLAN connection with osso_iap_connect() call from my applications (which is a gtkmm app). I can make a proper connection as N770 pops the "Connected to foobar" message, but connected callback does not ever get any signals, like OSSO_IAP_CONNECTED, OSSO_IAP_DISCONNECTED or OSSO_IAP_STATISTICS. The code are pretty much same as in the maemo connectivity tutorial (http://www.maemo.org/platform/docs/howtos/howto_connectivity_guide.html#ConnectivityAPIFunctionality), I will also put them here: Inside the class constructor connect the signal handler: ClientSocket::ClientSocket(Clientmain& client_) :seq(0), client(client_) { ... // Register a callback function for IAP related events if (osso_iap_cb(iap_callback) != OSSO_OK) { cout << "osso_iap_cb failed" << endl; exit(1); } ... } method for creating connection to IAP: bool ClientSocket::open_wlan_connection(void) { int n; n = osso_iap_connect(OSSO_IAP_ASK, OSSO_IAP_REQUESTED_CONNECT, NULL); if (n < 0) return false; else { // osso_iap_get_statistics(iap_name, (void*) 0xF00BA4); cout << "wlan opened" << endl; return true; } } and callback: static void iap_callback(struct iap_event_t *ev, void *arg) { cout << "ap_callback" << endl; if( (long) arg == 0xF00BA4) printf("Callback for our statistics request: "); /* check for the event type and print out the statistics */ if( ev->type == OSSO_IAP_STATISTICS) printf(", time_active=%d, signal_strength=%d" ", rx_packets=%d, tx_packets=%d" ", rx_bytes=%d, tx_bytes=%d", ev->u.statistics.time_active, ev->u.statistics.signal_strength, ev->u.statistics.rx_packets, ev->u.statistics.tx_packets, ev->u.statistics.rx_bytes, ev->u.statistics.tx_bytes); else if (ev->type == OSSO_IAP_CONNECTED) { cout << "OSSO_IAP_CONNECTED" << endl; } else if (ev->type == OSSO_IAP_DISCONNECTED) { cout << "OSSO_IAP_DISCONNECTED" << endl; } else cout << "some event" << endl; } I'm not sure am I missing something with the signals or with the callback. However I need to know when connection is ready (as to be able to handle OSSO_IAP_CONNECTED event). All comments appreciated, thanks! - Jarkko Palviainen
- Previous message: [maemo-developers] kernel source for 2.2006.39-14?
- Next message: [maemo-developers] Connectivity API: ( osso_iap_connect() ), cannot see generated events
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]