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)

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


Attachments

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.

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