Re: Ad hoc mode via Dbus



Thank you very much Dan for your support,
I'll try that and I will keep you posted.


On Tue, Sep 18, 2012 at 5:53 PM, Dan Williams <dcbw redhat com> wrote:
On Tue, 2012-09-18 at 16:21 +0200, ppulibero libero it wrote:
>
> nothing at all! this is exactly what one could do to figure it
> out...if none diid it before and knows how to do it, which was my
> question

Some resources that may help you:

Examples in many languages of communicating with NetworkManager via
D-Bus or NM's helper libraries:
http://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/examples

A description of the NM D-Bus API, which many of the examples use:
http://projects.gnome.org/NetworkManager/developers/api/09/spec.html

A description of the configuration that you'll use to create your adhoc
connection:
http://projects.gnome.org/NetworkManager/developers/api/09/ref-settings.html

Essentially, you're creating a wifi connection just like :
http://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/examples/python/add-system-wifi-connection.py

except that's for 802.1x.  You'll want to skip the 802.1x setting, and
instead do something like:

s_wifi = dbus.Dictionary({
    'ssid': dbus.ByteArray("my adhoc"),
    'mode': 'adhoc'})

for an open network.  If you want security, you're currently limited to
WEP, because the kernel has bugs that cause WPA Ad-Hoc networks to fail,
and WPA2 Ad-Hoc support in the kernel is limited, and you also need a
supplicant built with CONFIG_RSN_IBSS.

Dan

> Il giorno martedì 18 settembre 2012, Derek Atkins ha scritto:
>         ppulibero libero it writes:
>
>         > Derek,
>         >
>         > I know it uses DBus to communicate to NM!
>         > The problem is I need to code code the configuration of wifi
>         directly via
>         > network manager over the DBus interface. I was able to
>         configure it, but I
>         > wasn't able to set it to ad hoc mode.....This task must be
>         automatically
>         > performed by my application without using any GUI. Was
>         anyone able to
>         > successfully code this task?
>         > Untill now I didn't find anyone who was able to do this so
>         I think the only
>         > way to do figure that out is to look into the source code of
>         the network
>         > manager......
>         >
>         > The problem is that while I can
>
>         And what's wrong with looking at nm-applet to see how it does
>         it?
>
>         -derek
>
>         --
>                Derek Atkins, SB '93 MIT EE, SM '95 MIT Media
>         Laboratory
>                Member, MIT Student Information Processing Board
>          (SIPB)
>                URL: http://web.mit.edu/warlord/    PP-ASEL-IA
>         N1NWH
>                warlord MIT EDU                        PGP key
>         available
> _______________________________________________
> networkmanager-list mailing list
> networkmanager-list gnome org
> https://mail.gnome.org/mailman/listinfo/networkmanager-list





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