Options
All
  • Public
  • Public/Protected
  • All
Menu

Class FrontPanelClient

Hierarchy

  • FrontPanelClient

Index

Constructors

constructor

Accessors

isConnected

  • get isConnected(): boolean
  • Returns true if the object is connected to the remote server.

    This value is initially false and becomes true once connect completes successfully.

    No other method of this class other than connect() can be used until this property becomes true.

    Returns boolean

Methods

connect

  • connect(): Promise<void>
  • Initiates connection to the server.

    This async function will satisfy its promise when connecting succeeds or break it when it fails.

    See isConnected.

    Returns Promise<void>

disconnect

  • disconnect(code?: undefined | number): Promise<void>
  • Initiates disconnection from the server.

    Parameters

    • Optional code: undefined | number

      Optional standard WebSocket close code explaining why the connection is being closed.

    Returns Promise<void>

login

  • login(username: string, password: string): Promise<string[]>
  • Initiates login to the server.

    As the provided credentials are transmitted unencrypted, connection itself must be secure, i.e. use TLS.

    After successfully logging in, call openDevice to start working with one of the devices from the list returned by the server.

    Parameters

    • username: string

      The username to use for authentication.

    • password: string

      The password to use for authentication.

    Returns Promise<string[]>

    List of available devices in case of successful login.

sendRequest

  • Sends a request with a set of arguments to the server and returns the reply received in response to the request.

    Parameters

    • req: RequestCode

      RequestCode specifying the type of request to be sent.

    • Rest ...args: any

      Set of arguments that correspond to the request.

    Returns Promise<IReply>

    Reply received from the server in response to the request.

waitForServer

  • waitForServer(): Promise<IReply>
  • Asynchronously waits for any unsolicited server reply.

    Unsolicited replies are sent by the server not in reply to a client request but due to an event on the server-side, e.g. new device connection.

    Returns Promise<IReply>

Generated using TypeDoc