diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 6f65a6b..e77c8cf 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -379,7 +379,7 @@ PODS: - React-jsinspector (0.72.4) - React-logger (0.72.4): - glog - - react-native-esp-idf-provisioning (0.2.8): + - react-native-esp-idf-provisioning (0.2.9): - ESPProvision (~> 2.1) - RCT-Folly (= 2021.07.22.00) - React-Core @@ -724,7 +724,7 @@ SPEC CHECKSUMS: React-jsiexecutor: c7f826e40fa9cab5d37cab6130b1af237332b594 React-jsinspector: aaed4cf551c4a1c98092436518c2d267b13a673f React-logger: da1ebe05ae06eb6db4b162202faeafac4b435e77 - react-native-esp-idf-provisioning: 763a1894e71a0781ada5f7473dccc464496626ea + react-native-esp-idf-provisioning: e8c9c57bcd53b053e75914fc92ab6db5e3534992 react-native-safe-area-context: 2cd91d532de12acdb0a9cbc8d43ac72a8e4c897c React-NativeModulesApple: edb5ace14f73f4969df6e7b1f3e41bef0012740f React-perflogger: 496a1a3dc6737f964107cb3ddae7f9e265ddda58 @@ -753,4 +753,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 3527a5429736b6af9fc29f486fd0c0114b5cc5de -COCOAPODS: 1.13.0 +COCOAPODS: 1.14.2 diff --git a/package.json b/package.json index 3f49d94..348f218 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,6 @@ "engines": { "node": ">= 18.0.0" }, - "packageManager": "^yarn@1.22.15", "jest": { "preset": "react-native", "modulePathIgnorePatterns": [ diff --git a/src/NativeEspIdfProvisioning.ts b/src/NativeEspIdfProvisioning.ts index ad617ee..87a1e97 100644 --- a/src/NativeEspIdfProvisioning.ts +++ b/src/NativeEspIdfProvisioning.ts @@ -1,12 +1,48 @@ import type { TurboModule } from 'react-native'; import { TurboModuleRegistry } from 'react-native'; -import type { - ESPDeviceInterface, - ESPSecurity, - ESPStatusResponse, - ESPTransport, - ESPWifiList, -} from './types'; + +export enum ESPTransport { + ble = 'ble', + softap = 'softap', +} + +export enum ESPSecurity { + unsecure = 0, + secure = 1, + secure2 = 2, +} + +export enum ESPWifiAuthMode { + open = 0, + wep = 1, + wpa2Enterprise = 2, + wpa2Psk = 3, + wpaPsk = 4, + wpaWpa2Psk = 5, +} + +export interface ESPDeviceInterface { + name: string; + security: ESPSecurity; + transport: ESPTransport; + connected?: boolean; + username?: string; + versionInfo?: { [key: string]: any }[]; + capabilities?: string[]; + advertisementData?: { [key: string]: any }[]; +} + +export interface ESPWifiList { + ssid: string; + rssi: number; + auth: ESPWifiAuthMode; + bssid?: string; + channel?: number; +} + +export interface ESPStatusResponse { + status: string; +} export interface Spec extends TurboModule { searchESPDevices(