This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class NetworkHelpers | |
{ | |
public static async Task GetWebPageViaHttpClient(string uri) | |
{ | |
Console.WriteLine($"Requesting {uri} - {DateTime.Now}"); | |
using (var client = new HttpClient()) | |
{ | |
try | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using Meadow.Hardware; | |
namespace MeadowHelpers { | |
public static class IWiFiNetworkAdapterExtensions { | |
public static async Task<NetworkConnectionEventArgs> WaitForNetworkConnection(this IWiFiNetworkAdapter wifiAdapter, string? ssid = null, string? password = null, TimeSpan timeout = default(TimeSpan), CancellationToken cancellationToken = default(CancellationToken)) | |
{ | |
var tcs = new TaskCompletionSource<NetworkConnectionEventArgs>(); |
OlderNewer