Class: HLAIMDevice

HLAIMDevice

Provides properties and methods for accessing a device implementing the hlaim protocol.

Members


<readonly> connected :bool

Gets whether a device has been successfully connected to or is in the process of being connected to.

Type:
  • bool
Since:
  • 1.0 (WAT 1.2)

Methods


close()

Closes the connection to the device.

Since:
  • 1.0 (WAT 1.2)

open()

Opens the serial port and starts connecting to a device.

Since:
  • 1.0 (WAT 1.2)
Returns:

True if the connection is started. Does not indicate if the device has actually been connected to.

Type
bool

sendStart(vsn, vin)

Sends a command to the remote device to begin a headlamp aim test.

Parameters:
Name Type Description
vsn string

The VSN number of the program to start.

vin string

The VIN of the vehicle being tested.

Since:
  • 1.0 (WAT 1.2)
Returns:

Indicates if the message was successfully sent. Does not indicate if it was successfully received. The response will be emitted later using one of the events.

Type
bool

Events


closed

Emitted whenever the serial port is closed. It can be closed as a result of an error or explicitly by the application.

Since:
  • 1.0 (WAT 1.2)

commError

Emitted whenever a message has not been ACK'd after all retry attempts.

Since:
  • 1.0 (WAT 1.2)

gotAck

Emitted when a message is ACK'd by the remote device.

Since:
  • 1.0 (WAT 1.2)

gotBusy

Emitted when a messages has been rejected by the remote device because the remote device is busy.

Since:
  • 1.0 (WAT 1.2)

gotInvalidSelection

Emitted when a messages has been rejected by the remote device because the message contained invalid values.

Since:
  • 1.0 (WAT 1.2)

gotNak

Emitted when a messages has been NAK'd by the remote device.

Since:
  • 1.0 (WAT 1.2)

resultData

Emitted when the headlamp aim test has successfully completed.

Parameters:
Name Type Description
data object
Properties:
Name Type Description
vin string
vsn string
numLamps number

number of lamps tested

pass bool

true if all tests passed

lampData Array.<object>

one object for each lamp

Properties
Name Type Description
lampNumber number
preAimX number
preAimY number
postAimX number
postAimY number
intensity number
pass bool
errorCode string
Since:
  • 1.0 (WAT 1.2)