Ross Burton 提到:
> Package: mojito
> Version: 0.21.1
> Severity: normal
> 
> Mojito is configured to use connman for network state monitoring, which won't
> ever work because Debian is using Network Manager.
> 

Hi Ross,

I have an idea that we can detect if Connman is running or not.
And then fallback to NM when Connman is not running.

I made a simple test program which detects ConnMan and NM status.
I'll make a patch when I'm free.

Well.
Do you mind to take over the package or co-maintainer this package?
Because you are the upstream so I think it's better to hand over this package 
to you.

Many Thanks,
Paul

-- 
                                                PaulLiu(劉穎駿)
E-mail address: [email protected]
/* gcc -o test01 `pkg-config --cflags --libs libnm_glib` test01.c */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <libnm-glib/nm-client.h>
#include <dbus/dbus-glib.h>

int testNM() {
  int ret=0;
  NMClient *nmclient = NULL;
  nmclient = nm_client_new();
  ret = nm_client_get_manager_running(nmclient);
  g_object_unref (nmclient);
  return ret;
}

int testCONNMAN() {
  DBusGProxy *connmanproxy = NULL;
  DBusGConnection *conn=NULL;
  GError *error=NULL;
  int ret=0;
  conn = dbus_g_bus_get (DBUS_BUS_SYSTEM, NULL);
  if (conn) {
    connmanproxy = dbus_g_proxy_new_for_name_owner (conn,
     "org.moblin.connman","/", "org.moblin.connman.Manager",NULL);
  } 
  ret = connmanproxy ? 1 : 0;
  if (connmanproxy) {
    g_object_unref(connmanproxy);
  }
  if (conn) {
    dbus_g_connection_unref(conn);
  }
  return ret;
}   

int main() {
  g_type_init ();
  if (testCONNMAN()) {
    printf ("ConnMan on\n");
  } else if (testNM()) {
    printf ("NetworkManager on\n");
  }
  return 0;
}

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to