Class: AWSDevice

AWSDevice

Provides methods and properties for accessing objects described by an ARCX WebSocket device.


Members


<readonly> connected :bool

Returns true when successfully connected.

Type:
  • bool
Since:
  • 0.4 (WAT 2.3)
See:

host :string

The hostname (e.g. IP address) of the ECG device that this object will connect to. This needs to be set before attempting to open. This property is typically set automatically when calling createAWS.

Type:
  • string
Since:
  • 0.4 (WAT 2.3)
See:

<readonly> model :string

Returns the model of the target device. The device must be successfully connected once in order to determine the model.

Type:
  • string
Since:
  • 0.4 (WAT 2.3)
See:

monitorMode :bool

When enabled, events will be generated when outputs (Digital Outputs, LEDs, and stacklights) are changed. This could be used to show the active state of the outputs.

Type:
  • bool
Since:
  • 0.4 (WAT 2.3)
See:

objects :Object

Accesses objects (instances of classes) that are discovered on the AWS device.

Each object has an extra property called "enabled". This property must be set to true before the object can be used. This is to prevent unexpected collisions if multiple objects refer to the same hardware on a device. It also reduces network traffic that could be generated for unused objects. The default state for "enabled" is false.

Some properties of the objects (e.g. Stacklight.Color) may differ slightly from the documentation, depending on what is discovered on the target.

Type:
  • Object
Properties:
Name Type Description
stacklights Array.<miob.Stacklight>

list of stacklights discovered on the target

leds Array.<miob.LED>

list of LEDs discovered on the target

outputBanks Array.<miob.Outputs>

list of output banks discovered on the target

digOutputs Array.<miob.Output>

list of digital outputs discovered on the target

inputBanks Array.<miob.Inputs>

list of input banks discovered on the target

digInputs Array.<miob.Input>

list of digital inputs discovered on the target

hids Array.<miob.HID>

list of HIDs discovered on the target

Since:
  • 0.4 (WAT 2.3)

ready :bool

Indicates if the object tree has been read from the remote device. After the tree has been read, the hardware objects are ready to use.

Type:
  • bool
Since:
  • 0.4 (WAT 2.3)
See:

<readonly> serialNumber :string

Returns the serial number of the target device. The device must be successfully connected once in order to determine the serial number.

Type:
  • string
Since:
  • 0.4 (WAT 2.3)
See:

<readonly> watchdogEnabled :bool

Controls whether the watchdog on the target device is enabled. If the watchdog is enabled, the target device will reboot if it is disconnected for more than 5 seconds.

This can be a good method for indicating connection failures at the target device. For example, the target device could be set to initially turn ON an LED and FLASH another (or the same one). When there is a connection failure, the target would reset due to the watchdog which will cause the LED set to ON to turn on. Once an Ethernet link is established, the FLASH LEDs would then start to flash to indicate it is ready for a connection.

Some devices may not allow the watchdog to be disabled once it has been enabled.

Type:
  • bool
Since:
  • 0.4 (WAT 2.3)
See:

Methods


close()

Close the connection to the AWS device.

Since:
  • 0.4 (WAT 2.3)

open()

Attempts to open a connection to the AWS device.

Since:
  • 0.4 (WAT 2.3)
Returns:

Indicates if the open was successfully started.

Type
bool

reset()

Resets properties to the default value. Useful for resetting to a known state when re-configuring.

Since:
  • 0.4 (WAT 2.3)

Events


closed

Emitted when the connection to the device has been closed.

Since:
  • 0.4 (WAT 2.3)

connectedChanged

Emitted when the connection to the device changes.

Since:
  • 0.4 (WAT 2.3)

error

Emitted when the connection to the device detects an error condition.

Parameters:
Name Type Description
err string

Description of the error

Since:
  • 0.4 (WAT 2.3)

hostChanged

Emitted when host changes.

Since:
  • 0.6 (WAT 2.4)

modelChanged

Emitted when model changes.

Since:
  • 0.6 (WAT 2.4)

monitorModeChanged

Emitted when monitorMode changes.

Since:
  • 0.6 (WAT 2.4)

opened

Emitted when a connection to the device has been established.

Since:
  • 0.4 (WAT 2.3)

readyChanged

Emitted after the remote device has been fully described and the objects are ready to use.

After connecting to the device for the first time, the objects that it supports must be queried. Until this has happened, there will be no objects available for interacting with the hardware. After this event, the object will be available. This event will only fire after the initial connect. If a device becomes disconnected and the reconnects later, this event will not fire.

Since:
  • 0.4 (WAT 2.3)

serialNumberChanged

Emitted when serialNumber changes.

Since:
  • 0.6 (WAT 2.4)

watchdogEnabledChanged

Emitted when watchdogEnabled changes.

Since:
  • 0.6 (WAT 2.4)