aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael 'Mickey' Lauer <mickey@vanille-media.de>2009-07-31 20:52:49 +0200
committerMichael 'Mickey' Lauer <mickey@vanille-media.de>2009-07-31 20:52:49 +0200
commit9939ce97e0a6690e04d9ad5cdbe8be8492c4462b (patch)
treed696b74da2261763593e0a441fde1013982f8763
parentba79f8186a72dbd5cea7834fa79f6f1d0e11d9dd (diff)
downloadcornucopia-9939ce97e0a6690e04d9ad5cdbe8be8492c4462b.tar.gz
cornucopia-9939ce97e0a6690e04d9ad5cdbe8be8492c4462b.tar.bz2
cornucopia-9939ce97e0a6690e04d9ad5cdbe8be8492c4462b.zip
mdbus2: error out on functions NYI
-rw-r--r--tools/mdbus2/src/main.vala35
1 files changed, 30 insertions, 5 deletions
diff --git a/tools/mdbus2/src/main.vala b/tools/mdbus2/src/main.vala
index 0654ec18..e7befa70 100644
--- a/tools/mdbus2/src/main.vala
+++ b/tools/mdbus2/src/main.vala
@@ -288,10 +288,9 @@ class Commands : Object
var idata = new Introspection( o.Introspect() );
foreach ( var node in idata.nodes )
{
- message ( "node = '%s'", node );
-
+ //message ( "node = '%s'", node );
var nextnode = ( path == "/" ) ? "/%s".printf( node ) : "%s/%s".printf( path, node );
- message( "nextnode = '%s'", nextnode );
+ //message( "nextnode = '%s'", nextnode );
listObjects( busname, nextnode );
}
}
@@ -324,9 +323,19 @@ class Commands : Object
}
}
+ private void _parseArguments( string[] args )
+ {
+ }
+
private void _callMethod( string busname, string path, string iface, string method, string[] args)
{
+ dynamic DBus.Object o = bus.get_object( busname, path, iface );
+ Error e;
+ error( "calling methods not yet implemented" );
+ /*
+ var result = o.call( method, out e );
message( "calling %s on interface %s on object %s served by %s", method, iface, path, busname );
+ */
}
public void callMethod( string busname, string path, string method, string[] args )
@@ -348,8 +357,16 @@ class Commands : Object
{
var methodWithPoint = method.rchr( -1, '.' );
var baseMethod = methodWithPoint.substring( 1 );
- var iface = method.substring( 0, baseMethod.length );
+ var iface = method.substring( 0, method.length - baseMethod.length - 1 );
+
+ // check number of input params
+ if ( args.length != entity.inArgs.length() )
+ {
+ stderr.printf( "Error: Need %u params, supplied %u\n", entity.inArgs.length(), args.length );
+ return;
+ }
+ // method ok to call
_callMethod( busname, path, iface, baseMethod, {} );
return;
}
@@ -364,6 +381,11 @@ class Commands : Object
}
}
+ public void listenForSignals()
+ {
+ error( "listening for signals not yet implemented" );
+ }
+
}
//=========================================================================//
@@ -407,7 +429,10 @@ int main( string[] args )
switch ( args.length )
{
case 1:
- commands.listBusNames();
+ if (!listenerMode)
+ commands.listBusNames();
+ else
+ commands.listenForSignals();
break;
case 2: