Detecting ethernet gadget connections

Daniel Benoy daniel at benoy.name
Fri Mar 6 03:53:21 CET 2009


I just tried that python script, and it shows an event when I connect my USB 
cable, but not when I disconnect it.

On March 5, 2009 11:48:29 Michael 'Mickey' Lauer wrote:
> Am Donnerstag, den 05.03.2009, 10:01 -0500 schrieb Daniel Benoy:
> > I'm working on a script that will detect which network interfaces are
> > connected and mess with the routing accordingly, but I'm having trouble
> > detecting whether my USB ethernet gadget connection is up or down.
>
> The best way to do this is to listen for netlink route announcements.
> That way it's completely instantaneous and without polling. Look here
> for an example using python-netlink:
>
> http://git.freesmartphone.org/?p=framework.git;a=blob;f=tools/dump-netlink
>
> Note that if you're on FSO I expect that after full integration of
> connman (milestone6), we will have a global signal like
>
> org.freesmartphone.Network.ConnectionStatus( s:means, b:online )
>
> 'means' being a string that indicates the type, like "GPRS/ppp",
> "IP/usb0", "IP/bnep0", etc.
>
> that you can use.
>
> :M:
>
> _______________________________________________
> Openmoko community mailing list
> community at lists.openmoko.org
> http://lists.openmoko.org/mailman/listinfo/community






More information about the community mailing list