Skip to content

Commit 6009e6a

Browse files
committed
Some comments
1 parent c7e2da0 commit 6009e6a

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

LighthouseV2PowerControl/Form1.Designer.cs

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

LighthouseV2PowerControl/Form1.cs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
using Windows.Devices.Bluetooth.GenericAttributeProfile;
99
using Windows.Devices.Enumeration;
1010
using Windows.Storage.Streams;
11-
using Windows.UI.Composition;
1211

1312
namespace LighthouseV2PowerControl
1413
{
@@ -27,7 +26,6 @@ public Form1(string[] args)
2726
InitializeComponent();
2827
btnStart.Click += (obj,e) => SendOnLighthouseAsync(activateByte);
2928
btnStop.Click += (obj,e) => SendOnLighthouseAsync(deactivateByte);
30-
btnStop.Enabled = btnStart.Enabled = false;
3129
if (args.Length > 0)
3230
{
3331
UseArgumentsAsync(args);
@@ -58,10 +56,15 @@ private async void UseArgumentsAsync(string[] args)
5856
Close();
5957
}
6058

59+
#region Body
60+
/// <summary>
61+
/// Call once at startup to get the characteristics of all base stations.
62+
/// </summary>
63+
/// <returns></returns>
6164
private async Task GetGattCharacteristicsAsync()
6265
{
6366
DeviceInformationCollection GatDevices = await DeviceInformation.FindAllAsync(GattDeviceService.GetDeviceSelectorFromUuid(service));
64-
for (int id = 0; id < GatDevices.Count; id++)
67+
for (int id = 0; id < GatDevices.Count; ++id)
6568
{
6669
if(!regex.IsMatch(GatDevices[id].Name)) continue;
6770

@@ -104,6 +107,11 @@ private async Task GetGattCharacteristicsAsync()
104107
}
105108
}
106109

110+
/// <summary>
111+
/// Called to write the value to the characteristic for all found base stations.
112+
/// </summary>
113+
/// <param name="byte4send"></param>
114+
/// <returns></returns>
107115
private async Task SendOnLighthouseAsync(byte byte4send)
108116
{
109117
for (int i = 0; i < listGattCharacteristics.Count; ++i)
@@ -121,6 +129,7 @@ private async Task SendOnLighthouseAsync(byte byte4send)
121129
}
122130
}
123131
}
132+
#endregion
124133

125134
private void Log(object msg)
126135
{

0 commit comments

Comments
 (0)