ESPProvision
class ESPProvision
Provision class which exposes the main API for provisioning the device with Wifi credentials.
-
Undocumented
Declaration
Swift
var wifiConnectedIp4Addr: String?
-
Undocumented
Declaration
Swift
public static let CONFIG_TRANSPORT_KEY: String
-
Undocumented
Declaration
Swift
public static let CONFIG_SECURITY_KEY: String
-
Undocumented
Declaration
Swift
public static let CONFIG_PROOF_OF_POSSESSION_KEY: String
-
Undocumented
Declaration
Swift
public static let CONFIG_BASE_URL_KEY: String
-
Undocumented
Declaration
Swift
public static let CONFIG_WIFI_AP_KEY: String
-
Undocumented
Declaration
Swift
public static let CONFIG_TRANSPORT_WIFI: String
-
Undocumented
Declaration
Swift
public static let CONFIG_TRANSPORT_BLE: String
-
Undocumented
Declaration
Swift
public static let CONFIG_SECURITY_SECURITY0: String
-
Undocumented
Declaration
Swift
public static let CONFIG_SECURITY_SECURITY1: String
-
Create Provision object with a Session object Here the Provision class will require a session which has been successfully initialised by calling Session.initialize
Declaration
Swift
init(session: ESPSession)
Parameters
session
Initialised session object
-
Send Configuration information relating to the Home Wifi network which the device should use for Internet access
Declaration
Swift
func configureWifi(ssid: String, passphrase: String, completionHandler: @escaping (Espressif_Status, Error?) -> Swift.Void)
Parameters
ssid
ssid of the home network
passphrase
passphrase
completionHandler
handler called when config data is sent
-
Apply all current configurations on the device. A typical flow will be Initialize session -> Set config (1 or more times) -> Apply config This API call will also start a poll for getting Wifi connection status from the device
Declaration
Swift
func applyConfigurations(completionHandler: @escaping (Espressif_Status, Error?) -> Void, wifiStatusUpdatedHandler: @escaping (Espressif_WifiStationState, Espressif_WifiConnectFailedReason, Error?) -> Void)
Parameters
completionHandler
handler to be called when apply config message is sent
wifiStatusUpdatedHandler
handler to be called when wifi status is updated on the device