0.3.12 • Published 2 years ago

lorenzovecchi-react-native-esptouch-2-ios-fix v0.3.12

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

lorenzovecchi-react-native-esptouch-2-ios-fix

I forked this repo to edit this package react-native-esptouch-2

created by https://www.npmjs.com/package/@lorenzovecchi/react-native-esptouch-2/v/0.1.4

and make it work on iOS devices

Used to configure ESP devices to connect to target AP

  • Support both Android and iOS
  • iOS code is untested

This is a Unofficial project. The official demo is below:

EsptouchForAndroid

EsptouchForIOS

Installation

Install the module from npm

npm i lorenzovecchi-react-native-esptouch-2-ios-fix@0.1.3

Android

Add permissions in AndroidManifest.xml

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />

iOS

cd ios && pod install

Usage

import * as ESPTouch2 from "react-native-esptouch-2";

/**
* Start the configuration broadcasting the informations to the device
* @param {string} ssid
*   AP SSID
* @param {string} bssid
*   AP BSSID
* @param {string} password
*   AP Password (null if open network)
* @param {string} customData
*   Additional data to send (nullable)
* @param {string} aesKey
*   Encrypt the data to send (if not null, it must be 16 byte) (nullable)
*
* @resolve {object} res
*   Object containing the successfully configured device address and bssid
* @reject {Exception} err
*   Error exception
*/
ESPTouch2.start(ssid, bssid, password, customData, aesKey).then(res => {
    //On success
    console.log(res.address, res.bssid);
}).catch(err => {
    //On error
    console.log(err);
});

/**
* Stop the configuration broadcasting
*/
ESPTouch2.stop();

/**
* Function called on broadcasting start
*/
ESPTouch2.onStart(() => {console.log('Starting broadcast')};

/**
* Function called on broadcasting stop
*/
ESPTouch2.onStop(() => {console.log('Stopping broadcast')};

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

0.3.12

2 years ago

0.3.11

2 years ago

0.3.10

2 years ago

0.3.9

2 years ago

0.3.8

2 years ago

0.3.7

2 years ago

0.3.6

2 years ago

0.3.5

2 years ago

0.3.4

2 years ago

0.3.3

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.9

2 years ago

0.2.8

2 years ago

0.2.7

2 years ago

0.2.6

2 years ago

0.2.5

2 years ago

0.2.4

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.9

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago