[no subject]



    s_wireless = (NMSettingWireless *)nm_setting_wireless_new ();
    ap_ssid = nm_access_point_get_ssid(ap);

    g_object_set(s_wireless, NM_SETTING_WIRELESS_SSID, ap_ssid, NULL);
    g_object_set(s_wireless, NM_SETTING_WIRELESS_MODE, "infrastructure",
NULL);

    connection = nm_connection_new();
    nm_connection_add_setting(connection, NM_SETTING(s_wireless));

    s_con = NM_SETTING_CONNECTION(nm_setting_connection_new());
    g_object_set(s_con,
                       NM_SETTING_CONNECTION_TYPE,
                       nm_setting_get_name(NM_SETTING(s_wireless)),
                       NULL);

    nm_connection_add_setting(connection, NM_SETTING(s_con));
    specific_object = nm_object_get_path (NM_OBJECT(ap));

    g_assert(connection);
    con_path = nm_connection_get_path(connection);
    g_assert(con_path); /* FAILS HERE */

    nm_client_activate_connection(app->priv->client,
                                  NM_DBUS_SERVICE_USER_SETTINGS,
                                  con_path,
                                  device,
                                  specific_object,
                                  activate_connection_cb,
                                  app);

After I filter and select the access point (unencrypted) that i want to
connect to I'm unable to get the path of the NMConnection I have created.
The nm-applet is not running.

Thanks

--0050450181025ca25b047d168b13
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

I'm creating a console application which needs to be able to identify a=
nd to connect to wireless access points. <br><br>So far I have been able to=
 scan and parse the access point I wish to connect to but I&#39;m having tr=
ouble understanding how to actually connect to it now. From reading the sou=
rce for the applet I have been able to come up with this:<br>
<br>=A0=A0=A0 s_wireless =3D (NMSettingWireless *)nm_setting_wireless_new (=
);<br>=A0=A0=A0 ap_ssid =3D nm_access_point_get_ssid(ap);<br><br>=A0=A0=A0 =
g_object_set(s_wireless, NM_SETTING_WIRELESS_SSID, ap_ssid, NULL);<br>=A0=
=A0=A0 g_object_set(s_wireless, NM_SETTING_WIRELESS_MODE, &quot;infrastruct=
ure&quot;, NULL);<br>
<br>=A0=A0=A0 connection =3D nm_connection_new();<br>=A0=A0=A0 nm_connectio=
n_add_setting(connection, NM_SETTING(s_wireless));<br><br>=A0=A0=A0 s_con =
=3D NM_SETTING_CONNECTION(nm_setting_connection_new());<br>=A0=A0=A0 g_obje=
ct_set(s_con,<br>=A0=A0=A0 =A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0 NM_SETTING_CONNECTION_TYPE,<br>
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 nm_setting_g=
et_name(NM_SETTING(s_wireless)),<br>=A0=A0=A0 =A0=A0=A0 =A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0 NULL);<br><br>=A0=A0=A0 nm_connection_add_setting(=
connection, NM_SETTING(s_con));<br>=A0=A0=A0 specific_object =3D nm_object_=
get_path (NM_OBJECT(ap));<br>
<br>=A0=A0=A0 g_assert(connection);<br>=A0=A0=A0 con_path =3D nm_connection=
_get_path(connection);<br>=A0=A0=A0 g_assert(con_path); /* FAILS HERE */<br=
><br>=A0=A0=A0 nm_client_activate_connection(app-&gt;priv-&gt;client,<br>=
=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0 NM_DBUS_SERVICE_USER_SETTINGS,<br>
=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0 con_path,<br>=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 device,<br>=A0=
=A0=A0 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0 specific_object,<br>=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 activate=
_connection_cb,<br>=A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 app);<br>
<br>After I filter and select the access point (unencrypted) that i want to=
 connect to I&#39;m unable to get the path of the NMConnection I have creat=
ed. The nm-applet is not running.<br><br>Thanks<br><br>

--0050450181025ca25b047d168b13--


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