Class CCANSockets#

Nested Relationships#

Nested Types#

Inheritance Relationships#

Base Types#

Class Documentation#

class CCANSockets : public sdv::CSdvObject, public sdv::can::IRegisterReceiver, public sdv::can::ISend, private sdv::can::IInformation#

Component to establish Socket CAN communication between VAPI and external application.

Public Functions

virtual bool OnInitialize() override#

Initialize the object. Overload of sdv::CSdvObject::OnInitialize. The configuration contains either one interface name a list of interface names. The Send() method must use the index of this list to determine the interface In case of a single interface name the index is 0. canSockets = “vcan0” or canSockets = [“vcan1”, “vcan8”, “vcan9”, “vcan2”].

Returns:

Returns ‘true’ when the initialization was successful, ‘false’ when not.

virtual void OnShutdown() override#

Shutdown the object. Overload of sdv::CSdvObject::OnShutdown.

virtual void RegisterReceiver(sdv::can::IReceive *pReceiver) override#

Register a CAN message receiver. Overload of sdv::can::IRegisterReceiver::RegisterReceiver.

Parameters:

pReceiver[in] Pointer to the receiver interface.

virtual void UnregisterReceiver(sdv::can::IReceive *pReceiver) override#

Unregister a previously registered CAN message receiver. Overload of sdv::can::IRegisterReceiver::UnregisterReceiver.

Parameters:

pReceiver[in] Pointer to the receiver interface.

virtual void Send(const sdv::can::SMessage &sMsg, uint32_t uiConfigIndex) override#

Send a CAN message. Overload of sdv::can::ISend::Send.

Parameters:
  • sMsg[in] Message to be sent.

  • uiConfigIndex[in] Interface index to use for sending. Must match with the configuration list. In case configuration contains a single element the index is 0. The message cannot be sent to all interfaces automatically

virtual sdv::sequence<sdv::u8string> GetInterfaces() const override#

Get a list of interface names. Overload of sdv::can::IInformation::GetInterfaces.

Returns:

Sequence containing the names of the interfaces.