* Added a method to register a new connection with its message bus (Naveen Verma)

git-svn-id: http://dev.openwengo.org/svn/openwengo/wengophone-ng/branches/wengophone-dbus-api/libs/dbus@11869 30a43799-04e7-0310-8b2b-ea0d24f86d0e
This commit is contained in:
pdurante 2007-07-06 11:02:01 +00:00
parent 8006e9b1ad
commit 31843c4a7c
2 changed files with 14 additions and 0 deletions

View file

@ -85,6 +85,8 @@ public:
const char* unique_name() const;
bool register_bus();
bool connected() const;
void disconnect();

View file

@ -262,6 +262,17 @@ bool Connection::operator == ( const Connection& c ) const
return _pvt->conn == c._pvt->conn;
}
bool Connection::register_bus()
{
InternalError e;
bool r = dbus_bus_register(_pvt->conn, e);
if(e) throw (e);
return r;
}
bool Connection::connected() const
{
return dbus_connection_get_is_connected(_pvt->conn);
@ -396,3 +407,4 @@ bool Connection::start_service( const char* name, unsigned long flags )
return b;
}