0.2.0 • Published 8 months ago

-lorenzovecchi-react-native-esptouch-2-forked v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

react-native-esptouch-2

I forked this repo to edit package react-native-esptouch-2 created by https://www.npmjs.com/package/@lorenzovecchi/react-native-esptouch-2/v/0.1.4

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 install @lorenzovecchi/react-native-esptouch-2

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.2.0

8 months ago

0.1.37

10 months ago

0.1.36

10 months ago

0.1.35

10 months ago

0.1.34

10 months ago

0.1.33

10 months ago

0.1.32

10 months ago

0.1.31

10 months ago

0.1.30

10 months ago

0.1.29

10 months ago

0.1.28

10 months ago

0.1.27

10 months ago

0.1.26

10 months ago

0.1.25

10 months ago

0.1.24

10 months ago

0.1.23

10 months ago

0.1.22

10 months ago

0.1.21

10 months ago

0.1.20

10 months ago

0.1.19

10 months ago

0.1.18

10 months ago

0.1.17

10 months ago

0.1.16

10 months ago

0.1.15

10 months ago

0.1.14

10 months ago

0.1.13

10 months ago

0.1.12

10 months ago

0.1.11

10 months ago

0.1.10

10 months ago

0.1.9

10 months ago

0.1.8

10 months ago

0.1.7

10 months ago

0.1.6

10 months ago

0.1.5

10 months ago

0.1.4

10 months ago