Skip to content

Commit 7f707bc

Browse files
Namrata Rajiv Kediarachitb777
authored andcommitted
IoT APIs (#172)
Adding some more IoT Core specific apis.
1 parent 13ae48c commit 7f707bc

27 files changed

+1932
-36
lines changed

Samples/SampleWdpClient.UniversalWindows/MainPage.xaml.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ private void ClearOutput()
5252
{
5353
bool clearOutput = this.clearOutput.IsChecked.HasValue ? this.clearOutput.IsChecked.Value : false;
5454
if (clearOutput)
55-
{
55+
{
5656
this.commandOutput.Text = string.Empty;
5757
}
5858
}
@@ -86,8 +86,8 @@ private void ConnectToDevice_Click(object sender, RoutedEventArgs e)
8686
this.MarshalUpdateCommandOutput(sb.ToString());
8787
portal.ConnectionStatus += (portal, connectArgs) =>
8888
{
89-
if (connectArgs.Status == DeviceConnectionStatus.Connected)
90-
{
89+
if (connectArgs.Status == DeviceConnectionStatus.Connected)
90+
{
9191
sb.Append("Connected to: ");
9292
sb.AppendLine(portal.Address);
9393
sb.Append("OS version: ");
@@ -100,7 +100,7 @@ private void ConnectToDevice_Click(object sender, RoutedEventArgs e)
100100
portal.Platform.ToString()));
101101
}
102102
else if (connectArgs.Status == DeviceConnectionStatus.Failed)
103-
{
103+
{
104104
sb.AppendLine("Failed to connect to the device.");
105105
sb.AppendLine(connectArgs.Message);
106106
}
@@ -186,7 +186,7 @@ private void GetIPConfig_Click(object sender, RoutedEventArgs e)
186186
this.EnableDeviceControls(false);
187187

188188
StringBuilder sb = new StringBuilder();
189-
Task getTask = new Task(
189+
Task getTask = new Task(
190190
async () =>
191191
{
192192
sb.Append(this.MarshalGetCommandOutput());
@@ -212,7 +212,7 @@ private void GetIPConfig_Click(object sender, RoutedEventArgs e)
212212
sb.AppendLine(adapterInfo.Dhcp.Address.Address);
213213
}
214214
}
215-
catch(Exception ex)
215+
catch (Exception ex)
216216
{
217217
sb.AppendLine("Failed to get IP config info.");
218218
sb.AppendLine(ex.GetType().ToString() + " - " + ex.Message);
@@ -279,7 +279,7 @@ private void GetWifiInfo_Click(object sender, RoutedEventArgs e)
279279
}
280280
};
281281
}
282-
catch(Exception ex)
282+
catch (Exception ex)
283283
{
284284
sb.AppendLine("Failed to get WiFi info.");
285285
sb.AppendLine(ex.GetType().ToString() + " - " + ex.Message);
@@ -301,7 +301,7 @@ private void GetWifiInfo_Click(object sender, RoutedEventArgs e)
301301
/// Executes the EnabledConnectionControls method on the UI thread.
302302
/// </summary>
303303
/// <param name="enable">True to enable the controls, false to disable them.</param>
304-
private void MarshalEnableConnectionControls(bool enable)
304+
private void MarshalEnableConnectionControls(bool enable)
305305
{
306306
Task t = this.Dispatcher.RunAsync(
307307
CoreDispatcherPriority.Normal,
@@ -316,7 +316,7 @@ private void MarshalEnableConnectionControls(bool enable)
316316
/// Executes the EnabledDeviceControls method on the UI thread.
317317
/// </summary>
318318
/// <param name="enable">True to enable the controls, false to disable them.</param>
319-
private void MarshalEnableDeviceControls(bool enable)
319+
private void MarshalEnableDeviceControls(bool enable)
320320
{
321321
Task t = this.Dispatcher.RunAsync(
322322
CoreDispatcherPriority.Normal,
@@ -396,7 +396,7 @@ private void RebootDevice_Click(object sender, RoutedEventArgs e)
396396
{
397397
await portal.Reboot();
398398
}
399-
catch(Exception ex)
399+
catch (Exception ex)
400400
{
401401
sb.AppendLine("Failed to reboot the device.");
402402
sb.AppendLine(ex.GetType().ToString() + " - " + ex.Message);
@@ -440,7 +440,7 @@ private void ShutdownDevice_Click(object sender, RoutedEventArgs e)
440440
{
441441
await portal.Shutdown();
442442
}
443-
catch(Exception ex)
443+
catch (Exception ex)
444444
{
445445
sb.AppendLine("Failed to shut down the device.");
446446
sb.AppendLine(ex.GetType().ToString() + " - " + ex.Message);
@@ -509,4 +509,4 @@ private async Task LoadCertificate()
509509
}
510510
}
511511
}
512-
}
512+
}

WindowsDevicePortalWrapper/MockDataGenerator/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class Program
3030
/// Endpoints for REST calls to populate. Feel free to override this list (especially locally) to
3131
/// facilitate generating a large number of mock files all simultaneously.
3232
/// </summary>
33-
private static readonly Endpoint[] Endpoints =
33+
private static readonly Endpoint[] Endpoints =
3434
{
3535
new Endpoint(HttpMethods.Get, DevicePortal.DeviceFamilyApi),
3636
new Endpoint(HttpMethods.Get, DevicePortal.MachineNameApi),
@@ -294,4 +294,4 @@ public override string ToString()
294294
}
295295
}
296296
}
297-
}
297+
}

0 commit comments

Comments
 (0)