All of lore.kernel.org
 help / color / mirror / Atom feed
* Getting Modem properties using qt dbus programming -reg
@ 2010-05-27 12:35 krishna k
  2010-05-27 13:07 ` Jussi Kukkonen
  2010-05-27 15:05 ` Nicola Mfb
  0 siblings, 2 replies; 3+ messages in thread
From: krishna k @ 2010-05-27 12:35 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1628 bytes --]


Hi,

I am trying to implement application using qt dbus module, Which will call SetProperty with parameters QString, QVariant.

using dbus-send i am using the following command...

sudo dbus-send --system --type=method_call --print-reply --dest=org.ofono /phonesim0 org.ofono.Modem.SetProperty string:"Powered" variant:boolean:true

In the above command, According to my knowledge, I interpreted the things as below...

Type of bus       : systembus
Type of call       : method call
service name    : org.ofono
object path        : /phonesim0
Interface name : org.ofono.Modem
method name   : SetProperty

which means ( "sv" -- string, variant)


I am trying the same thing using qt program...

    QDBusConnection bus = QDBusConnection::systemBus();
 
    QDBusInterface dbus_iface("org.ofono", "/phonesim0/operator/23402",
                                  "org.ofono.Modem", bus);
     bool value = true;
     dbus_iface.call("SetProperty", QString("Powered"), QVariant(QVariant::Bool, &value));

I am getting output as below o/p..






QDBusMessage(type=Error, service="", error name="org.freedesktop.DBus.Error.UnknownMethod", 
error message="Method "SetProperty" with signature "sb" on interface "org.ofono.Modem" doesn't exist
", signature="", contents=([]) ) 

Please find that "sb" which is analysed as "string and boolean" parameters.

Can any one suggest what is wrong with is piece of code...
regards,KK.

 		 	   		  
_________________________________________________________________
South Cinema This Decade
http://entertainment.in.msn.com/southcinemathisdecade/

[-- Attachment #2: attachment.html --]
[-- Type: text/html, Size: 3576 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Getting Modem properties using qt dbus programming -reg
  2010-05-27 12:35 Getting Modem properties using qt dbus programming -reg krishna k
@ 2010-05-27 13:07 ` Jussi Kukkonen
  2010-05-27 15:05 ` Nicola Mfb
  1 sibling, 0 replies; 3+ messages in thread
From: Jussi Kukkonen @ 2010-05-27 13:07 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 796 bytes --]

On 05/27/2010 03:35 PM, krishna k wrote:
>
> Hi,
>
> I am trying to implement application using qt dbus module, Which will call SetProperty with parameters QString, QVariant.
...
> I am trying the same thing using qt program...
>
>      QDBusConnection bus = QDBusConnection::systemBus();
>
>      QDBusInterface dbus_iface("org.ofono", "/phonesim0/operator/23402",
>                                    "org.ofono.Modem", bus);
>       bool value = true;
>       dbus_iface.call("SetProperty", QString("Powered"), QVariant(QVariant::Bool,&value));

I believe "v" maps to QDBusVariant, not QVariant. Maybe something like 
this works:

bool value = true;
var = QDBusVariant (QVariant(QVariant::Bool,&value));
dbus_iface.call("SetProperty", QString("Powered"), var);


Jussi

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Getting Modem properties using qt dbus programming -reg
  2010-05-27 12:35 Getting Modem properties using qt dbus programming -reg krishna k
  2010-05-27 13:07 ` Jussi Kukkonen
@ 2010-05-27 15:05 ` Nicola Mfb
  1 sibling, 0 replies; 3+ messages in thread
From: Nicola Mfb @ 2010-05-27 15:05 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 329 bytes --]

On Thu, May 27, 2010 at 2:35 PM, krishna k <id_kishore@live.in> wrote:
[...]
>      bool value = true;
>      dbus_iface.call("SetProperty", QString("Powered"), QVariant(QVariant::Bool, &value));

use: QVariant::fromValue(QDBusVariant(value))

warning, the call you are using is not async.

Regards

    Niko

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-05-27 15:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-27 12:35 Getting Modem properties using qt dbus programming -reg krishna k
2010-05-27 13:07 ` Jussi Kukkonen
2010-05-27 15:05 ` Nicola Mfb

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.