Pure C# Implementation of Various WiFi SmartConfig Protocols: AirKiss and ESPTouch
Sandwych.SmartConfig is a pure C# implementation of various WiFi SmartConfig protocols that build from scratch.
TD;LR: If you working on a Xamarin mobile app to deal with WiFi-capability IoT devices, you may need this library.
English | 简体中文
Install Sandwych.SmartConfig to your project by NuGet then you’re good to go.
var provider = new EspSmartConfigProvider();
var ctx = provider.CreateContext();
ctx.DeviceDiscoveredEvent += (s, e) => {
Console.WriteLine("Found device: IP={0} MAC={1}", e.Device.IPAddress, e.Device.MacAddress);
};
var scArgs = new SmartConfigArguments()
{
Ssid = "YourWiFiSSID",
Bssid = PhysicalAddress.Parse("10-10-10-10-10-10"),
Password = "YourWiFiPassword",
// Your local IP address of WiFi network. It's important for using multiple network interfaces
// See CliDemoApp for details.
LocalAddress = IPAddress.Parse("192.168.1.10")
};
// Do the SmartConfig job
using (var job = new SmartConfigJob(TimeSpan.FromSeconds(100))) // Set the timeout to 100 seconds
{
await job.ExecuteAsync(ctx, scArgs);
}
Or much simpler if you perfer the callback style:
await SmartConfigStarter.StartAsync<EspSmartConfigProvider>(args,
onDeviceDiscovered: (s, e) => Console.WriteLine("Found device: IP={0} MAC={1}", e.Device.IPAddress, e.Device.MacAddress));
APK Download: WIP
If this project is useful to you, you can buy me a beer:
Licensed under the MIT License. Copyright © Sandwych.SmartConfig Contributors.
See LICENSE.md for details.