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 | 简体中文
- A .NET Standard class library, works on both Xamarin and desktop.
- No third-party library referenced.
- Supported protocols: WeChat's AirKiss and Espressif's ESPTouch.
- Clean architecture, easy to learn and add your own protocol.
- IoC container friendly.
- Microsoft Visual Studio 2019
- DocFX for API documents generation (Optional)
- .NET Standard 2.0+
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:
- Li "oldrev" Wei - Init work and the main maintainer - oldrev
Licensed under the MIT License. Copyright © Sandwych.SmartConfig Contributors.
See LICENSE.md for details.
- Espressif EsptouchForAndroid: https://github.com/EspressifApp/EsptouchForAndroid