RE: Newbie learn how to use NetworkManager lib



On Wed, 2010-03-17 at 20:29 -0700, Nguyen Canh Toan wrote:
> Dear Mark,
> 
>  
> 
> Thank you for your reply, 
> 
>  
> 
> First, sorry because of providing lack of information. Let me tell you
> a little about what I am doing now: I am developing an application on
> Ubuntun, with C programming language, which behave very similar to
> nm-applet, it manage all settings & connection state of an HSPA USB
> Data Device (it means only manage wwan connection type, you know). So,
> I decided to hack nm-applet source code.
> 
>  
> 
> I have experienced with programming C & C++ on windows platforms, and
> I feel quickly familiar with programming C on linux. My problem is: I
> found few documentation of NetworkManager lib (libnm…) and don’t know
> where to find API specifications also signals specifications. I did
> modify nm-applet GUI and now I need to continually get connection
> state (status, speed, description, …) to update my GUI forms

If you don't mind contributing the patches back for the functionality
you're adding that would be great!  I keep trying to get people to work
on the data usage and thresholds stuff but nobody is so far... :)

I've just spent the last two weeks adding a bunch of stuff to nm-applet
and ModemManager that you'd be interested in, including the 3G device's
registration state and current access technology, operator names, signal
strength, etc.  That's done talking directly to ModemManager, the D-Bus
interface for which is here:

http://bigw.org/~dan/mm-spec.html

If you look in current applet git here:

http://git.gnome.org/browse/network-manager-applet/log/

and specifically the patches here:

http://git.gnome.org/browse/network-manager-applet/commit/?id=a441f3a9aee5c63d6307e61eae090210c139fcf7
http://git.gnome.org/browse/network-manager-applet/commit/?id=9d6e78a28e109157752c911307e874872d7f976e

you can get an idea of how to talk directly to ModemManager to get the
device's current status, signal strength, etc.  NetworkManager provides
the actual IP connection and network connection functionality, but it
was pointless to duplicate the ModemManager D-Bus API in NetworkManager
just to provide stuff like signal strength/etc that is already
sufficiently exposed by ModemManager.

There's documentation of libnm-glib built with libnm-glib, which should
give you some indication of how things work.  I've just posted the
generated HTML documentation for libnm-glib and libnm-util here:

http://projects.gnome.org/NetworkManager/developers/libnm-glib/08/index.html
http://projects.gnome.org/NetworkManager/developers/libnm-util/08/index.html

The docs aren't entirely complete, but they should give you a much
better idea about what the functions are that nm-applet is using.  Any
suggestions if something seems unclear would help us improve the
documentation too.

Dan


>  
> 
>  
> 
> ToanNC.
> 
>  
> 
>  
> 
>                                    
> ______________________________________________________________________
> From: Mark Renouf [mailto:mark renouf gmail com] 
> Sent: Tuesday, March 16, 2010 4:39 AM
> To: Nguyen Canh Toan
> Cc: networkmanager-list gnome org
> Subject: Re: Newbie learn how to use NetworkManager lib
> 
> 
>  
> 
> Having just done such a thing I think I can help point you in the
> right direction. 
> 
> Of course, the exact methods and effort required depend heavily on
> your choice of language. If you are writing C, then I would recommend
> libnm-glib and libnm-util. You can monitor device state via gobject
> signal handlers. 
> 
> Anyone familiar with Glib can help you with that. Ping me off-list and
> I could share some code snippets.
> 
> > On Mar 16, 2010 4:12 AM, "Nguyen Canh Toan" <Toannc5 viettel com vn>
> > wrote:
> > 
> > Dear all,
> > 
> >  
> > 
> > I am newbie to NetworkManager. Currently, I have to build an
> > application which monitor networking state (connection state,
> > current download & upload speed …) I don’t know how to start. Please
> > help L
> > 
> >  
> > 
> > Thanks,
> > 
> > ToanNC
> > 
> > 
> > 
> > _______________________________________________
> > NetworkManager-list mailing list
> > NetworkManager-list gnome org
> > http://mail.gnome.org/mailman/listinfo/networkmanager-list
> > 
> _______________________________________________
> NetworkManager-list mailing list
> NetworkManager-list gnome org
> http://mail.gnome.org/mailman/listinfo/networkmanager-list




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]