This only gives the RSSI value found during the device discovery process.

On Mon, Mar 8, 2010 at 10:50 AM, danj <yoyo...@gmail.com> wrote:
> does this give the most recent rssi value or the value from when the
> device was connected? does it update the rssi value whenever we call
> it?
>
> On Feb 10, 11:32 am, Fernando Miguélez Palomo
> <fernando.migue...@gmail.com> wrote:
>> It may not work because EXTRA_RSSI value is a short type instead of
>> int. This works great for me:
>>
>> shortrssi= intent.getShortExtra(BluetoothDevice.EXTRA_RSSI,
>> Short.MIN_VALUE);
>>
>> Take into consideration thatrssivalues are usually negative (it
>> could be dBm but I am not sure).
>>
>> On 28 ene, 20:47, Chris <crystalredve...@gmail.com> wrote:
>>
>> > I'm trying to determine location viabluetoothbeacons and while I can
>> > discover and find all of the devices around me, when I try to grab the
>> > EXTRA_RSSI that's supposed to come through it doesn't work.  Here's
>> > the code I'm using and I get a 0 every time.
>>
>> > private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
>> >         @Override
>> >         public void onReceive(Context context, Intent intent) {
>> >                 Toast.makeText(ScannerActivity.this, "In 
>> > BroadcastReceiver", 3);
>> >             String action = intent.getAction();
>> >             // When discovery finds a device
>> >             if (BluetoothDevice.ACTION_FOUND.equals(action)) {
>> >                 // Get the BluetoothDevice object from the Intent
>> >                 BluetoothDevice device = intent.getParcelableExtra
>> > (BluetoothDevice.EXTRA_DEVICE);
>> >                 intrssi= intent.getIntExtra
>> > (BluetoothDevice.EXTRA_RSSI, 0);
>>
>> >                 // Add the name and address to an array adapter to
>> > show in a ListView
>> >                 if (device.getBondState() !=
>> > BluetoothDevice.BOND_BONDED) {
>> >                     //do something
>> >                 }
>> >             }
>> >        }
>>
>> > }
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to