ADTF_DEVICE_TOOLBOX  3.12.1 (ADTF 3.18.3)
(Deprecated) CAN DBC Support Service
Note
Using this service will automatic load the adtffileplugin for deserialization and extend the support for recordings containg data from ADTF Device Toolbox 2.x, there is no need to add the devtb2 support service as well. See ADTF Device Toolbox 2.x Support.
Warning
Due to the integration of CAN functionality into CAN FD, all components related to CAN are deprecated and will be removed in upcoming versions! Please make sure to switch your ADTF Sessions to the CAN FD components!

Plugin Information
Plugin Filenamecan.adtfplugin
Plugin Descriptioncan.plugindescription
Plugin Name(Deprecated) CAN DBC Support Service Plugin
LicenseADTF
Support Mailsupport@digitalwerk.net
Homepage URLwww.digitalwerk.net
Plugin Versions
Plugin Version3.12.1
Plugin File Version1.0
adtf::devicetb3.12.1
adtf3.18.3
adtf::ucom3.1.0
Component Information
Name(Deprecated) CAN DBC Support Service
CIDcan.service.devicetb.cid
DescriptionUse this se to extend the ADTF System with CAN support using dbc database.
TypeService
Default Runlevelsession
Properties
NameValueTypeDescriptionSubproperties
can_channel_0cFilenameListDatabase for mapped CAN channel 0
can_channel_0_cluster_namecStringCluster name for mapped CAN channel 0
can_channel_1cFilenameListDatabase for mapped CAN channel 1
can_channel_10cFilenameListDatabase for mapped CAN channel 10
can_channel_10_cluster_namecStringCluster name for mapped CAN channel 10
can_channel_11cFilenameListDatabase for mapped CAN channel 11
can_channel_11_cluster_namecStringCluster name for mapped CAN channel 11
can_channel_12cFilenameListDatabase for mapped CAN channel 12
can_channel_12_cluster_namecStringCluster name for mapped CAN channel 12
can_channel_13cFilenameListDatabase for mapped CAN channel 13
can_channel_13_cluster_namecStringCluster name for mapped CAN channel 13
can_channel_14cFilenameListDatabase for mapped CAN channel 14
can_channel_14_cluster_namecStringCluster name for mapped CAN channel 14
can_channel_15cFilenameListDatabase for mapped CAN channel 15
can_channel_15_cluster_namecStringCluster name for mapped CAN channel 15
can_channel_16cFilenameListDatabase for mapped CAN channel 16
can_channel_16_cluster_namecStringCluster name for mapped CAN channel 16
can_channel_1_cluster_namecStringCluster name for mapped CAN channel 1
can_channel_2cFilenameListDatabase for mapped CAN channel 2
can_channel_2_cluster_namecStringCluster name for mapped CAN channel 2
can_channel_3cFilenameListDatabase for mapped CAN channel 3
can_channel_3_cluster_namecStringCluster name for mapped CAN channel 3
can_channel_4cFilenameListDatabase for mapped CAN channel 4
can_channel_4_cluster_namecStringCluster name for mapped CAN channel 4
can_channel_5cFilenameListDatabase for mapped CAN channel 5
can_channel_5_cluster_namecStringCluster name for mapped CAN channel 5
can_channel_6cFilenameListDatabase for mapped CAN channel 6
can_channel_6_cluster_namecStringCluster name for mapped CAN channel 6
can_channel_7cFilenameListDatabase for mapped CAN channel 7
can_channel_7_cluster_namecStringCluster name for mapped CAN channel 7
can_channel_8cFilenameListDatabase for mapped CAN channel 8
can_channel_8_cluster_namecStringCluster name for mapped CAN channel 8
can_channel_9cFilenameListDatabase for mapped CAN channel 9
can_channel_9_cluster_namecStringCluster name for mapped CAN channel 9
Required Interfaces
IID
can_dbc.parser.can.sdk.devicetb.adtf.iid
can_arxml.parser.can.sdk.devicetb.adtf.iid
macroresolver.ant.base.adtf.iid
adtf_file_objects.devil.services.adtf.iid
Provided Interfaces
IID
bus_database_registry.axle.sdk.devicetb.adtf.iid
can.axle.can.sdk.devicetb.adtf.iid
can_database.axle.can.sdk.devicetb.adtf.iid
can_database_list.axle.can.sdk.devicetb.adtf.iid
can_coder.axle.can.sdk.devicetb.adtf.iid

Working with the CAN Sample

The internal structure of the CAN Stream Type is from type adtf::devicetb::sdk::can::stream_meta_type_can and defined in the can_types.h header file. The following code shows how to create a new CAN Sample:

streaming::output_sample_data<devicetb::sdk::can::tCANData> pSample(m_pClock->GetTime());
std::memset(pSample.GetDataPtr(), 0, sizeof(devicetb::sdk::can::tCANData));
axle::tCANData tCANData
The CAN data structure is used by CAN MediaSamples use following code within your filter:
Definition: can_types.h:294

That's it! Once the CAN Stream Type is set (see below), all following media samples are assumed to be from the same stream type. So no specific sample type information must be set during a sample allocation.

Working with the CAN Stream Type

The Pins for receiving or sending new CAN Samples must be from a CAN Stream Type. The following code shows how to create an Output Pin with this type:

adtf::streaming::ISampleWriter* m_pWriter = CreateOutputPin("can_output", adtf::devicetb::sdk::can::stream_meta_type_can());
adtf::streaming::ISampleReader* m_pReader = CreateInputPin("can_input", adtf::devicetb::sdk::can::stream_meta_type_can());
Definition of Stream Meta Type CAN Messages.

All samples which are transmitted on these pins are assumed to be from a CAN Stream Type.

Working with the CAN Service

The CAN Service implements the CAN MediaCoder and keeps a list of all registered database parsers. It also offers different interfaces for querying CAN databases (DBC files) or create new CAN MediaCoder objects. It has to be used whenever CAN data must be processed.

The following code shows how to query the registered instance of the CAN Service:

object_ptr<ICANSupport> pService;
_runtime->GetObject(pService));

GetObject derives the interface ID of the object pointer from the object itself, thus no interface ID must be set.