Class: SSDevice

SSDevice

Provides properties and methods for accessing a sensorsoft sensor device

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:
  • 0.1 (WAT 1.2)

<readonly> deviceName :string

Gets the name of the connected device.

Type:
  • string
Since:
  • 0.1 (WAT 1.2)

<readonly> manufacturer :string

Gets the manufacturer of the connected device.

Type:
  • string
Since:
  • 0.1 (WAT 1.2)

<readonly> model :string

Gets the model of the connected device.

Type:
  • string
Since:
  • 0.1 (WAT 1.2)

<readonly> version :string

Gets the version of the connected device.

Type:
  • string
Since:
  • 0.1 (WAT 1.2)

Methods


close()

Closes the connection to the device.

Since:
  • 0.1 (WAT 1.2)

getHumidity()

Sends a request to the device to return the current humidity.

Since:
  • 0.1 (WAT 1.2)
Returns:

True if the message has been sent. Does not indicate if the humidity has actually been returned.

Type
bool

getTemperature()

Sends a request to the device to return the current temperature.

Since:
  • 0.1 (WAT 1.2)
Returns:

True if the message has been sent. Does not indicate if the temperature has actually been returned.

Type
bool

open()

Opens the serial port and starts connecting to a device.

Since:
  • 0.1 (WAT 1.2)
Returns:

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

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:
  • 0.1 (WAT 1.2)

commError

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

Since:
  • 0.1 (WAT 1.2)

deviceDetected

Emitted when a device has been successfully connected to.

Parameters:
Name Type Description
device string

The name of the device.

Since:
  • 0.1 (WAT 1.2)

eepromFail

Emitted when a device has detected a failed EEPROM.

Since:
  • 0.1 (WAT 1.2)

humidity

Emitted whenever the device sends a humidity reading.

Parameters:
Name Type Description
humidity number

The humidity.

Since:
  • 0.1 (WAT 1.2)

lowPower

Emitted when a device has entered low power mode.

Since:
  • 0.1 (WAT 1.2)

tamper

Emitted when a device has detected a tamper condition.

Since:
  • 0.1 (WAT 1.2)

temperature

Emitted whenever the device sends a temperature reading.

Parameters:
Name Type Description
temp number

The temperature.

Since:
  • 0.1 (WAT 1.2)

unsupportedDevice

Emitted when an attempt is made to connect to a device that is not supported by this plugin.

Since:
  • 0.1 (WAT 1.2)