.. _object_CanPipe: :index:`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 :ref:`CAN frames ` if necessary. The CAN pipe consists of two endpoints using the same :ref:`address ` but different :ref:`endpointType `. This object was introduced in InCore 2.0. :**› Inherits**: :ref:`IoDevice ` Overview ******** Properties ++++++++++ .. hlist:: :columns: 3 * :ref:`address ` * :ref:`endpointType ` * :ref:`error ` * :ref:`errorString ` * :ref:`receivedData ` * :ref:`IoDevice.append ` * :ref:`IoDevice.atEnd ` * :ref:`IoDevice.autoOpen ` * :ref:`IoDevice.bytesAvailable ` * :ref:`IoDevice.canReadLine ` * :ref:`IoDevice.deviceErrorString ` * :ref:`IoDevice.isOpen ` * :ref:`IoDevice.isWritable ` * :ref:`IoDevice.nameArgument ` * :ref:`IoDevice.pos ` * :ref:`IoDevice.readOnly ` * :ref:`IoDevice.size ` * :ref:`IoDevice.truncate ` * :ref:`IoDevice.unbuffered ` * :ref:`Object.objectId ` * :ref:`Object.parent ` Methods +++++++ .. hlist:: :columns: 2 * :ref:`IoDevice.close() ` * :ref:`IoDevice.flush() ` * :ref:`IoDevice.open() ` * :ref:`IoDevice.peekAll() ` * :ref:`IoDevice.read() ` * :ref:`IoDevice.readAll() ` * :ref:`IoDevice.readLine() ` * :ref:`IoDevice.sync() ` * :ref:`IoDevice.write() ` * :ref:`Object.deserializeProperties() ` * :ref:`Object.fromJson() ` * :ref:`Object.serializeProperties() ` * :ref:`Object.toJson() ` Signals +++++++ .. hlist:: :columns: 1 * :ref:`errorOccurred() ` * :ref:`IoDevice.lineAvailableForRead() ` * :ref:`IoDevice.readyRead() ` * :ref:`Object.completed() ` Enumerations ++++++++++++ .. hlist:: :columns: 1 * :ref:`EndpointType ` * :ref:`Error ` Properties ********** .. _property_CanPipe_address: .. _signal_CanPipe_addressChanged: .. index:: single: address 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 .. _property_CanPipe_endpointType: .. _signal_CanPipe_endpointTypeChanged: .. index:: single: endpointType 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**: :ref:`EndpointType ` :**› Default**: :ref:`CanPipe.InvalidEndpoint ` :**› Signal**: endpointTypeChanged() :**› Attributes**: Writable .. _property_CanPipe_error: .. _signal_CanPipe_errorChanged: .. index:: single: error error +++++ This property holds the most recently occurred error or :ref:`CanPipe.NoError ` if no error occurred. If the same error occurs multiple times this property does not change. Use the :ref:`errorOccurred() ` signal to detect multiple occurrences of the same error. :**› Type**: :ref:`Error ` :**› Signal**: errorChanged() :**› Attributes**: Readonly .. _property_CanPipe_errorString: .. _signal_CanPipe_errorStringChanged: .. index:: single: errorString errorString +++++++++++ This property holds the current human readable error string corresponding to the current value in the :ref:`error ` property. It may include additional information such as failure reasons or locations. :**› Type**: String :**› Signal**: errorStringChanged() :**› Attributes**: Readonly .. _property_CanPipe_receivedData: .. _signal_CanPipe_receivedDataChanged: .. index:: single: receivedData 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 :ref:`IoDevice.read() `. After processing the data make sure to remove it from the byte array, e.g. by calling :ref:`ByteArray.remove() `. :**› Type**: :ref:`ByteArray ` :**› Signal**: receivedDataChanged() :**› Attributes**: Readonly Signals ******* .. _signal_CanPipe_errorOccurred: .. index:: single: errorOccurred errorOccurred() +++++++++++++++ This signal is emitted whenever an error has occurred, regardless of whether the :ref:`error ` property has changed or not. In contrast to the change notification signal of the :ref:`error ` property this signal is also emitted several times if a certain error occurs several times in succession. Enumerations ************ .. _enum_CanPipe_EndpointType: .. index:: single: EndpointType EndpointType ++++++++++++ This enumeration describes the type of the pipe endpoint. .. index:: single: CanPipe.InvalidEndpoint .. index:: single: CanPipe.DominantEndpoint .. index:: single: CanPipe.RecessiveEndpoint .. list-table:: :widths: auto :header-rows: 1 * - Name - Value - Description .. _enumitem_CanPipe_InvalidEndpoint: * - ``CanPipe.InvalidEndpoint`` - ``0`` - No pipe endpoint type configured. .. _enumitem_CanPipe_DominantEndpoint: * - ``CanPipe.DominantEndpoint`` - ``1`` - The pipe endpoint is dominant, i.e. it has a higher priority on the CAN bus. .. _enumitem_CanPipe_RecessiveEndpoint: * - ``CanPipe.RecessiveEndpoint`` - ``2`` - The pipe endpoint is recessive, i.e. it has a lower priority on the CAN bus. .. _enum_CanPipe_Error: .. index:: single: Error Error +++++ This enumeration describes all errors which can occur in CanPipe objects. The most recently occurred error is stored in the :ref:`error ` property. .. index:: single: CanPipe.NoError .. index:: single: CanPipe.InvalidBusError .. list-table:: :widths: auto :header-rows: 1 * - Name - Value - Description .. _enumitem_CanPipe_NoError: * - ``CanPipe.NoError`` - ``0`` - No error occurred or was detected. .. _enumitem_CanPipe_InvalidBusError: * - ``CanPipe.InvalidBusError`` - ``1`` - Parent is not a CanBus object.