Skip to content

Commit

Permalink
Fix bugs, fix wifi atttempts being on wrong line
Browse files Browse the repository at this point in the history
  • Loading branch information
TekuSP committed Dec 26, 2023
1 parent 551945a commit bb1980c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 0 additions & 1 deletion OpenHaloApplication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ public class OpenHaloApplication : Application
public static Font SmallFont;
public static void Main()
{
Thread.Sleep(5000);
int backLightPin = 8;
int chipSelect = 10;
int dataCommand = 9;
Expand Down
8 changes: 7 additions & 1 deletion Windows/ConnectingWIFI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,20 @@ public ConnectingWIFI(OpenHaloApplication application)
wifiText.ForeColor = System.Drawing.Color.White;
stackPanel.Children.Add(wifiText);

Text atttemptText = new Text(OpenHaloApplication.SmallFont, "");
atttemptText.VerticalAlignment = VerticalAlignment.Center;
atttemptText.HorizontalAlignment = HorizontalAlignment.Center;
atttemptText.ForeColor = System.Drawing.Color.White;
stackPanel.Children.Add(atttemptText);

Console.WriteLine("Wifi Connections init....");
Configs.Wifi pernament = null;
while (WifiNetworkHelper.Status != NetworkHelperStatus.NetworkIsReady)
{
foreach (var item in OpenHaloApplication.config.Wifis)
{
int tries = 5;
wifiText.Dispatcher.Invoke(TimeSpan.MaxValue, (args) => { wifiText.TextContent = item.SSID + "try " + (5 - tries); return null; }, null);
wifiText.Dispatcher.Invoke(TimeSpan.MaxValue, (args) => { wifiText.TextContent = item.SSID; atttemptText.TextContent = "Attempt: " + (tries - 5 + 1); return null; }, null);
pernament = item;
Console.WriteLine("Trying: " + item.SSID);
WifiNetworkHelper.ScanAndConnectDhcp(item.SSID, item.Password, System.Device.Wifi.WifiReconnectionKind.Manual);
Expand Down

0 comments on commit bb1980c

Please sign in to comment.