maemo.org Bugzilla – Bug 10084
conic_monitor.py example broken
Last modified: 2010-05-31 23:21:43 UTC
You need to
before you can comment on or make changes to this bug.
EXACT STEPS LEADING TO PROBLEM:
1. run conic_example.py (see URL) on device
2. connect/disconnect cellular/wifi connections
Lots of data is printed every time when data connection is made or
connection_cb(<conic.Connection object at 0x4081d508 (ConIcConnection at
0x1e0820)>, <conic.ConnectionEvent object at 0x4081d580 (ConIcConnectionEvent
(CONNECTED (0a87d55b-a726-44ed-89d0-8bb4fae5f752, WLAN_INFRA, 0, 0)
"connect():" is printed once on program startup , but nothing after that.
Following program does work.
import gobject, dbus
from dbus.mainloop.glib import DBusGMainLoop
def connection_cb(connection, event):
print "connection_cb(%s, %s)" % (connection, event)
status = event.get_status()
error = event.get_error()
iap_id = event.get_iap_id()
bearer = event.get_bearer_type()
if status == conic.STATUS_CONNECTED:
print "(CONNECTED (%s, %s, %i, %i)" % (iap_id, bearer, status, error)
elif status == conic.STATUS_DISCONNECTED:
print "(DISCONNECTED (%s, %s, %i, %i)" % (iap_id, bearer, status,
elif status == conic.STATUS_DISCONNECTING:
print "(DISCONNECTING (%s, %s, %i, %i)" % (iap_id, bearer, status,
if __name__ == "__main__":
bus = dbus.SystemBus()
connection = conic.Connection()
Might be related to bug 7729
(In reply to comment #1)
> Might be related to bug 7729
Yeah, it is. I just decided to make explicit bug about this example because I
have working example. Other python-conic examples can be fixed similar way as
Thomas, does my example work for you?
I have used similar python-conic monitor in openvpn-applet to detect when GPRS
connection is established and it is working fine.
(In reply to comment #3)
> Thomas, does my example work for you?
Yes, sorry, I overread your example. I just tried it and it works fine :)
Removing bugs from depends/block lines. This is not related to documentation
and they already depend on 7729.
Mikko, your test is similar to test_automatic_events. The
automatic-connection-events property makes libconic emit the "connection-event"
signal for all connections and there is already an example for this.
test_connection should print the connection data only for the requested
(In reply to comment #5)
> This is not related to documentation
In this page http://pymaemo.garage.maemo.org/conic.html these test cases are
used as examples, which is about closest thing to documentation availalebe for
python-conic (other thant C api documentation). Sorry for confusion
> Mikko, your test is similar to test_automatic_events. The
> automatic-connection-events property makes libconic emit the "connection-event"
> signal for all connections and there is already an example for this.
Just found that out. Sorry for the confusion again.
> test_connection should print the connection data only for the requested
I didn't realise this, nevertheless result is same; data is not printed
Oh, sorry. I meant "Removed bug dependencies as they are not related to