sidorares/dbus-native

NetworkManager - AddConnection not working

petergerten opened this issue · 1 comments

Hi,

I try to translate the python example https://github.com/lcp/NetworkManager/blob/master/examples/python/add-connection.py to dbus-native.

but always get [ 'connection: setting not found' ]

My code looks like this:

systemBus.invoke(
    {
        path: '/org/freedesktop/NetworkManager/Settings',
        destination: 'org.freedesktop.NetworkManager',
        interface: 'org.freedesktop.NetworkManager.Settings',
        member: 'AddConnection',
        signature: 'a{sa{sv}}',
        body: [
	    {
	        '802-3-ethernet': {
		    'duplex': 'full'
		},
		'connection': {
		    'type': '802-3-ethernet',
		    'uuid': 'cccccccccccccccccccccccc',
		    'id': 'MyConnectionExample'
		},
		'ipv4': {
		    'method': 'ignore'
		},
		'ipv6': {
		    'method': 'ignore'
		}
	    }
	]
	,	    
	type: dbus.messageType.methodCall
    },
    function(err, res) {
        console.log(err, res);
    }
);

I suspect I might set something wrong in the body. Any suggestions?

I think the body is what's wrong.
Sample.

[["connection",[["autoconnect-priority",["i",-999]],["id",["s","Wired connection 1"]],["interface-name",["s","ens160"]],["timestamp",["t",1699619344]],["type",["s","802-3-ethernet"]],["uuid",["s","4871f1e7-4149-39d6-abf9-19148f984b02"]]]],["802-3-ethernet",[["auto-negotiate",["b",false]]]],["ipv4",[["method",["s","auto"]]]],["ipv6",[["method",["s","disabled"]]]]]