CanPipe

Description

The CanPipe object provides a logical data pipe between two CAN nodes. The pipe can be used to exchange arbitrarily sized messages. All messages are split into chunks to fit into the payload of a CAN frame and are transmitted as multiple CAN frames if necessary.

The CAN pipe consists of two endpoints using the same address but different endpointType.

This object was introduced in InCore 2.0.

› Inherits:IoDevice

Properties

address

This property holds the address of the logical CAN pipe. It has to be identical on both endpoints.

› Type:UnsignedInteger
› Signal:addressChanged()
› Attributes:Writable

endpointType

This property holds the type of the local CAN pipe endpoint. A logical CAN pipe consists of a dominant and a recessive endpoint talking to each other.

› Type:EndpointType
› Default:CanPipe.InvalidEndpoint
› Signal:endpointTypeChanged()
› Attributes:Writable

error

This property holds the most recently occurred error or CanPipe.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

receivedData

This property holds the data received through this CAN pipe. This property can be used to access the received data directly instead of calling IoDevice.read(). After processing the data make sure to remove it from the byte array, e.g. by calling ByteArray.remove().

› Type:ByteArray
› Signal:receivedDataChanged()
› Attributes:Readonly

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.

Enumerations

EndpointType

This enumeration describes the type of the pipe endpoint.

Name Value Description
CanPipe.InvalidEndpoint 0 No pipe endpoint type configured.
CanPipe.DominantEndpoint 1 The pipe endpoint is dominant, i.e. it has a higher priority on the CAN bus.
CanPipe.RecessiveEndpoint 2 The pipe endpoint is recessive, i.e. it has a lower priority on the CAN bus.

Error

This enumeration describes all errors which can occur in CanPipe objects. The most recently occurred error is stored in the error property.

Name Value Description
CanPipe.NoError 0 No error occurred or was detected.
CanPipe.InvalidBusError 1 Parent is not a CanBus object.