SensirionHDLC¶
Description¶
The SensirionHDLC object implements the Sensirion HDLC (High-Level Data Link Control) protocol to allow easy communication with Sensirion sensors via RS485 and USB cables.
This object was introduced in InCore 2.1.
› Inherits: | SerialPortBusNode |
---|---|
› Inherited by: | SensirionSFM3300, SensirionSPS30 |
Properties¶
articleCode¶
This property holds the article code of the connected device.
This property was introduced in InCore 2.5.
› Type: | String |
---|---|
› Signal: | articleCodeChanged() |
› Attributes: | Readonly |
error¶
This property holds the most recently occurred error or SensirionHDLC.NoError if no error occurred. If the same error occurs multiple times this property does not change. Use the errorOccurred() signal to detect multiple occurrences of the same error.
› Type: | Error |
---|---|
› Signal: | errorChanged() |
› Attributes: | Readonly |
errorString¶
This property holds the current human readable error string corresponding to the current value in the error property. It may include additional information such as failure reasons or locations.
› Type: | String |
---|---|
› Signal: | errorStringChanged() |
› Attributes: | Readonly |
firmwareVersion¶
This property holds the firmware version of the connected device.
This property was introduced in InCore 2.5.
› Type: | String |
---|---|
› Signal: | firmwareVersionChanged() |
› Attributes: | Readonly |
hardwareVersion¶
This property holds the hardware version of the connected device.
This property was introduced in InCore 2.5.
› Type: | String |
---|---|
› Signal: | hardwareVersionChanged() |
› Attributes: | Readonly |
productName¶
This property holds the name of the connected device.
This property was introduced in InCore 2.5.
› Type: | String |
---|---|
› Signal: | productNameChanged() |
› Attributes: | Readonly |
serialNumber¶
This property holds the serial number of the connected device.
This property was introduced in InCore 2.5.
› Type: | String |
---|---|
› Signal: | serialNumberChanged() |
› Attributes: | Readonly |
Methods¶
reset()¶
This method soft resets the attached sensor. After calling this command, the module is in the same state as after a Power-Reset.
sendCommand(UnsignedChar command, ArrayBuffer data)¶
Signals¶
errorOccurred()¶
This signal is emitted whenever an error has occurred, regardless of whether the error property has changed or not. In contrast to the change notification signal of the error property this signal is also emitted several times if a certain error occurs several times in succession.
responseReceived(UnsignedChar command, ArrayBuffer data)¶
This signal is emitted whenever a valid response for a certain command has been received. Both the command being responded to and the response data are supplied in the signal’s argument.
Enumerations¶
Error¶
This enumeration describes all errors which can occur in SensirionHDLC objects. The most recently occurred error is stored in the error property.
Name | Value | Description |
---|---|---|
SensirionHDLC.NoError |
0 |
No error occurred or was detected. |
SensirionHDLC.WrongDataLength |
1 |
Wrong data length for this command. |
SensirionHDLC.UnknownCommand |
2 |
Unknown command. |
SensirionHDLC.NoAccessRight |
3 |
No access right for command. |
SensirionHDLC.IllegalCommand |
4 |
Illegal command parameter or parameter out of allowed range. |
SensirionHDLC.SensorBusy |
32 |
Command could not be executed because sensor is busy. |
SensirionHDLC.NoAckFromSensor |
33 |
Sensor gives no I2C acknowledge. |
SensirionHDLC.I2cCrcError |
34 |
CRC error while communication with sensor. |
SensirionHDLC.SensorTimeout |
35 |
Timeout of sensor while measurement. |
SensirionHDLC.NoMeasurementStarted |
36 |
No measurement is started. |
SensirionHDLC.InternalFunctionArgumentOutOfRange |
40 |
Internal function argument out of range. |
SensirionHDLC.CommandNotAllowedCurrentState |
67 |
Command not allowed in current state. |
SensirionHDLC.UnknownError |
127 |
Unspecified device error. |
SensirionHDLC.InvalidPort |
256 |
Specified serial port does not exist or can’t be opened. |
SensirionHDLC.ResponseTimeoutError |
257 |
Did not receive response to request within 5000 ms. |
SensirionHDLC.InvalidResponse |
258 |
Received an invalid response, e.g. invalid CRC or invalid data. |