ESPCommunicable

protocol ESPCommunicable

Transport interface which abstracts the transport layer to send messages to the ESPDevice.

  • Instance of ‘ESPUtility’ class.

    Declaration

    Swift

    var utility: ESPUtility { get }
  • Send data related to session establishment.

    Declaration

    Swift

    func SendSessionData(data: Data, sessionPath: String?, completionHandler: @escaping (Data?, Error?) -> Swift.Void)

    Parameters

    data

    Data to be sent.

    sessionPath

    Path for sending session related data.

    completionHandler

    Handler called when data is successfully sent and response is received.

  • Send data related to device configurations.

    Declaration

    Swift

    func SendConfigData(path: String, data: Data, completionHandler: @escaping (Data?, Error?) -> Swift.Void)

    Parameters

    path

    Endpoint of base url.

    data

    Config data to be sent.

    completionHandler

    Handler called when data is successfully sent and response is received.

  • Check device configuration status.

    Declaration

    Swift

    func isDeviceConfigured() -> Bool

    Return Value

    Yes if device is configured.

  • Disconnect ESPDevice.

    Declaration

    Swift

    func disconnect()