From: Marcel Holtmann <marcel@holtmann.org>
To: BlueZ users <bluez-users@lists.sourceforge.net>
Subject: Re: [Bluez-users] reading RSSI value with D-Bus Api
Date: Thu, 05 Apr 2007 11:28:42 +0200 [thread overview]
Message-ID: <1175765322.5815.594.camel@violet> (raw)
In-Reply-To: <80236d750704050226m1563a49dw74214b6e847c495e@mail.gmail.com>
Hi Emanuele,
> reading another post here, I saw Marcel hinted to use the inquiry from
> D-Bus API to sort the devices by their RSSI so I tried a simple test
>
> this is the part of code I'm using
> ...
>
> if (dbus_message_is_signal(msg, " org.bluez.Adapter",
> "RemoteDeviceFound")) {
> printf ("Remote Device Found Signal Received\n");
>
> while (dbus_message_iter_get_arg_type(&iter) !=
> DBUS_TYPE_INVALID) {
> switch (dbus_message_iter_get_arg_type(&item)) {
> case DBUS_TYPE_STRING: /* first pameter
> bdaddress */
> .....
>
> break;
> case DBUS_TYPE_UINT32: /* second parameter class
> of device */
> ........
> break;
>
> case DBUS_TYPE_INT16: /* rssi */
> dbus_message_iter_get_basic(&args, &rssi);
> printf("rssi: %d\n", rssi);
> break;
>
> ......
>
>
>
> Now the problem is: I can read the bdaddress and the device class
> good, but the RSSI values I get from variuous devices are negatives
> (the are in range -40 -90 usually). I read somewhere RSSI should range
> from 0 to 255 so maybe I'm doing something wrong ? api says the type
> RSSI is int16 not uint16 so I used a signed variable.
the RSSI value is a signed int8 actually (except that D-Bus doesn't
support this type). You might confuse this with the link quality value,
but the RSSI is always signed.
Regards
Marcel
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users
next prev parent reply other threads:[~2007-04-05 9:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-05 9:26 [Bluez-users] reading RSSI value with D-Bus Api Emanuele Novelli
2007-04-05 9:28 ` Marcel Holtmann [this message]
2007-04-05 9:36 ` Emanuele Novelli
2007-04-06 10:24 ` Mahtab Hossain
2007-04-06 10:24 ` Mahtab Hossain
2007-04-06 10:24 ` Mahtab Hossain
2007-04-06 10:45 ` Mahtab Hossain
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=1175765322.5815.594.camel@violet \
--to=marcel@holtmann.org \
--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