You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(22) |
Sep
(33) |
Oct
(1) |
Nov
(7) |
Dec
(19) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(12) |
Feb
(9) |
Mar
(11) |
Apr
(6) |
May
(3) |
Jun
(8) |
Jul
(9) |
Aug
(4) |
Sep
(12) |
Oct
(8) |
Nov
(9) |
Dec
(3) |
2010 |
Jan
(6) |
Feb
|
Mar
|
Apr
(4) |
May
(19) |
Jun
(5) |
Jul
(3) |
Aug
(6) |
Sep
(3) |
Oct
(4) |
Nov
|
Dec
(13) |
2011 |
Jan
|
Feb
(1) |
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(18) |
Dec
(1) |
2012 |
Jan
(6) |
Feb
|
Mar
|
Apr
(1) |
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
(1) |
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(3) |
Oct
(1) |
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(2) |
From: Rafal D. <r....@ke...> - 2010-12-07 10:00:12
|
Here is a snippet of code from my application, This code is for periodic check if connection is alive You need to install DBus::DefaultTimeout (dt is pointer to this object) with DBus::BusDispatcher (dispatcher object) BTW framework is responsible for releasing dt memory (see internals of DBus::Callback_Base) bool const repeat=true; unsigned const timeout_ms = 3 * DEFAULT_TIMEOUT_MS;//DSP uses 10000 for Ping->Pong messages DBus::DefaultTimeout*const dt = new DBus::DefaultTimeout(timeout_ms, repeat, &dispatcher); dt->expired=new periodic(); periodic is a class which does processing on timeout: class periodic: public DBus::Callback_Base<void, DBus::DefaultTimeout &> { public: void call(DBus::DefaultTimeout & param) const { if( not ping_was_called.read_reset() ) { LWAR_ << "TIMEOUT: CLOSING THE CONNECTION " << blackfin << " last Ping received long time ago"; ::close( blackfin ); g_devices->invalidate();//Reset DBus collections - no connection with devices g_blocks->invalidate(); } } }; -----Original Message----- From: Theodore A. Roth [mailto:ta...@gm...] Sent: Fri 12/3/2010 11:23 PM To: dbu...@li... Subject: [dbus-cplusplus-devel] dispatcher timeout I've been trying to figure out how to register a timeout callback with the dispatcher so that my callback function will be invoked periodically by the dispatcher main loop. The BusDispatcher::add_timeout() method seems to take an internal timeout object as an argument which leads me to believe that I can't use that. I'm still in the learning dbus-c++ phase and my app is a rather simple server based on the echo demo, but I've stripped it down to only a Hello method and a single signal. My goal is to invoked the signal in the timeout. None of the examples in the source repo show how to do what I what, and google hasn't been too helpful. If someone has a link to an example of this, I would be most appreciative. Thanks. Ted Roth ------------------------------------------------------------------------------ Oracle to DB2 Conversion Guide: New IBM DB2 features make compatibility easy. Learn about native support for PL/SQL, new data types, scalar functions, improved concurrency, built-in packages, OCI, SQL*Plus, data movement tools, best practices and more - all designed to run applications on both DB2 and Oracle platforms. http://p.sf.net/sfu/oracle-sfdev2dev _______________________________________________ dbus-cplusplus-devel mailing list dbu...@li... https://lists.sourceforge.net/lists/listinfo/dbus-cplusplus-devel -- Asylia ExchangeDefender Message Security: Click below to verify authenticity http://www.exchangedefender.com/verify.asp?id=oB79TrMa012804&from=r....@ke... |
From: Theodore A. R. <ta...@gm...> - 2010-12-06 22:08:22
|
On Mon, Dec 6, 2010 at 2:06 PM, Vince Laviano <vla...@go...> wrote: > Hi Ted, > On Mon, Dec 6, 2010 at 11:59 AM, Jason Glasgow <jgl...@go...> wrote: >> >> see main() for how we attach the dbus-c++ dispatcher to the glib main >> loop. >> >> http://git.chromium.org/gitweb/?p=cashew.git;a=blob;f=src/main.cc;h=d7f64fe5f37b99e91d7eb2ef9e4566f01833e521;hb=HEAD#l102 >> >> -Jason > > dbus-c++ provides several flavors of dispatcher. > The vanilla one (DBus::BusDispatcher) does implement its own event loop, > entered by DBus::BusDispatcher::enter and exited by > DBus::BusDispatcher::leave. > There is a separate dispatcher for glib integration: > DBus::Glib::BusDispatcher. When using the glib dispatcher, you still need > to attach it, but, since it's using the glib main loop, the enter and leave > routines are no-ops. You instead create a glib main loop and enter and leave > the loop using the usual glib calls: g_main_loop_run and g_main_loop_quit. > See the cashew link that Jason provided for an example of how to use the > glib dispatcher. > The add_timeout, rem_timeout, add_watch, and rem_watch methods on the > default dispatcher seem promising at first glance, but the conversation > quoted below suggests that you've already tried them with no luck. > Andreas says in the thread below: >> Are you sure the C backend of DBus provides such a feature? Could you name >> a function? > The C backend for D-Bus is meant to allow integration of D-Bus events into > an existing external event loop. So, it provides the ability for code > implementing this event loop to provide a callback function for libdbus to > call when libdbus wants to add a timeout that will be managed by this > external event loop (and similarly for watches on fds that libdbus want the > external event loop to manage). However, one would expect that the external > event loop will... um... be an event loop, meaning that its public API > allows timeouts and watches to be created, managed, and removed by arbitrary > clients, not just by libdbus through the dbus binding. IMO, if the default > dispatcher purports to be a real event loop (and it's not clear that it > does, since it's intentionally very simple), it should allow timeouts and > watches to be managed. It should do this just because it's an event loop, > not because it's part of a D-Bus binding. That's exactly the (false) assumption I was making about BusDispatcher. > Ted: An alternate approach would be to ignore the default dispatcher, look > at how DBus::Glib::BusDispatcher is implemented, and follow the same model > to implement DBus::EventLibThatTedPrefersInsteadOfGlib::BusDispatcher. > Vince Will have a look at that and see where it takes me. Thanks for the help guys. I think that will get me on the right track. Ted Roth |
From: Vince L. <vla...@go...> - 2010-12-06 21:06:38
|
Hi Ted, On Mon, Dec 6, 2010 at 11:59 AM, Jason Glasgow <jgl...@go...> wrote: > see main() for how we attach the dbus-c++ dispatcher to the glib main loop. > > > http://git.chromium.org/gitweb/?p=cashew.git;a=blob;f=src/main.cc;h=d7f64fe5f37b99e91d7eb2ef9e4566f01833e521;hb=HEAD#l102 > > -Jason > dbus-c++ provides several flavors of dispatcher. The vanilla one (DBus::BusDispatcher) does implement its own event loop, entered by DBus::BusDispatcher::enter and exited by DBus::BusDispatcher::leave. There is a separate dispatcher for glib integration: DBus::Glib::BusDispatcher. When using the glib dispatcher, you still need to attach it, but, since it's using the glib main loop, the enter and leave routines are no-ops. You instead create a glib main loop and enter and leave the loop using the usual glib calls: g_main_loop_run and g_main_loop_quit. See the cashew link that Jason provided for an example of how to use the glib dispatcher. The add_timeout, rem_timeout, add_watch, and rem_watch methods on the default dispatcher seem promising at first glance, but the conversation quoted below suggests that you've already tried them with no luck. Andreas says in the thread below: > Are you sure the C backend of DBus provides such a feature? Could you name a function? The C backend for D-Bus is meant to allow integration of D-Bus events into an existing external event loop. So, it provides the ability for code implementing this event loop to provide a callback function for libdbus to call when libdbus wants to add a timeout that will be managed by this external event loop (and similarly for watches on fds that libdbus want the external event loop to manage). However, one would expect that the external event loop will... um... be an event loop, meaning that its public API allows timeouts and watches to be created, managed, and removed by arbitrary clients, not just by libdbus through the dbus binding. IMO, if the default dispatcher purports to be a real event loop (and it's not clear that it does, since it's intentionally very simple), it should allow timeouts and watches to be managed. It should do this just because it's an event loop, not because it's part of a D-Bus binding. Ted: An alternate approach would be to ignore the default dispatcher, look at how DBus::Glib::BusDispatcher is implemented, and follow the same model to implement DBus::EventLibThatTedPrefersInsteadOfGlib::BusDispatcher. Vince > > On Mon, Dec 6, 2010 at 1:04 PM, Theodore A. Roth <ta...@gm...> wrote: > >> On Mon, Dec 6, 2010 at 7:31 AM, Jason Glasgow <jgl...@go...> >> wrote: >> > You might try using g_timeout_add_seconds. We have used it with >> dbus-c++. >> > >> http://git.chromium.org/gitweb/?p=cashew.git;a=blob;f=src/device.cc;h=b5ac6f5103d8a1c05e82b0f6633d7bd6b965b6a0;hb=HEAD >> > -Jason >> >> Jason, >> >> Right. That's exactly what I want to do, but doesn't using >> g_timeout_add_seconds() imply that you are using the glib event loop >> and thus have to link to glib? >> >> I need to integrate my dispatcher with our own event loops so need to >> be event loop agnostic and we want to avoid using glib if possible. >> >> I was under the (most likely mistaken) impression the the generic >> dispatcher provided its own event loop which got started when you >> invoke dispatcher.enter(). Sounds like I need to do some more homework >> into how the dispatcher works. ;-) >> >> I have written some simple python apps that use the glib event loop to >> send a heartbeat signal and I was hoping to achieve the same thing >> using the default dispatcher. >> >> Ted Roth >> >> > >> > On Sun, Dec 5, 2010 at 4:58 PM, Andreas Volz <li...@br...> >> wrote: >> >> >> >> Am Fri, 3 Dec 2010 16:23:08 -0700 schrieb Theodore A. Roth: >> >> >> >> > I've been trying to figure out how to register a timeout callback >> with >> >> > the dispatcher so that my callback function will be invoked >> >> > periodically by the dispatcher main loop. The >> >> > BusDispatcher::add_timeout() method seems to take an internal timeout >> >> > object as an argument which leads me to believe that I can't use >> that. >> >> > >> >> > I'm still in the learning dbus-c++ phase and my app is a rather >> simple >> >> > server based on the echo demo, but I've stripped it down to only a >> >> > Hello method and a single signal. My goal is to invoked the signal in >> >> > the timeout. >> >> > >> >> > None of the examples in the source repo show how to do what I what, >> >> > and google hasn't been too helpful. If someone has a link to an >> >> > example of this, I would be most appreciative. >> >> >> >> Hello Ted, >> >> >> >> yes, BusDispatcher::add_timeout() is for another reason. To be honest I >> >> never needed such an feature. Are you sure the C backend of DBus >> >> provides such a feature? Could you name a function? >> >> >> >> I would solve this by writing an interface to a DBus service that >> >> provides you with configurable callbacks. :-) >> >> >> >> regards >> >> Andreas >> >> >> >> >> >> >> ------------------------------------------------------------------------------ >> >> What happens now with your Lotus Notes apps - do you make another >> costly >> >> upgrade, or settle for being marooned without product support? Time to >> >> move >> >> off Lotus Notes and onto the cloud with Force.com, apps are easier to >> >> build, >> >> use, and manage than apps on traditional platforms. Sign up for the >> Lotus >> >> Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d >> >> _______________________________________________ >> >> dbus-cplusplus-devel mailing list >> >> dbu...@li... >> >> https://lists.sourceforge.net/lists/listinfo/dbus-cplusplus-devel >> > >> > >> > >> ------------------------------------------------------------------------------ >> > What happens now with your Lotus Notes apps - do you make another costly >> > upgrade, or settle for being marooned without product support? Time to >> move >> > off Lotus Notes and onto the cloud with Force.com, apps are easier to >> build, >> > use, and manage than apps on traditional platforms. Sign up for the >> Lotus >> > Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d >> > _______________________________________________ >> > dbus-cplusplus-devel mailing list >> > dbu...@li... >> > https://lists.sourceforge.net/lists/listinfo/dbus-cplusplus-devel >> > >> > >> > > |
From: Jason G. <jgl...@go...> - 2010-12-06 20:44:46
|
To answer your questions, yes we do use glib, and link against it. If you want to be event loop agnostic and avoid glib that is a different story. -Jason On Mon, Dec 6, 2010 at 2:59 PM, Jason Glasgow <jgl...@go...> wrote: > see main() for how we attach the dbus-c++ dispatcher to the glib main loop. > > > http://git.chromium.org/gitweb/?p=cashew.git;a=blob;f=src/main.cc;h=d7f64fe5f37b99e91d7eb2ef9e4566f01833e521;hb=HEAD#l102 > > -Jason > > On Mon, Dec 6, 2010 at 1:04 PM, Theodore A. Roth <ta...@gm...> wrote: > >> On Mon, Dec 6, 2010 at 7:31 AM, Jason Glasgow <jgl...@go...> >> wrote: >> > You might try using g_timeout_add_seconds. We have used it with >> dbus-c++. >> > >> http://git.chromium.org/gitweb/?p=cashew.git;a=blob;f=src/device.cc;h=b5ac6f5103d8a1c05e82b0f6633d7bd6b965b6a0;hb=HEAD >> > -Jason >> >> Jason, >> >> Right. That's exactly what I want to do, but doesn't using >> g_timeout_add_seconds() imply that you are using the glib event loop >> and thus have to link to glib? >> >> I need to integrate my dispatcher with our own event loops so need to >> be event loop agnostic and we want to avoid using glib if possible. >> >> I was under the (most likely mistaken) impression the the generic >> dispatcher provided its own event loop which got started when you >> invoke dispatcher.enter(). Sounds like I need to do some more homework >> into how the dispatcher works. ;-) >> >> I have written some simple python apps that use the glib event loop to >> send a heartbeat signal and I was hoping to achieve the same thing >> using the default dispatcher. >> >> Ted Roth >> >> > >> > On Sun, Dec 5, 2010 at 4:58 PM, Andreas Volz <li...@br...> >> wrote: >> >> >> >> Am Fri, 3 Dec 2010 16:23:08 -0700 schrieb Theodore A. Roth: >> >> >> >> > I've been trying to figure out how to register a timeout callback >> with >> >> > the dispatcher so that my callback function will be invoked >> >> > periodically by the dispatcher main loop. The >> >> > BusDispatcher::add_timeout() method seems to take an internal timeout >> >> > object as an argument which leads me to believe that I can't use >> that. >> >> > >> >> > I'm still in the learning dbus-c++ phase and my app is a rather >> simple >> >> > server based on the echo demo, but I've stripped it down to only a >> >> > Hello method and a single signal. My goal is to invoked the signal in >> >> > the timeout. >> >> > >> >> > None of the examples in the source repo show how to do what I what, >> >> > and google hasn't been too helpful. If someone has a link to an >> >> > example of this, I would be most appreciative. >> >> >> >> Hello Ted, >> >> >> >> yes, BusDispatcher::add_timeout() is for another reason. To be honest I >> >> never needed such an feature. Are you sure the C backend of DBus >> >> provides such a feature? Could you name a function? >> >> >> >> I would solve this by writing an interface to a DBus service that >> >> provides you with configurable callbacks. :-) >> >> >> >> regards >> >> Andreas >> >> >> >> >> >> >> ------------------------------------------------------------------------------ >> >> What happens now with your Lotus Notes apps - do you make another >> costly >> >> upgrade, or settle for being marooned without product support? Time to >> >> move >> >> off Lotus Notes and onto the cloud with Force.com, apps are easier to >> >> build, >> >> use, and manage than apps on traditional platforms. Sign up for the >> Lotus >> >> Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d >> >> _______________________________________________ >> >> dbus-cplusplus-devel mailing list >> >> dbu...@li... >> >> https://lists.sourceforge.net/lists/listinfo/dbus-cplusplus-devel >> > >> > >> > >> ------------------------------------------------------------------------------ >> > What happens now with your Lotus Notes apps - do you make another costly >> > upgrade, or settle for being marooned without product support? Time to >> move >> > off Lotus Notes and onto the cloud with Force.com, apps are easier to >> build, >> > use, and manage than apps on traditional platforms. Sign up for the >> Lotus >> > Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d >> > _______________________________________________ >> > dbus-cplusplus-devel mailing list >> > dbu...@li... >> > https://lists.sourceforge.net/lists/listinfo/dbus-cplusplus-devel >> > >> > >> > > |
From: Jason G. <jgl...@go...> - 2010-12-06 19:59:20
|
see main() for how we attach the dbus-c++ dispatcher to the glib main loop. http://git.chromium.org/gitweb/?p=cashew.git;a=blob;f=src/main.cc;h=d7f64fe5f37b99e91d7eb2ef9e4566f01833e521;hb=HEAD#l102 -Jason On Mon, Dec 6, 2010 at 1:04 PM, Theodore A. Roth <ta...@gm...> wrote: > On Mon, Dec 6, 2010 at 7:31 AM, Jason Glasgow <jgl...@go...> wrote: > > You might try using g_timeout_add_seconds. We have used it with > dbus-c++. > > > http://git.chromium.org/gitweb/?p=cashew.git;a=blob;f=src/device.cc;h=b5ac6f5103d8a1c05e82b0f6633d7bd6b965b6a0;hb=HEAD > > -Jason > > Jason, > > Right. That's exactly what I want to do, but doesn't using > g_timeout_add_seconds() imply that you are using the glib event loop > and thus have to link to glib? > > I need to integrate my dispatcher with our own event loops so need to > be event loop agnostic and we want to avoid using glib if possible. > > I was under the (most likely mistaken) impression the the generic > dispatcher provided its own event loop which got started when you > invoke dispatcher.enter(). Sounds like I need to do some more homework > into how the dispatcher works. ;-) > > I have written some simple python apps that use the glib event loop to > send a heartbeat signal and I was hoping to achieve the same thing > using the default dispatcher. > > Ted Roth > > > > > On Sun, Dec 5, 2010 at 4:58 PM, Andreas Volz <li...@br...> > wrote: > >> > >> Am Fri, 3 Dec 2010 16:23:08 -0700 schrieb Theodore A. Roth: > >> > >> > I've been trying to figure out how to register a timeout callback with > >> > the dispatcher so that my callback function will be invoked > >> > periodically by the dispatcher main loop. The > >> > BusDispatcher::add_timeout() method seems to take an internal timeout > >> > object as an argument which leads me to believe that I can't use that. > >> > > >> > I'm still in the learning dbus-c++ phase and my app is a rather simple > >> > server based on the echo demo, but I've stripped it down to only a > >> > Hello method and a single signal. My goal is to invoked the signal in > >> > the timeout. > >> > > >> > None of the examples in the source repo show how to do what I what, > >> > and google hasn't been too helpful. If someone has a link to an > >> > example of this, I would be most appreciative. > >> > >> Hello Ted, > >> > >> yes, BusDispatcher::add_timeout() is for another reason. To be honest I > >> never needed such an feature. Are you sure the C backend of DBus > >> provides such a feature? Could you name a function? > >> > >> I would solve this by writing an interface to a DBus service that > >> provides you with configurable callbacks. :-) > >> > >> regards > >> Andreas > >> > >> > >> > ------------------------------------------------------------------------------ > >> What happens now with your Lotus Notes apps - do you make another costly > >> upgrade, or settle for being marooned without product support? Time to > >> move > >> off Lotus Notes and onto the cloud with Force.com, apps are easier to > >> build, > >> use, and manage than apps on traditional platforms. Sign up for the > Lotus > >> Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d > >> _______________________________________________ > >> dbus-cplusplus-devel mailing list > >> dbu...@li... > >> https://lists.sourceforge.net/lists/listinfo/dbus-cplusplus-devel > > > > > > > ------------------------------------------------------------------------------ > > What happens now with your Lotus Notes apps - do you make another costly > > upgrade, or settle for being marooned without product support? Time to > move > > off Lotus Notes and onto the cloud with Force.com, apps are easier to > build, > > use, and manage than apps on traditional platforms. Sign up for the Lotus > > Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d > > _______________________________________________ > > dbus-cplusplus-devel mailing list > > dbu...@li... > > https://lists.sourceforge.net/lists/listinfo/dbus-cplusplus-devel > > > > > |
From: Theodore A. R. <ta...@gm...> - 2010-12-06 18:04:13
|
On Mon, Dec 6, 2010 at 7:31 AM, Jason Glasgow <jgl...@go...> wrote: > You might try using g_timeout_add_seconds. We have used it with dbus-c++. > http://git.chromium.org/gitweb/?p=cashew.git;a=blob;f=src/device.cc;h=b5ac6f5103d8a1c05e82b0f6633d7bd6b965b6a0;hb=HEAD > -Jason Jason, Right. That's exactly what I want to do, but doesn't using g_timeout_add_seconds() imply that you are using the glib event loop and thus have to link to glib? I need to integrate my dispatcher with our own event loops so need to be event loop agnostic and we want to avoid using glib if possible. I was under the (most likely mistaken) impression the the generic dispatcher provided its own event loop which got started when you invoke dispatcher.enter(). Sounds like I need to do some more homework into how the dispatcher works. ;-) I have written some simple python apps that use the glib event loop to send a heartbeat signal and I was hoping to achieve the same thing using the default dispatcher. Ted Roth > > On Sun, Dec 5, 2010 at 4:58 PM, Andreas Volz <li...@br...> wrote: >> >> Am Fri, 3 Dec 2010 16:23:08 -0700 schrieb Theodore A. Roth: >> >> > I've been trying to figure out how to register a timeout callback with >> > the dispatcher so that my callback function will be invoked >> > periodically by the dispatcher main loop. The >> > BusDispatcher::add_timeout() method seems to take an internal timeout >> > object as an argument which leads me to believe that I can't use that. >> > >> > I'm still in the learning dbus-c++ phase and my app is a rather simple >> > server based on the echo demo, but I've stripped it down to only a >> > Hello method and a single signal. My goal is to invoked the signal in >> > the timeout. >> > >> > None of the examples in the source repo show how to do what I what, >> > and google hasn't been too helpful. If someone has a link to an >> > example of this, I would be most appreciative. >> >> Hello Ted, >> >> yes, BusDispatcher::add_timeout() is for another reason. To be honest I >> never needed such an feature. Are you sure the C backend of DBus >> provides such a feature? Could you name a function? >> >> I would solve this by writing an interface to a DBus service that >> provides you with configurable callbacks. :-) >> >> regards >> Andreas >> >> >> ------------------------------------------------------------------------------ >> What happens now with your Lotus Notes apps - do you make another costly >> upgrade, or settle for being marooned without product support? Time to >> move >> off Lotus Notes and onto the cloud with Force.com, apps are easier to >> build, >> use, and manage than apps on traditional platforms. Sign up for the Lotus >> Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d >> _______________________________________________ >> dbus-cplusplus-devel mailing list >> dbu...@li... >> https://lists.sourceforge.net/lists/listinfo/dbus-cplusplus-devel > > > ------------------------------------------------------------------------------ > What happens now with your Lotus Notes apps - do you make another costly > upgrade, or settle for being marooned without product support? Time to move > off Lotus Notes and onto the cloud with Force.com, apps are easier to build, > use, and manage than apps on traditional platforms. Sign up for the Lotus > Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d > _______________________________________________ > dbus-cplusplus-devel mailing list > dbu...@li... > https://lists.sourceforge.net/lists/listinfo/dbus-cplusplus-devel > > |
From: Jason G. <jgl...@go...> - 2010-12-06 14:31:19
|
You might try using g_timeout_add_seconds. We have used it with dbus-c++. http://git.chromium.org/gitweb/?p=cashew.git;a=blob;f=src/device.cc;h=b5ac6f5103d8a1c05e82b0f6633d7bd6b965b6a0;hb=HEAD <http://git.chromium.org/gitweb/?p=cashew.git;a=blob;f=src/device.cc;h=b5ac6f5103d8a1c05e82b0f6633d7bd6b965b6a0;hb=HEAD> -Jason On Sun, Dec 5, 2010 at 4:58 PM, Andreas Volz <li...@br...> wrote: > Am Fri, 3 Dec 2010 16:23:08 -0700 schrieb Theodore A. Roth: > > > I've been trying to figure out how to register a timeout callback with > > the dispatcher so that my callback function will be invoked > > periodically by the dispatcher main loop. The > > BusDispatcher::add_timeout() method seems to take an internal timeout > > object as an argument which leads me to believe that I can't use that. > > > > I'm still in the learning dbus-c++ phase and my app is a rather simple > > server based on the echo demo, but I've stripped it down to only a > > Hello method and a single signal. My goal is to invoked the signal in > > the timeout. > > > > None of the examples in the source repo show how to do what I what, > > and google hasn't been too helpful. If someone has a link to an > > example of this, I would be most appreciative. > > Hello Ted, > > yes, BusDispatcher::add_timeout() is for another reason. To be honest I > never needed such an feature. Are you sure the C backend of DBus > provides such a feature? Could you name a function? > > I would solve this by writing an interface to a DBus service that > provides you with configurable callbacks. :-) > > regards > Andreas > > > ------------------------------------------------------------------------------ > What happens now with your Lotus Notes apps - do you make another costly > upgrade, or settle for being marooned without product support? Time to move > off Lotus Notes and onto the cloud with Force.com, apps are easier to > build, > use, and manage than apps on traditional platforms. Sign up for the Lotus > Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d > _______________________________________________ > dbus-cplusplus-devel mailing list > dbu...@li... > https://lists.sourceforge.net/lists/listinfo/dbus-cplusplus-devel > |
From: Andreas V. <li...@br...> - 2010-12-05 22:10:16
|
Am Tue, 17 Aug 2010 09:42:52 +0200 schrieb Rafal Dzbęk: > Hello, > > I'm trying to use ObjectAdaptor::Continuation to handle DBus message > asynchronously. > Is there anywhere an example how to do it? > > It seems that I should call > return_now( continuation ); > to finish DBus call, but how to setup return value of the call? > > I see there are structures like MessageIter and Message > MessageIter &it = continuation->writer(); > Message &dbus_msg = it.msg(); > but I'm not sure how to use it. Hello, to be honest I'm not the original author of DBus-C++. I never used ObjectAdaptor::Continuation and also don't know it's reason. Have you found out more about it? Please tell us. regards Andreas |
From: Andreas V. <li...@br...> - 2010-12-05 22:10:16
|
Am Wed, 20 Oct 2010 15:10:37 -0700 schrieb Jason, Jamie: > Apologies if this has been discussed before, but I couldn't find what > I needed in a quick search of the archives. If it is there, simply > pointing me to the relevant discussion thread would be great. > > I have a class that implements the adaptor and I would like to do the > following: > - detect when a client disconnects from my session bus (either by > cleanly shutting down or even if it crashes) > - obtain the client that is sending a message (i.e., calling one of > my exported methods) > > The reason I would like to do this is that when a client calls some > of my exposed methods, I allocate some resources on the client's > behalf. When the client calls one of these methods, I need to > determine the unique client that is requesting it. I need to know > when the client disconnects (or dies) so that I can look at my held > resources and clean up the ones that have been created on behalf of > the client. > > A quick perusal of the header files and mapping out the inheritance > hierarchy for the classes, I don't see how I can get from my class > that derives from *_adaptor and DBus::ObjectAdaptor to a class that > can give me this information. I see that the DBus::Server class has > an on_new_connection callback, but that doesn't appear to be what I > want. > > Can someone point me in the right direction? Hello, sorry for the late answer. I also don't know such a feature in DBus. I would also call this a intelligent logic that shouldn't belong into the DBus protocol. But maybe you could ask on the C list and come back with the C way for it to ask for wrapping it in C++. But for your solution I know similar logic from other systems. I would design an interface function to your client that is named heartbeat() or similar and specify your system to call it e.g. twice a minute. If you doesn't receive a call after e.g. a minute you could consider the other side dead. But please aware of the danger of such heartbeat logic on real live productive systems! So be sure what heartbeat time you choose! Systems sometimes look dead in heavy load situations and come back later. regards Andreas |
From: Andreas V. <li...@br...> - 2010-12-05 22:00:11
|
Am Fri, 3 Dec 2010 16:23:08 -0700 schrieb Theodore A. Roth: > I've been trying to figure out how to register a timeout callback with > the dispatcher so that my callback function will be invoked > periodically by the dispatcher main loop. The > BusDispatcher::add_timeout() method seems to take an internal timeout > object as an argument which leads me to believe that I can't use that. > > I'm still in the learning dbus-c++ phase and my app is a rather simple > server based on the echo demo, but I've stripped it down to only a > Hello method and a single signal. My goal is to invoked the signal in > the timeout. > > None of the examples in the source repo show how to do what I what, > and google hasn't been too helpful. If someone has a link to an > example of this, I would be most appreciative. Hello Ted, yes, BusDispatcher::add_timeout() is for another reason. To be honest I never needed such an feature. Are you sure the C backend of DBus provides such a feature? Could you name a function? I would solve this by writing an interface to a DBus service that provides you with configurable callbacks. :-) regards Andreas |
From: Theodore A. R. <ta...@gm...> - 2010-12-03 23:23:16
|
I've been trying to figure out how to register a timeout callback with the dispatcher so that my callback function will be invoked periodically by the dispatcher main loop. The BusDispatcher::add_timeout() method seems to take an internal timeout object as an argument which leads me to believe that I can't use that. I'm still in the learning dbus-c++ phase and my app is a rather simple server based on the echo demo, but I've stripped it down to only a Hello method and a single signal. My goal is to invoked the signal in the timeout. None of the examples in the source repo show how to do what I what, and google hasn't been too helpful. If someone has a link to an example of this, I would be most appreciative. Thanks. Ted Roth |
From: Jason, J. <jam...@in...> - 2010-10-20 22:10:46
|
Apologies if this has been discussed before, but I couldn't find what I needed in a quick search of the archives. If it is there, simply pointing me to the relevant discussion thread would be great. I have a class that implements the adaptor and I would like to do the following: - detect when a client disconnects from my session bus (either by cleanly shutting down or even if it crashes) - obtain the client that is sending a message (i.e., calling one of my exported methods) The reason I would like to do this is that when a client calls some of my exposed methods, I allocate some resources on the client's behalf. When the client calls one of these methods, I need to determine the unique client that is requesting it. I need to know when the client disconnects (or dies) so that I can look at my held resources and clean up the ones that have been created on behalf of the client. A quick perusal of the header files and mapping out the inheritance hierarchy for the classes, I don't see how I can get from my class that derives from *_adaptor and DBus::ObjectAdaptor to a class that can give me this information. I see that the DBus::Server class has an on_new_connection callback, but that doesn't appear to be what I want. Can someone point me in the right direction? Thanks. Jamie ---------------------------------------------------------------- Jamie Jason (jam...@in...) "I say this from the bottom of my heart, that if you don't root for the Dodgers, you might not get into Heaven." - Tommy Lasorda All opinions expressed are: 1. Entirely my own. 2. Not necessarily shared by my employer. 3. Unencumbered by the thought process. ---------------------------------------------------------------- |
From: Andreas V. <li...@br...> - 2010-10-07 22:40:11
|
Am Mon, 6 Sep 2010 12:24:03 +0800 schrieb Mat: Hello Mat, I applied your patch (recursive_mutex.patch). To be honest I didn't deeply analysed the new recursive situation from all aspects. But I tried it with some sample applications here and it works nice. If others also have no problem with latest GIT source than I would call it a good change. :-) regards andreas > Hi All, > > We found that in multi-thread programs, if some dbus exception > happended in the critical section of _mutex_w, > the DefaultWatches::~DefaultWatches() will be called in the critical > section of _mutex_w, > which cause deadlock. > > Initial _mutex_w with recursive option ( as recursive_mutex.patch ), > or add this attribute of pthread, PTHREAD_MUTEX_RECURSIVE, ( as > recursive_mutex2.patch ) > , can solve this problem. > > hope the information helps :-) > > sincerely, Mat. |
From: Andreas V. <li...@br...> - 2010-10-07 22:25:10
|
Am Thu, 30 Sep 2010 12:24:22 +0200 schrieb Roman Fietze: Hello Roman, I applied your patched. Thanks. Andreas > Hello Andreas, > > Maybe you are interested in these two tiny patches. > > The first one is very simple, it just ignores all generated files and > directories. > > The second one fixes a compiler warning on 64 bit, because a void > pointer does not into a int, because that's signed. The exakt compiler > warning was: "cast from ‘void*’ to ‘int’ loses precision". > > > Roman > > -- > Roman Fietze Telemotive AG Büro Mühlhausen > Breitwiesen 73347 Mühlhausen > Tel.: +49(0)7335/18493-45 http://www.telemotive.de > > Amtsgericht Ulm HRB 541321 > Vorstand: > Peter Kersten, Markus Fischer, Franz Diller, Markus Stolz |
From: Andreas V. <li...@br...> - 2010-10-05 21:00:11
|
Am Mon, 04 Oct 2010 12:08:17 +0000 schrieb pl...@us...: > Hi, I'm trying to create a dbus c++ package for openSUSE for > use atm by ffado but I can't find a source package anywhere, > not even a src rpm. > Thanks > Dave P Hello Dave, I just generated a make distcheck image on my machine and uploaded it here: http://tux-style.com/tmp/libdbus-c++-0.6.0-pre1.tar.gz I know there're some open critical bugs, but it works good for many cases. So why not releasing at least the current state. I'll release a source package that packagers could start working. Not having a official release only results in unofficial forks over the time. So if you test it successful on your machine I'll release a first source package. regards Andreas |
From: Andreas V. <li...@br...> - 2010-09-28 20:10:13
|
Am Tue, 17 Aug 2010 17:51:09 -0400 schrieb Christopher Piggott: Hello Chris, some time ago I've done something similar with a bluetooth adapter. I uploaded my source to this place. Maybe it helps you to understand how to do it. It took me some time to find it out: http://tux-style.com/tmp/bluephone_drop.tar.gz The idea is to get the object path and then use it later. A little tricky is to get correct one if more that one exist. In my case of mobiles I would detect the correct one from the mobile name. I hope this helps you a little. Sorry, but I never used WLAN with DBus-C++. regards Andreas > Hi, > > I've written a number of apps using the low level dbus API but wanted > to try dbus-c++ to do a small project. > > I want to talk to wpa_supplicant to tell it to scan for a certain > SSID. You accomplish this in several steps: > > First, you ask wpa_supplicant for an object path to an interface. > Using the command line tools: > dbus-send --system --print-reply --type=method_call \ > --dest=fi.epitest.hostap.WPASupplicant \ > /fi/epitest/hostap/WPASupplicant \ > fi.epitest.hostap.WPASupplicant.getInterface \ > string:"wlan0" > > It will return something like: > object path "/fi/epitest/hostap/WPASupplicant/Interfaces/0 > > > Now that you have that object path, you can call the method that tells > it to begin scanning: > > dbus-send --system --print-reply --type=method_call \ > --dest=fi.epitest.hostap.WPASupplicant \ > /fi/epitest/hostap/WPASupplicant/Interfaces/0 \ # Note: > using object ID returned by above > fi.epitest.hostap.WPASupplicant.Interface.scan > > It returns 1 to indicate success. > > > Then you wait a while, and request the results with something like: > > dbus-send --system --print-reply --type=method_call \ > --dest=fi.epitest.hostap.WPASupplicant \ > /fi/epitest/hostap/WPASupplicant/Interfaces/0 \ > fi.epitest.hostap.WPASupplicant.Interface.scan > > > > This returns an object consisting of a dictionary and a bunch of data. > You can see described with an example: > http://old.nabble.com/0.7-not-working-with-linux-2.6.24-td15422455.html > > > So here's my question. I made an XML file to try to describe all of > this in a way that dbusxx-xml2cpp would understand, and I got stuck > almost immediately because the nature of the Interface object is > dynamic. In other words, I can't say: > <node name="/fi/epitest/hostap/WPASupplicant/Interfaces/0"> ... > </node> > > because it might not be interface 0 on another system, it might be > interface 1, 2, or 100. > > What's the right way to proceed here? Do I need to not use the proxy > object model / code generator all (in which case, is there any point > to me using dbus-c++ for this project?) > > --Chris > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by > > Make an app they can't live without > Enter the BlackBerry Developer Challenge > http://p.sf.net/sfu/RIM-dev2dev > _______________________________________________ > dbus-cplusplus-devel mailing list > dbu...@li... > https://lists.sourceforge.net/lists/listinfo/dbus-cplusplus-devel > |
From: Andreas V. <li...@br...> - 2010-09-02 21:50:10
|
Am Tue, 17 Aug 2010 10:18:54 -0600 schrieb Giusti, Gisela: Hello Gisela, could you provide your example as C++ files with GNU Makefile? Then I'll spend some more time in figuring it out... regards Andreas > Hi! > I am very new at dbus, so my doubts could be very basics... sorry for > that. I tried a couple of c++ examples using dbus-c++ bindings. I'm > using dbus-c++-devel v0.5.0 package in a meego V1.0 release. I coded > a simple client-server from scratch in order to understand the > functionality of DBus signals. > > Here is my code: > Test.xml: > I have a method (Subscribe) and a signal (DataChanged) > > > <?xml version="1.0" ?> > <node name="/org/freedesktop/DBus/Test"> > <interface name="org.freedesktop.DBus.Test"> > <signal name="DataChanged"> > <arg name="Data" type="s"/> > </signal> > <method name="Subscribe"> > <arg type="s" name="DataName" direction="in"/> > </method> > </interface> > </node> > > > TestServer class: > > class TestServer > : public org::freedesktop::DBus::Test_adaptor, > public DBus::ObjectAdaptor, > { > public: > TestServer(DBus::Connection &connection); > void Subscribe(const std::string& DataName); > > }; > > And TestClient class: > > class TestClient > : public DBus::ObjectProxy, > public org::freedesktop::DBus::Test_proxy > { > public: > TestClient(DBus::Connection& connection, const char * path, > const char * name); void DataChanged(const std::string& data); > }; > > > TestServer implementation: Because I was trying to test signals, I > emit the signal when the subscribe method is called. Also, I create > another method, sendSignal to emit the signal and I attached it to > SIGUSR1, this allows me to send the signal manually with the kill -10 > <serverpid> command. > > > static const char *TEST_SERVER_NAME = "org.freedesktop.DBus.Test"; > static const char *TEST_SERVER_PATH = "/org/freedesktop/DBus/Test"; > > > TestServer::TestServer(DBus::Connection &connection) > : DBus::ObjectAdaptor(connection, TEST_SERVER_PATH) > { > } > > TestServer * g_server; > DBus::BusDispatcher dispatcher; > > void TestServer::Subscribe(const std::string& DataName) > { > std::cout<<DataName<<"has been subscribed"std::endl; > //Emiting the signal > g_server->DataChanged("subscription signal..."); > } > > > void niam(int sig) > { > dispatcher.leave(); > } > > void sendSignal(int sig) > { > std::cout<<"Sending signal"<<std::endl; > g_server->DataChanged("something happens..."); > } > > int main() > { > signal(SIGTERM, niam); > signal(SIGINT, niam); > signal(SIGUSR1, sendSignal); > > DBus::default_dispatcher = &dispatcher; > > > DBus::Connection conn = DBus::Connection::SessionBus(); > conn.request_name(TEST_SERVER_NAME); > > TestServer server(conn); > g_server = &server; > > dispatcher.enter(); > > return 0; > > } > > Finally, this is the client code: > > static const char *TEST_SERVER_NAME = "org.freedesktop.DBus.Test"; > static const char *TEST_SERVER_PATH = "/org/freedesktop/DBus/Test"; > > > TestClient::TestClient(DBus::Connection& connection, const char * > path, const char * name): DBus::ObjectProxy(connection,path,name) > {} > > void TestClient::DataChanged(const std::string& data) > { > std::cout<<"Changed!"<<std::endl; > > } > > DBus::BusDispatcher dispatcher; > > void niam(int sig) > { > > dispatcher.leave(); > } > > int main() > { > signal(SIGTERM, niam); > signal(SIGINT, niam); > > > DBus::default_dispatcher = &dispatcher; > > DBus::Connection conn = DBus::Connection::SessionBus(); > //Why I need to match signals by hand??? > conn.add_match("type='signal'"); > > TestClient client (conn, TEST_SERVER_PATH, TEST_SERVER_NAME); > client.Subscribe("Client0001"); > dispatcher.enter(); > > > return 0; > } > > The thing is, if I didn't include the line > conn.add_match("type='signal') the signal was not catched by the > client (although it has been emited by the server). Im a bit confused > because if you follow the Echo example in DBus sources, the add_match > is never call, and it seems that the client part where the signal is > catched is never executed. Is this because the binding is still > incomplete? Calling the add_match("type='signal') is the right way if > you want your client be notified of a server signal? > > Thanks in advance! > > Gisela > > _______________________________________________ > dbus mailing list > db...@li... > http://lists.freedesktop.org/mailman/listinfo/dbus > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by > > Make an app they can't live without > Enter the BlackBerry Developer Challenge > http://p.sf.net/sfu/RIM-dev2dev > _______________________________________________ > dbus-cplusplus-devel mailing list > dbu...@li... > https://lists.sourceforge.net/lists/listinfo/dbus-cplusplus-devel > |
From: Christopher P. <cpi...@gm...> - 2010-08-17 21:51:17
|
Hi, I've written a number of apps using the low level dbus API but wanted to try dbus-c++ to do a small project. I want to talk to wpa_supplicant to tell it to scan for a certain SSID. You accomplish this in several steps: First, you ask wpa_supplicant for an object path to an interface. Using the command line tools: dbus-send --system --print-reply --type=method_call \ --dest=fi.epitest.hostap.WPASupplicant \ /fi/epitest/hostap/WPASupplicant \ fi.epitest.hostap.WPASupplicant.getInterface \ string:"wlan0" It will return something like: object path "/fi/epitest/hostap/WPASupplicant/Interfaces/0 Now that you have that object path, you can call the method that tells it to begin scanning: dbus-send --system --print-reply --type=method_call \ --dest=fi.epitest.hostap.WPASupplicant \ /fi/epitest/hostap/WPASupplicant/Interfaces/0 \ # Note: using object ID returned by above fi.epitest.hostap.WPASupplicant.Interface.scan It returns 1 to indicate success. Then you wait a while, and request the results with something like: dbus-send --system --print-reply --type=method_call \ --dest=fi.epitest.hostap.WPASupplicant \ /fi/epitest/hostap/WPASupplicant/Interfaces/0 \ fi.epitest.hostap.WPASupplicant.Interface.scan This returns an object consisting of a dictionary and a bunch of data. You can see described with an example: http://old.nabble.com/0.7-not-working-with-linux-2.6.24-td15422455.html So here's my question. I made an XML file to try to describe all of this in a way that dbusxx-xml2cpp would understand, and I got stuck almost immediately because the nature of the Interface object is dynamic. In other words, I can't say: <node name="/fi/epitest/hostap/WPASupplicant/Interfaces/0"> ... </node> because it might not be interface 0 on another system, it might be interface 1, 2, or 100. What's the right way to proceed here? Do I need to not use the proxy object model / code generator all (in which case, is there any point to me using dbus-c++ for this project?) --Chris |
From: Giusti, G. <gis...@in...> - 2010-08-17 16:19:17
|
Hi! I am very new at dbus, so my doubts could be very basics... sorry for that. I tried a couple of c++ examples using dbus-c++ bindings. I'm using dbus-c++-devel v0.5.0 package in a meego V1.0 release. I coded a simple client-server from scratch in order to understand the functionality of DBus signals. Here is my code: Test.xml: I have a method (Subscribe) and a signal (DataChanged) <?xml version="1.0" ?> <node name="/org/freedesktop/DBus/Test"> <interface name="org.freedesktop.DBus.Test"> <signal name="DataChanged"> <arg name="Data" type="s"/> </signal> <method name="Subscribe"> <arg type="s" name="DataName" direction="in"/> </method> </interface> </node> TestServer class: class TestServer : public org::freedesktop::DBus::Test_adaptor, public DBus::ObjectAdaptor, { public: TestServer(DBus::Connection &connection); void Subscribe(const std::string& DataName); }; And TestClient class: class TestClient : public DBus::ObjectProxy, public org::freedesktop::DBus::Test_proxy { public: TestClient(DBus::Connection& connection, const char * path, const char * name); void DataChanged(const std::string& data); }; TestServer implementation: Because I was trying to test signals, I emit the signal when the subscribe method is called. Also, I create another method, sendSignal to emit the signal and I attached it to SIGUSR1, this allows me to send the signal manually with the kill -10 <serverpid> command. static const char *TEST_SERVER_NAME = "org.freedesktop.DBus.Test"; static const char *TEST_SERVER_PATH = "/org/freedesktop/DBus/Test"; TestServer::TestServer(DBus::Connection &connection) : DBus::ObjectAdaptor(connection, TEST_SERVER_PATH) { } TestServer * g_server; DBus::BusDispatcher dispatcher; void TestServer::Subscribe(const std::string& DataName) { std::cout<<DataName<<"has been subscribed"std::endl; //Emiting the signal g_server->DataChanged("subscription signal..."); } void niam(int sig) { dispatcher.leave(); } void sendSignal(int sig) { std::cout<<"Sending signal"<<std::endl; g_server->DataChanged("something happens..."); } int main() { signal(SIGTERM, niam); signal(SIGINT, niam); signal(SIGUSR1, sendSignal); DBus::default_dispatcher = &dispatcher; DBus::Connection conn = DBus::Connection::SessionBus(); conn.request_name(TEST_SERVER_NAME); TestServer server(conn); g_server = &server; dispatcher.enter(); return 0; } Finally, this is the client code: static const char *TEST_SERVER_NAME = "org.freedesktop.DBus.Test"; static const char *TEST_SERVER_PATH = "/org/freedesktop/DBus/Test"; TestClient::TestClient(DBus::Connection& connection, const char * path, const char * name): DBus::ObjectProxy(connection,path,name) {} void TestClient::DataChanged(const std::string& data) { std::cout<<"Changed!"<<std::endl; } DBus::BusDispatcher dispatcher; void niam(int sig) { dispatcher.leave(); } int main() { signal(SIGTERM, niam); signal(SIGINT, niam); DBus::default_dispatcher = &dispatcher; DBus::Connection conn = DBus::Connection::SessionBus(); //Why I need to match signals by hand??? conn.add_match("type='signal'"); TestClient client (conn, TEST_SERVER_PATH, TEST_SERVER_NAME); client.Subscribe("Client0001"); dispatcher.enter(); return 0; } The thing is, if I didn't include the line conn.add_match("type='signal') the signal was not catched by the client (although it has been emited by the server). Im a bit confused because if you follow the Echo example in DBus sources, the add_match is never call, and it seems that the client part where the signal is catched is never executed. Is this because the binding is still incomplete? Calling the add_match("type='signal') is the right way if you want your client be notified of a server signal? Thanks in advance! Gisela _______________________________________________ dbus mailing list db...@li... http://lists.freedesktop.org/mailman/listinfo/dbus |
From: Rafal D. <r....@ke...> - 2010-08-17 07:55:24
|
Hello, I'm trying to use ObjectAdaptor::Continuation to handle DBus message asynchronously. Is there anywhere an example how to do it? It seems that I should call return_now( continuation ); to finish DBus call, but how to setup return value of the call? I see there are structures like MessageIter and Message MessageIter &it = continuation->writer(); Message &dbus_msg = it.msg(); but I'm not sure how to use it. Regards Rafał -- Asylia ExchangeDefender Message Security: Click below to verify authenticity http://www.exchangedefender.com/verify.asp?id=o7H7go7Z012122&from=r....@ke... |
From: Andreas V. <li...@br...> - 2010-08-03 22:20:15
|
Am Sun, 25 Jul 2010 10:52:50 +0300 schrieb Or Goshen: > Hi > > How do I assign a value to a new variant type ? > > For example: > > ::DBus::Variant Server::get(const std::string& key) { > ::DBus::Variant var; > > // var = std::string("test"); // not this way > > // var.writer() << std::string("test"); // not this way either > > return var; > } > > Next question - suppose a Variant contains an array of strings, how > do I detect that + how do I parse that ? > > For example: > > void Server::set(const std::string& key, const ::DBus::Variant& > value) { if (value.signature().c_str()[0] == 'a') { > // array > //Am I suppose to parse the signature here ? > } else { > // basic type > std::string str = value; > std::cout << str << std::endl; > } > } Hello Or, see here some code how I use dbus-c++ with Obex. There's a usage of Variant: ObexClient obexClient (conn); ::DBus::Variant v; ::DBus::MessageIter m = v.writer(); m.append_string("00:21:AB:D6:25:3F"); ::DBus::Variant v2; ::DBus::MessageIter m2 = v2.writer(); m2.append_string("PBAP"); map <std::string, ::DBus::Variant> sessionParam; sessionParam["Destination"] = v; sessionParam["Target"] = v2; ::DBus::Path session_path = obexClient.CreateSession (sessionParam); cout << "Session Path: " << session_path << endl; PhonebookAccess pbap (conn, session_path); ObexSession obexSession (conn, session_path); pbap.Select ("SIM", "och"); pbap.SetFormat ("vcard30"); string ret = pbap.PullAll (); cout << ret << endl; If you've still some questions then please assign to the list. I allowed your mail even if you're not assigned this one time. regards Andreas |
From: Andreas V. <li...@br...> - 2010-08-03 22:04:54
|
Am Mon, 12 Jul 2010 16:41:14 +0100 schrieb Markus Kohler: Hello Markus, thanks for reporting. It's good, so I applied it to mainline. regards Andreas > Hi Paulo and Andreas, > > I just wanted to report a minor "bugs" in D-Bus-c++ and solutions. It > is about dbus-c++ that comes the latest git from > git://gitorious.org/dbus-cplusplus/mainline.git. > > include/dbus-c++/property.h does not compile with boost serialization > (template problem): > > I attached the automake project (xsps-0.2.3018.tar.gz). Just > do a ./configure; make > When compiling with the original property.h file the compiler > will choke (see attachment compile.log) > When compiling with the attached property.h file it compiles > (calling template operator() as function) > Patch attached as property.patch > > Regards, > Markus > > > > > > > > Markus KOHLER > Senior Software Engineer > > > > CG Power Systems Ireland Limited > Automation Systems Division > Herbert House, Harmony Row, Dublin > 2, Ireland. > T: +353 1 4153716 M: +353 87 > 6202732 W: www.cgglobal.com > Save the environment. Please print > only if essential. > > New E-Mail ID : As part of our new Brand Identity, all CG locations > across the world have a common e-mail domain name “CGglobal.com”. My > e-mail ID which was Ma...@Mi... is now > Mar...@CG.... Since my earlier e-mail ID will soon be > phased out, I would appreciate if you please record my new e-mail ID > for future correspondence. > > > > > > CG DISCLAIMER: This email contains confidential information. It is > intended exclusively for the addressees. If you are not an addressee, > you must not store, transmit or disclose its contents. Instead please > notify the sender immediately; and permanently delete this e-mail > from your computer systems. We have taken reasonable precautions to > ensure that no viruses are present. However, you must check this > email and the attachments, for viruses. We accept no liability > whatsoever, for any detriment caused by any transmitted virus. |
From: Andreas V. <li...@br...> - 2010-08-03 21:58:05
|
Hello together, Since some time the default main loop wasn't working really good. At least not with multi threaded applications. Now I had a use case to work with the default main loop and dispatch my data from a worker thread. A pipe is used to implement this dispatcher. Have a look in the echo example if you like. I've not yet tested it more deep, but the example seems to work good. I'm now starting to use it, so maybe the interface will maybe change a little in future. If you've any feedback report it here. regards Andreas |
From: Or G. <ob...@gm...> - 2010-07-25 07:52:56
|
Hi How do I assign a value to a new variant type ? For example: ::DBus::Variant Server::get(const std::string& key) { ::DBus::Variant var; // var = std::string("test"); // not this way // var.writer() << std::string("test"); // not this way either return var; } Next question - suppose a Variant contains an array of strings, how do I detect that + how do I parse that ? For example: void Server::set(const std::string& key, const ::DBus::Variant& value) { if (value.signature().c_str()[0] == 'a') { // array //Am I suppose to parse the signature here ? } else { // basic type std::string str = value; std::cout << str << std::endl; } } Thanks, Or |
From: Andreas V. <li...@br...> - 2010-07-07 20:50:19
|
Am Wed, 07 Jul 2010 08:26:45 +0100 schrieb Bob Ham: > On Thu, 2010-06-24 at 10:18 +0100, Bob Ham wrote: > > Would it be possible for you put the (latest) dbus-c++ > > documentation online so that search engines find your web space > > rather than mine? > > *Shrug* the documentation in my web space is gone. Hello Bob, it's ok. If I find some time I'll put it somewhere else. regards Andreas |