ESPSession

class ESPSession

The ESPSession class contains information related with session configuration. Provides method to establish session with a device for communication.

  • Get current transport layer of session.

    Declaration

    Swift

    var transportLayer: ESPCommunicable { get }
  • Get current security layer of session.

    Declaration

    Swift

    var securityLayer: ESPCodeable { get }
  • Flag which indicates if the session has been successfully established.

    Declaration

    Swift

    var isEstablished: Bool { get }
  • Create a session object with the given Transport and Security implementations. Session object is used for establishing a secure connection with the device before provisioning.

    Declaration

    Swift

    init(transport: ESPCommunicable, security: ESPCodeable)

    Parameters

    transport

    Mode of transport.

    security

    Mode of secure data transmission.

  • Initialize the session handshake to establish a secure session with the device.

    Declaration

    Swift

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

    Parameters

    response

    Response received from the device.

    sessionPath

    Path for sending session related data.

    completionHandler

    Handler called when the session establishment completes.