LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-20-2013, 05:01 AM   #1
necktwi
LQ Newbie
 
Registered: Jun 2013
Posts: 5

Rep: Reputation: Disabled
unable to create networkmanager proxy using glib


This is c++ code ive written to get Modem capabilities.

Code:
DBusGConnection *connection;
    GError * error;
    DBusGProxy *proxy;
    char ** name_list;
    char ** name_list_ptr;
    g_type_init();
    error = NULL;
    connection = dbus_g_bus_get(DBUS_BUS_SESSION, &error);
    if (connection == NULL) {
        g_printerr("Failed to open connection to bus: %s\n", error->message);
        g_error_free(error);
        return false;
    }
    proxy = dbus_g_proxy_new_for_name(connection, "org.freedesktop.NetworkManager", "/org/freedesktop/NetworkManager/Device", "org.freedesktop.NetworkManager.Device.Modem");
    error = NULL;
    if (!dbus_g_proxy_call(proxy, "ModemCapabilities", &error, G_TYPE_INVALID, G_TYPE_STRV, &name_list, G_TYPE_INVALID)) {
        if (error->domain == DBUS_GERROR && error->code == DBUS_GERROR_REMOTE_EXCEPTION) {
            g_printerr("Caught remote method exception %s: %s",
                    dbus_g_error_get_name(error),
                    error->message);
        } else {
            g_printerr("Error: %s\n", error->message);
        }
        g_error_free(error);
        return 0;
    }
Im getting following error:
Error: The name org.freedesktop.NetworkManager was not provided by any .service files

I want to read modem capabilities. Do some one can help me in doing this?
 
Old 06-26-2013, 10:52 AM   #2
necktwi
LQ Newbie
 
Registered: Jun 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
how to get 3g modem signal strength in c++ linux?

without using AT commands how can we get signal strength of 3g modem? The gdbus object for NetworkManager don't have any method like getSignalStrength. Network manager is locking device file preventing to use AT commands.

nm-applet was able to display signal strength in system tray. so there should be a way to get signal strength form network manager!
 
Old 06-26-2013, 10:54 AM   #3
necktwi
LQ Newbie
 
Registered: Jun 2013
Posts: 5

Original Poster
Rep: Reputation: Disabled
i found out that glib's dbus is deprecated. so networkManager is using gdbus instead of dbus.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create a new GType using dbus-Glib? wwba Programming 0 03-23-2012 05:09 AM
Unable to create a shared lan/wlan connection on Archlinux using NetworkManager sharenet Linux - Networking 3 10-09-2011 05:29 PM
Unable to connect to proxy server though wi fi connection active proxy settings ok ncpanicker Linux - Wireless Networking 3 04-11-2011 04:27 AM
Missing Dependency: NetworkManager-glib = 1:0.7.0-0.9.3.svn3623.fc9 is needed by pack Enochs Fedora 6 12-18-2008 12:01 PM
glib 2.6.0 will not create pc files in pkg folder humble20 Linux - Newbie 6 01-04-2005 09:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration