Giter VIP home page Giter VIP logo

esptouchbinding-xamarin-ios-droid's Introduction

EspTouch Binding Library for Xamarin iOS and Android

This is a porting of EsptouchForIOS and EsptouchForAndroid

INSTALL

Please use NuGet to installa the library in your Xamarin.iOS, Xamarin.Droid or Xamarin.Forms project. This Library does not support Windows Phone yet.

Install-Package EspTouchSmartConfigXamarin

USE

XAMARIN FORMS

You need to use Dependency Service to get a Platform specific implementation of the SmartConfigTask

PCL Project

Define the Interface

public interface ISmartConfigHelper
{
	ISmartConfigTask CreatePlatformTask();
}

IOS Project

using System;
using EspTouchBindingExample_Forms;
using EspTouchMultiPlatformLIbrary;
using Xamarin.Forms;

[assembly: Dependency(typeof(EspTouchBindingExample_Forms.iOS.SmartConfig_iOS))]
namespace EspTouchBindingExample_Forms.iOS
{
	public class SmartConfig_iOS : ISmartConfigHelper
	{
		public SmartConfig_iOS()
		{
		}

		public ISmartConfigTask CreatePlatformTask()
		{
			return new SmartConfigTask_iOS();
		}
	}
}

ANDROID Project

using System;
using EspTouchMultiPlatformLIbrary;
using Xamarin.Forms;

[assembly: Dependency(typeof(EspTouchBindingExample_Forms.Droid.SmartConfig_Droid))]
namespace EspTouchBindingExample_Forms.Droid
{
	public class SmartConfig_Droid:ISmartConfigHelper
	{
		public SmartConfig_Droid()
		{
		}

		public ISmartConfigTask CreatePlatformTask()
		{
			return new SmartConfigTask_Droid();
		}
	}
}

Instantiate the ISmartConfigTask and use it

You can now instantiate the class in your code (code behind or viewmodel)

String Ssid = "network ssid";
String Bssid = "network bssid";
String Passphrase = "network passphrase"

ISmartConfigTask smartconfig;
smartconfig = DependencyService.Get<ISmartConfigHelper>().CreatePlatformTask();
smartconfig.SetSmartConfigTask(Ssid, Bssid, Passphrase);
await Task.Run(() =>
{
	var result = smartconfig.executeForResult();
	//handle your result
});

USING IN SINGLE PROJECTS

XAMARIN IOS

ESPTouchTask ett = new ESPTouchTask("<SSID>", "<BSSID>", "<PASSPHRASE>");
var result = ett.ExecuteForResult;

XAMARIN DROID

EsptouchTask mEsptouchTask = new EsptouchTask("<SSID>", "<BSSID>", "<PASSPHRASE>", true, Application.Context);
IEsptouchResult result = mEsptouchTask.ExecuteForResult();

esptouchbinding-xamarin-ios-droid's People

Contributors

lucafabbri avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.