Bug 51293 - ScanResult.txPowerLevel should return int
Summary: ScanResult.txPowerLevel should return int
Alias: None
Product: Android
Classification: Xamarin
Component: General (show other bugs)
Version: unspecified
Hardware: PC Windows
: Normal normal
Target Milestone: 15.4
Assignee: Jonathan Pryor
Depends on:
Reported: 2017-01-09 01:55 UTC by Stuart Schechter
Modified: 2017-10-05 17:00 UTC (History)
4 users (show)

See Also:
Is this bug a regression?: ---
Last known good build:


Description Stuart Schechter 2017-01-09 01:55:10 UTC
The Android ScanRecord class supports a method getTxPowerLevel(), which returns an int.  This can be used to calculate path loss.

   See: https://developer.android.com/reference/android/bluetooth/le/ScanRecord.html#getTxPowerLevel()

The equivalent Xamarin ScanRecord class contains only the txPowerLevel property, which returns an AdvertiseTx record.  It should either provide a property that returns an int or should provide the missing getTxPowerLevel method().  Otherwise, a developer using Xamarin will not have access to the same data that a developer using Java will have access to.
Comment 1 Atsushi Eno 2017-06-19 17:34:08 UTC
This should be indeed corrected to be an int.
Comment 2 Peter Collins 2017-10-05 16:57:42 UTC
The return type has changed to int in Android.Bluetooth.LE.ScanRecord.TxPowerLevel:

> public AdvertiseTx TxPowerLevel {
> [Register ("getTxPowerLevel", "()I", "GetGetTxPowerLevelHandler")]
>	get {
>		return (AdvertiseTx)ScanRecord._members.InstanceMethods.InvokeAbstractInt32Method >("getTxPowerLevel.()I", this, null);
>	}

> public int TxPowerLevel {
>	[Register ("getTxPowerLevel", "()I", "GetGetTxPowerLevelHandler")]
>	get {
>		return ScanRecord._members.InstanceMethods.InvokeAbstractInt32Method ("getTxPowerLevel.()I", this, null);
>	}
Comment 3 Peter Collins 2017-10-05 17:00:14 UTC
Verified against XA

Note You need to log in before you can comment on or make changes to this bug.