diff --git a/examples/hal/hal-listen.cpp b/examples/hal/hal-listen.cpp index 521591f..d36eb2a 100644 --- a/examples/hal/hal-listen.cpp +++ b/examples/hal/hal-listen.cpp @@ -87,7 +87,7 @@ void HalDeviceProxy::PropertyModifiedCb( const DBus::SignalMessage& sig ) arr >> hp; - std::cout << "modified property " << hp._1 << std::endl; + std::cout << "modified property " << hp._1 << " in " << path() << std::endl; } } @@ -98,7 +98,7 @@ void HalDeviceProxy::ConditionCb( const DBus::SignalMessage& sig ) it >> condition; - std::cout << "encountered condition " << condition << std::endl; + std::cout << "encountered condition " << condition << " in " << path() << std::endl; } DBus::BusDispatcher dispatcher; diff --git a/include/dbus-c++/message.h b/include/dbus-c++/message.h index a710c9c..158e58a 100644 --- a/include/dbus-c++/message.h +++ b/include/dbus-c++/message.h @@ -117,8 +117,6 @@ public: int get_array( void* ptr ); - int array_length(); - bool is_array(); bool is_dict(); diff --git a/src/connection.cpp b/src/connection.cpp index d587835..4f7369a 100644 --- a/src/connection.cpp +++ b/src/connection.cpp @@ -153,8 +153,6 @@ DBusHandlerResult Connection::Private::message_filter_stub( DBusConnection* conn { MessageSlot* slot = static_cast(data); - debug_log("incoming message on connection %p", conn); - Message msg = Message(new Message::Private(dmsg)); return slot && !slot->empty() && slot->call(msg) @@ -268,7 +266,7 @@ bool Connection::register_bus() bool r = dbus_bus_register(_pvt->conn, e); - if(e) throw (e); + if(e) throw (e); return r; } @@ -369,7 +367,7 @@ void Connection::request_name( const char* name, int flags ) dbus_bus_request_name(_pvt->conn, name, flags, e); //we deliberately don't check return value - if(e) throw Error(e); + if(e) throw Error(e); // this->remove_match("destination"); diff --git a/src/message.cpp b/src/message.cpp index a4508bf..41ccef7 100644 --- a/src/message.cpp +++ b/src/message.cpp @@ -43,15 +43,18 @@ bool MessageIter::at_end() { return type() == DBUS_TYPE_INVALID; } + bool MessageIter::has_next() { return dbus_message_iter_has_next((DBusMessageIter*)&_iter); } + MessageIter& MessageIter::operator ++() { dbus_message_iter_next((DBusMessageIter*)&_iter); return (*this); } + MessageIter MessageIter::operator ++(int) { MessageIter copy(*this); @@ -246,11 +249,6 @@ int MessageIter::get_array( void* ptr ) return length; } -int MessageIter::array_length() -{ - return dbus_message_iter_get_array_len((DBusMessageIter*)&_iter); -} - bool MessageIter::is_array() { return dbus_message_iter_get_arg_type((DBusMessageIter*)&_iter) == DBUS_TYPE_ARRAY; diff --git a/src/object.cpp b/src/object.cpp index 0ad759e..8f9b8df 100644 --- a/src/object.cpp +++ b/src/object.cpp @@ -327,9 +327,12 @@ bool ObjectProxy::handle_message( const Message& msg ) const SignalMessage& smsg = reinterpret_cast(msg); const char* interface = smsg.interface(); const char* member = smsg.member(); + const char* objpath = smsg.path(); - debug_log("filtered signal %s(in %s) from remote object %s", - member, interface, msg.sender()); + if( objpath != path() ) return false; + + debug_log("filtered signal %s(in %s) from %s to object %s", + member, interface, msg.sender(), objpath); InterfaceProxy* ii = find_interface(interface); if( ii ) @@ -341,20 +344,6 @@ bool ObjectProxy::handle_message( const Message& msg ) return false; } } - case DBUS_MESSAGE_TYPE_METHOD_RETURN: - { - debug_log("filtered method return from remote object %s", msg.sender()); - - //TODO? - return false; - } - case DBUS_MESSAGE_TYPE_ERROR: - { - debug_log("filtered error from remote object %s", msg.sender()); - - //TODO? - return false; - } default: { return false; diff --git a/src/server.cpp b/src/server.cpp index 2fe0cf8..b45845d 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -59,7 +59,7 @@ Server::Server( const char* address ) InternalError e; DBusServer* server = dbus_server_listen(address, e); - if(e) throw Error(e); + if(e) throw Error(e); debug_log("server 0x%08x listening on %s", server, address); diff --git a/tools/introspect.cpp b/tools/introspect.cpp index 62e88cb..dcbf1f3 100644 --- a/tools/introspect.cpp +++ b/tools/introspect.cpp @@ -58,13 +58,13 @@ int main( int argc, char** argv ) { systembus = false; path = argv[1]; - service = argc > 1 ? argv[2] : 0; + service = argc > 2 ? argv[2] : 0; } else { systembus = true; path = argv[2]; - service = argc > 2 ? argv[3] : 0; + service = argc > 3 ? argv[3] : 0; } DBus::default_dispatcher = &dispatcher;