react-native-esp-idf
TypeScript icon, indicating that this package has built-in type declarations

0.4.0 • Public • Published

react-native-esp-idf

ESP IDF Provisioning

Installation

npm install react-native-esp-idf

Usage

import EspIdfRn, { useProvisioning } from 'react-native-esp-idf';


// ...

const devicePrefix = 'PROV_'
	const message: MessageInfo = {
		scanBle: 'Searching device...',
		waitingCertificate: 'Waiting for certificates...',
		scanWifi: 'Searching available Wi-Fi...',
		connectDevice: 'Connecting your device...',
		sendingWifiCredential: 'Sending Wi-Fi credentials',
		confirmWifiConnection: 'Confirming Wi-Fi connection',
		enableBluetooth: 'Please enable the Bluetooth to start scan device.',
		enableLocation:
			'Please grant location permission to start scan device.',
		scanBleFailed: 'Scan device failed, please try again.',
		connectFailed: 'Connect to device failed, please try again.',
		disconnected: 'device disconnected, please try again.',
		initSessionError: 'Reboot your device and retry.',
		applyError: 'Reset your device and retry.',
		completed: 'Device has been successfully provisioned!',
	}
	const {
		bleDevices,
		wifiAPs,
		loading,
		status,
		currentStep,
		currentWifi,
		currentDevice,
		results,
		setCurrentStep,
		configWifi,
		connectDevice,
		doProvisioning,
		sendCertificate,
	} = useProvisioning({ devicePrefix, message, pop: 'abcd1234' })

Contributing

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

License

MIT

Package Sidebar

Install

npm i react-native-esp-idf

Weekly Downloads

3

Version

0.4.0

License

MIT

Unpacked Size

745 kB

Total Files

106

Last publish

Collaborators

  • dsonet