Support Request #11154
closed
How to read chunks of type CAN using ADTF File Library
Added by hidden almost 4 years ago.
Updated almost 4 years ago.
Requester's Priority:
Normal
Platform:
Other Linux 64bit, Windows 10 64bit
Topic:
FileLibrary::Common
Description
Supportanfrage
We are following CANWriter example to understand the CAN structure and similarly we are trying to read CAN block into the CAN structure using readNextChunk API where stream ID is assigned to CAN stream ID and also tried to read CAN structure data using readChunk API.
Am I using the correct API to extract information or please suggest which APIs should I use to read CAN block into CAN structure.
Lösung
You cannot use asn IndexedFileReader to access the sample data, as chunks contain only serialized versions of the samples. You need to use and adtf_file::Reader as is shown in the "File Access" example (https://support.digitalwerk.net/adtf_libraries/adtf-file-library/v0/html/a02199.html). This will give you the deserialized sample data. It is important, that you load the adtf_devtb_2_deserializerd.adtffileplugin if you want to access ADTF2 Dat files with CAN streams. The File Access Examples does this when specifying the plugin on the command line.
Then you can access the sample data as is done in the "access_file_data" function in the example.
Files
- Project changed from Public Support to 9
- Status changed from New to Customer Feedback Required
- Topic set to DeviceTB::CAN
Hello Vidhi Patel,
are you using ADTF 2.x or ADTF 3.x?
Please also tell us which version of the ADTF Device Toolbox is used?
To which "CANWriter example" did you refer?
Thank you
- Status changed from Customer Feedback Required to In Progress
- Topic changed from DeviceTB::CAN to FileLibrary::Common
- Affected Products ADTF File Library 0.6.1 (BETA) added
- Affected Products ADTF Device Toolbox 3.1.0 added
Hello,
I have included this file ‘can_stream_type_definitions.h’ in ADTF_fileaccess.cpp example code and tried to used tCANData structure shown as attached screenshot where last argument ‘1’ is CAN stream ID. And trying to access tCANData structure variables. (example: sData.ui32Id)
Hi vidhi patel,
you cannot use asn IndexedFileReader to access the sample data, as chunks contain only serialized versions of the samples. You need to use and adtf_file::Reader as is shown in the "File Access" example (https://support.digitalwerk.net/adtf_libraries/adtf-file-library/v0/html/a02199.html). This will give you the deserialized sample data. It is important, that you load the adtf_devtb_2_deserializerd.adtffileplugin if you want to access ADTF2 Dat files with CAN streams. The File Access Examples does this when specifying the plugin on the command line.
Then you can access the sample data as is done in the "access_file_data" function in the example.
Please get back to us if you need further assistance.
Regards,
Martin
- Status changed from In Progress to To Be Closed
- Resolution set to Solved Issue
- Platform Other Linux 64bit, Windows 10 64bit added
- Subject changed from Reading chunk ( CAN block ) APIs query to How to read chunks of type CAN using ADTF File Library
- Description updated (diff)
- Project changed from 9 to Public Support
- Private changed from Yes to No
- Status changed from To Be Closed to Closed
Also available in: Atom
PDF