Re: [android-developers] Re: Problem getting Bluetooth RSSI (Signal Strength)

2010-03-11 Thread Nick Pelly
This only gives the RSSI value found during the device discovery process.

On Mon, Mar 8, 2010 at 10:50 AM, danj  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
>  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  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


[android-developers] Re: Problem getting Bluetooth RSSI (Signal Strength)

2010-03-09 Thread danj
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
 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  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


[android-developers] Re: Problem getting Bluetooth RSSI (Signal Strength)

2010-03-09 Thread danj
will the rssi value be the newest updated value? because from what
i've read, the value is from when the device was connected, not the
current state of the device. if that is not the case, awesome.

On Feb 10, 11:32 am, Fernando Miguélez Palomo
 wrote:
> It may not work because EXTRA_RSSI value is a short type instead of
> int. This works great for me:
>
> short rssi = intent.getShortExtra(BluetoothDevice.EXTRA_RSSI,
> Short.MIN_VALUE);
>
> Take into consideration that rssi values are usually negative (it
> could be dBm but I am not sure).
>
> On 28 ene, 20:47, Chris  wrote:
>
> > I'm trying to determine location via bluetooth beacons 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);
> >                 int rssi = 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


[android-developers] Re: Problem getting Bluetooth RSSI (Signal Strength)

2010-02-10 Thread Fernando Miguélez Palomo
It may not work because EXTRA_RSSI value is a short type instead of
int. This works great for me:

short rssi = intent.getShortExtra(BluetoothDevice.EXTRA_RSSI,
Short.MIN_VALUE);

Take into consideration that rssi values are usually negative (it
could be dBm but I am not sure).


On 28 ene, 20:47, Chris  wrote:
> I'm trying to determine location via bluetooth beacons 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);
>                 int rssi = 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