- NO FUNCTIONAL CODE CHANGES!!!!
- changed code formating from tabs to spaces and others - used astyle with this option: --style=ansi --indent=spaces=2 -M --pad-oper --unpad-paren --pad-header --align-pointer=name --lineend=linux
This commit is contained in:
parent
b100e9d32a
commit
1c8e43e6d6
76 changed files with 5691 additions and 5492 deletions
|
@ -9,64 +9,64 @@ static const char *PROPS_SERVER_NAME = "org.freedesktop.DBus.Examples.Properties
|
|||
static const char *PROPS_SERVER_PATH = "/org/freedesktop/DBus/Examples/Properties";
|
||||
|
||||
PropsClient::PropsClient(DBus::Connection &connection, const char *path, const char *name)
|
||||
: DBus::ObjectProxy(connection, path, name)
|
||||
: DBus::ObjectProxy(connection, path, name)
|
||||
{
|
||||
}
|
||||
|
||||
void PropsClient::MessageChanged(const std::string& message)
|
||||
void PropsClient::MessageChanged(const std::string &message)
|
||||
{
|
||||
std::cout << "MessageChanged signal, new value: " << message << "\n";
|
||||
std::cout << "MessageChanged signal, new value: " << message << "\n";
|
||||
};
|
||||
|
||||
void PropsClient::DataChanged(const double& data)
|
||||
void PropsClient::DataChanged(const double &data)
|
||||
{
|
||||
std::cout << "DataChanged signal, new value:" << data << "\n";
|
||||
std::cout << "DataChanged signal, new value:" << data << "\n";
|
||||
};
|
||||
|
||||
void *test_property_proxy(void * input)
|
||||
void *test_property_proxy(void *input)
|
||||
{
|
||||
PropsClient *client = static_cast<PropsClient*>(input);
|
||||
PropsClient *client = static_cast<PropsClient *>(input);
|
||||
|
||||
std::cout << "read property 'Version', value:" << client->Version() << "\n";
|
||||
std::cout << "read property 'Version', value:" << client->Version() << "\n";
|
||||
|
||||
std::cout << "read property 'Message', value:" << client->Message() << "\n";
|
||||
|
||||
client->Message("message set by property access");
|
||||
std::cout << "wrote property 'Message'\n";
|
||||
|
||||
std::cout << "read property 'Message', value:" << client->Message() << "\n";
|
||||
|
||||
client->Data(1.1);
|
||||
std::cout << "wrote property 'Data'\n";
|
||||
std::cout << "read property 'Message', value:" << client->Message() << "\n";
|
||||
|
||||
return NULL;
|
||||
client->Message("message set by property access");
|
||||
std::cout << "wrote property 'Message'\n";
|
||||
|
||||
std::cout << "read property 'Message', value:" << client->Message() << "\n";
|
||||
|
||||
client->Data(1.1);
|
||||
std::cout << "wrote property 'Data'\n";
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
DBus::BusDispatcher dispatcher;
|
||||
|
||||
void niam(int sig)
|
||||
{
|
||||
dispatcher.leave();
|
||||
pthread_exit(NULL);
|
||||
dispatcher.leave();
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
signal(SIGTERM, niam);
|
||||
signal(SIGINT, niam);
|
||||
signal(SIGTERM, niam);
|
||||
signal(SIGINT, niam);
|
||||
|
||||
DBus::default_dispatcher = &dispatcher;
|
||||
DBus::default_dispatcher = &dispatcher;
|
||||
|
||||
DBus::_init_threading();
|
||||
DBus::_init_threading();
|
||||
|
||||
DBus::Connection conn = DBus::Connection::SessionBus();
|
||||
DBus::Connection conn = DBus::Connection::SessionBus();
|
||||
|
||||
PropsClient client (conn, PROPS_SERVER_PATH, PROPS_SERVER_NAME);
|
||||
PropsClient client(conn, PROPS_SERVER_PATH, PROPS_SERVER_NAME);
|
||||
|
||||
pthread_t thread;
|
||||
pthread_create(&thread, NULL, test_property_proxy, &client);
|
||||
pthread_t thread;
|
||||
pthread_create(&thread, NULL, test_property_proxy, &client);
|
||||
|
||||
dispatcher.enter();
|
||||
dispatcher.enter();
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue