Skip to content
This repository was archived by the owner on May 15, 2024. It is now read-only.

GH-480: Implement Wifi signal strength #616

Merged
merged 25 commits into from
Dec 11, 2018

Conversation

Mrnikbobjeff
Copy link
Contributor

Description of Change

Implements #480

API Changes

Added:

  • SignalStrength Connectivity.WifiSignalStrength{ get; }

public enum SignalStrength
{
Unknown,
None,
Weak,
Fair,
Strong
}

PR Checklist

  • [] Has tests (if omitted, state reason in description)
  • Has samples (if omitted, state reason in description)
  • Rebased on top of master at time of PR
  • Changes adhere to coding standard
  • Updated documentation (see walkthrough)

@Mrnikbobjeff
Copy link
Contributor Author

Samples are available, I will further test this code tomorrow. It is still not quite complete and thus should not yet be reviewed.

@ghost

This comment has been minimized.

static SignalStrength PlatformSignalStrength()
{
var wifiManager = Platform.WifiManager;
if (wifiManager is null)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is redundant as you do wifiManager?. below so you can remove this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acutally I would rather remove the ?. as this check is necessary to return unknown value if we do not have a wifi Manager instance available if that were acceptable

@ghost

This comment has been minimized.

Copy link
Contributor

@mattleibow mattleibow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a really nice PR, and I think it is quite clean. I do have questions about the signal values (see my comments). Other that the translation of platform values to the shared values, I think we have a nice one here.

@mattleibow
Copy link
Contributor

I see you said that you are still working on this PR and should not be reviewed 😉 But we are all eager beavers here 😁

I hope our comments are helpful. Thanks for taking the time to work on this!

@ghost

This comment has been minimized.

@Mrnikbobjeff
Copy link
Contributor Author

Mrnikbobjeff commented Nov 12, 2018

@mattleibow Thank you for taking time to already look at this :) Yes, they were very helpful thank you :)

@Mrnikbobjeff Mrnikbobjeff changed the title [WIP] Implement Wifi signal strength Implement Wifi signal strength Nov 19, 2018
@Mrnikbobjeff
Copy link
Contributor Author

I got around to testing android and uwp where this works just fine for me. Since I recently switched jobs I did not set up a developer account for iOS yet. If anyone would like to verify that it works that would be great. Otherwise I would love further discussion of the unresolved comments :)

@ghost
Copy link

ghost commented Nov 20, 2018

@ghost
Copy link

ghost commented Nov 20, 2018

@mattleibow
Copy link
Contributor

I see @Redth discovered the suggestions feature ;)

Co-Authored-By: Mrnikbobjeff <schillinik@yahoo.de>
@ghost
Copy link

ghost commented Nov 29, 2018

❌ Validation status: errors

File Status Preview URL Details
❌Error Details

For more details, please refer to the build report.

Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.

@ghost
Copy link

ghost commented Nov 29, 2018

❌ Validation status: errors

File Status Preview URL Details
❌Error Details

For more details, please refer to the build report.

Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.

Co-Authored-By: Mrnikbobjeff <schillinik@yahoo.de>
@ghost
Copy link

ghost commented Nov 29, 2018

❌ Validation status: errors

File Status Preview URL Details
❌Error Details

For more details, please refer to the build report.

Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.

@ghost
Copy link

ghost commented Nov 29, 2018

❌ Validation status: errors

File Status Preview URL Details
❌Error Details

For more details, please refer to the build report.

Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.

@ghost
Copy link

ghost commented Nov 29, 2018

Copy link
Contributor

@mattleibow mattleibow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks good!

@@ -13,6 +14,26 @@ static void StartListeners()
listener.ReachabilityChanged += OnConnectivityChanged;
}

static SignalStrength PlatformSignalStrength()
{
var doubleSignalStrength = new NEHotspotNetwork().SignalStrength;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This allocation. I think it should be OK, but maybe wrap it in a using to dispose sooner?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I was worried about this as well. I was unable to decide whether to take the permanent memory hit and just lazy initialize a static NEHotspotNetwork which just sticks around forever once SignalStrength is used or allocate a new object on every call. This probably depends on the usage scenario as well, as if this were called in a rather tight loop or rather frequently would just add unnecessary memory pressure. If we decide to not cache the value we should definitely dispose the object ASAP to let i be destroyed on iOS.

@ghost
Copy link

ghost commented Nov 29, 2018

@ghost
Copy link

ghost commented Dec 10, 2018

OPS Build status updates of commit 20a58f8:

❌ Validation status: errors

File Status Preview URL Details
❌Error Details

  • [Error] An exception occurred during the build process. Please check the raw log and retry building your content again. If the issue persists, please open a ticket in http://SiteHelp and include the URL of publishing report as well as below information: One or more errors occurred..

For more details, please refer to the build report.

Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.

@Redth Redth changed the base branch from master to dev/1.1.0 December 10, 2018 18:29
@jamesmontemagno jamesmontemagno changed the base branch from dev/1.1.0 to dev/1.1.0-wifi-sp December 11, 2018 23:25
@jamesmontemagno jamesmontemagno merged commit 026b9b9 into xamarin:dev/1.1.0-wifi-sp Dec 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants