Bug 51293 - ScanResult.txPowerLevel should return int
Summary: ScanResult.txPowerLevel should return int
Status: VERIFIED FIXED
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
URL:
Depends on:
Blocks:
 
Reported: 2017-01-09 01:55 UTC by Stuart Schechter
Modified: 2017-10-05 17:00 UTC (History)
4 users (show)

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

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
VERIFIED FIXED

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:

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

D15-4:
> 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 8.0.0.33.