public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: "Yogesh Jagtap" <jagtapyb@gmail.com>
To: "BlueZ users" <bluez-users@lists.sourceforge.net>
Subject: Re: [Bluez-users] [Fwd: Re:  Regarding GetInfo]
Date: Thu, 18 Oct 2007 10:00:26 +0530	[thread overview]
Message-ID: <b7f7accd0710172130m5cbea8dfp87d58027c045d2aa@mail.gmail.com> (raw)
In-Reply-To: <1192679922.5231.49.camel@localhost>


[-- Attachment #1.1: Type: text/plain, Size: 4155 bytes --]

Hi Marcel,

I dont have problem with signature. For me, I just want device class. I have
written following code.

        msg = dbus_message_new_method_call("org.bluez", "/org/bluez/hci0",
INTERFACE,"GetInfo");
        reply = dbus_connection_send_with_reply_and_block (conn,msg,
-1,&error);
        dbus_message_iter_init (reply, &iter);
        printf("\nSignature::%s",dbus_message_get_signature(reply));
        printf("\nIter
signature::%s",dbus_message_iter_get_signature(&iter));
        dbus_message_iter_recurse (&iter, &dict_iter);
        printf("\ndict_Iter
signature::%s",dbus_message_iter_get_signature(&dict_iter));
        dbus_message_iter_recurse (&dict_iter, &data_iter);
        printf("\ndata_Iter
signature::%s",dbus_message_iter_get_signature(&data_iter));
        while (dbus_message_iter_has_next(&data_iter))
        {
            printf("\ndata
type::%d",(dbus_message_iter_get_arg_type(&data_iter)));
            dbus_message_iter_next(&data_iter);
        }
following is output:
Signature::a{sv}
Iter signature::a{sv}
dict_Iter signature::{sv}
data_Iter signature::s
data type::115

I am expecting all values in the while loop. I want to iterate all adapter
info. Please correct me where I am wrong.

Regards
Yogesh


*From*: Marcel Holtmann
<marcel@holtmann.org<Marcel%20Holtmann%20%3cmarcel@holtmann.org%3e>
> >
> *Reply-To*: BlueZ users <bluez-users@lists.sourceforge.net<BlueZ%20users%20%3cbluez-users@lists.sourceforge.net%3e>
> >
> *To*: BlueZ users <bluez-users@lists.sourceforge.net<BlueZ%20users%20%3cbluez-users@lists.sourceforge.net%3e>
> >
> *Subject*: Re: [Bluez-users] Regarding GetInfo
> *Date*: Wed, 17 Oct 2007 16:25:56 +0200
>
> Hi Yogesh,
>
>  I want to get device class. But DBus API's are available for getting
>  device Major class, Minor class and service class. But no API to get
>  device class. To get Device class I have two options,
>  1. Get device class from GetInfo.
>  2. Get Major class, Minor class and service class and from that
>  construct device class.
>  So I choose first way, But I am not able to get device class.
>
>  To get information about adapter, I have written code like this.
>
>  msg = dbus_message_new_method_call("org.bluez", "/org/bluez/hci0",
>  INTERFACE,"GetInfo");
>          reply = dbus_connection_send_with_reply_and_block (conn,msg,
>  -1,&error);
>          dbus_message_iter_init (reply, &iter);
>          printf("\nSignature::%s",dbus_message_get_signature(reply));
>          cout<<"\nIter
>  signature::"<<dbus_message_iter_get_signature(&iter);
>          dbus_message_iter_recurse (&iter, &dict_iter);
>          cout<<"\ndict_Iter
>  signature::"<<dbus_message_iter_get_signature(&dict_iter);
>          dbus_message_iter_recurse (&dict_iter, &data_iter);
>          cout<<"\ndata_Iter
>  signature::"<<dbus_message_iter_get_signature(&data_iter);
>          while (dbus_message_iter_has_next(&data_iter))
>          {
>             cout<<"\ndata
> type::"<<(dbus_message_iter_get_arg_type(&data_iter));
>              dbus_message_iter_next(&data_iter);
>          }
>
>  But its not working. When I print signatures, it is printing like this
>  Signature::a{sv}
>  Iter signature::a{sv}
>  dict_Iter signature::{sv}
>  data_Iter signature::s
>  data type::115
>
>  And I found that,
>   a{sv} is a dictionary with 's'tring keys and 'v'ariants as values
>
>  So does that mean GetInfo is returning only one key value pair?
>  Or I am missing something?
>
> we fixed the signature in the last release. That might explain an issue.
> Other than that, I can't read C++ code. Use plain C or Python to make me
> look at your code.
>
> Regards
>
> Marcel
>
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> Bluez-users mailing list
> Bluez-users@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/bluez-users
>
>

[-- Attachment #1.2: Type: text/html, Size: 6060 bytes --]

[-- Attachment #2: Type: text/plain, Size: 314 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

[-- Attachment #3: Type: text/plain, Size: 164 bytes --]

_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

           reply	other threads:[~2007-10-18  4:30 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <1192679922.5231.49.camel@localhost>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b7f7accd0710172130m5cbea8dfp87d58027c045d2aa@mail.gmail.com \
    --to=jagtapyb@gmail.com \
    --cc=bluez-users@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox