Skip to content

Commit

Permalink
fix(#8): add rssi value in returned wifi list
Browse files Browse the repository at this point in the history
  • Loading branch information
mateogianolio committed Oct 30, 2023
1 parent df0f962 commit 6f1c23c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,8 @@ class EspIdfProvisioningModule internal constructor(context: ReactApplicationCon
wifiList?.forEach { item ->
val resultMap = Arguments.createMap()
resultMap.putString("ssid", item.wifiName)
resultMap.putInt("rssi", item.rssi)
resultMap.putInt("auth", item.security)

resultArray.pushMap(resultMap)
}

Expand Down
3 changes: 2 additions & 1 deletion ios/EspIdfProvisioning.swift
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ class EspIdfProvisioning: NSObject {

resolve(wifiList!.map {[
"ssid": $0.ssid,
"bssid": $0.bssid,
"bssid": $0.bssid.toHexString(),
"rssi": $0.rssi,
"auth": $0.auth.rawValue,
"channel": $0.channel
]})
Expand Down
5 changes: 3 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ export interface ESPDeviceInterface {

export interface ESPWifiList {
ssid: string;
bssid: string;
rssi: number;
auth: ESPWifiAuthMode;
channel: number;
bssid?: string;
channel?: number;
}

export interface ESPStatusResponse {
Expand Down

0 comments on commit 6f1c23c

Please sign in to comment.