Thanks, Jukka,

But, it doesn't help my issue. I want to put "Dictionary" type as QVariantMap 
into the SetProperty, but it returns "net.connman.Error.InvalidArguments". In 
case when I put "Array" type as QStringList, it is working properly (e.g., 
"Nameservers.Configuration").

And, I don't find any example code to set "Dictionary" type in your link 
although there are lots of examples of get "Dictionary" type.

Daniel

On Jan 27, 2012, at 1:51 AM, Jukka Rissanen wrote:

> Hi Daniel,
> 
> you could check the Qt mobility API how the connman plugin passes dict. 
> Sources can be found at
> 
> http://qt.gitorious.org/qt/qt/trees/4.8/src/plugins/bearer/connman
> 
> 
> Cheers,
> Jukka
> 
> 
> On 01/27/2012 07:13 AM, Daniel (Youngwhan) Song wrote:
>> Hi,
>> 
>> I'm trying to create Qt based program working as set-ipv4-method which is 
>> one of test python scripts.
>> 
>> The problem I'm facing now is that I don't know how to give dictionary type 
>> on d-bus to connman properly.
>> 
>> Here is the snippet what I do:
>> 
>> ---
>> QVariantMap ip4_configuration;
>> ip4_configuration["Method"] = "manual";
>> 
>> QVariant mm;
>> mm.setValue(ip4_configuration);
>> 
>> QDBusVariant v;
>> v.setVariant(mm);
>> 
>> ConnmanService connman_service_if("net.connman",<PATH>, 
>> QDBusConnection::systemBus(), 0);
>> QDBusPendingReply<>  reply;
>> reply=connman_service_if.SetProperty("IPv4.Configuration", v);
>> reply.waitForFinished();
>> if (!reply.isValid()) {
>>     DBG("Invalid Dbus");
>> }
>> if (reply.isError()) {
>>     DBG("Dbus/Connman Error: "<<  reply.error());
>> }
>> ---
>> and SetProperty is defined as
>> ---
>> inline QDBusPendingReply<>  SetProperty(const QString&in0, const 
>> QDBusVariant&in1)
>>     {
>>         QList<QVariant>  argumentList;
>>         argumentList<<  qVariantFromValue(in0)<<  qVariantFromValue(in1);
>>         return callWithArgumentList(QDBus::Block, 
>> QLatin1String("SetProperty"), argumentList);
>>     }
>> ---
>> 
>> Now, I'm getting "net.connman.Error.InvalidArguments" when it calls.
>> 
>> Is there anyone who uses Qt Dbus and Connman? If then, any help on the 
>> problem above would be appreciated.
>> 
>> FYI, set-ipv4-method is working very well in my system.
>> 
>> Thank you,
>> Daniel
>> 
>> _______________________________________________
>> connman mailing list
>> [email protected]
>> http://lists.connman.net/listinfo/connman
>> 
> 

_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to