Project

General

Profile

Actions

Support Request #11154

closed

How to read chunks of type CAN using ADTF File Library

Added by hidden about 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Customer:
DAIMLER
Department:
RDI/TBP
Requester's Priority:
Normal
Support Level:
2nd Level
Resolution:
Solved Issue
Product Issue Numbers:
Platform:
Other Linux 64bit, Windows 10 64bit
Topic:
FileLibrary::Common
FAQ Links:

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

code snippet.png (35.8 KB) code snippet.png hidden, 2020-05-06 11:00
Actions #1

Updated by hidden about 4 years ago

  • 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

Actions #2

Updated by hidden about 4 years ago

Hello Matthias,

We are using ADTF 2.x
ADTF device toolbox: 3.1.0
CANWriter example: https://support.digitalwerk.net/adtf_libraries/adtf-file-library/v0/html/a02196.html

Thanks,
Vidhi

Actions #3

Updated by hidden about 4 years ago

  • 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
Actions #4

Updated by hidden about 4 years ago

  • Affected Products ADTF Device Toolbox 3.1.0 added
Actions #5

Updated by hidden about 4 years ago

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)

Actions #8

Updated by hidden about 4 years ago

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

Actions #9

Updated by hidden about 4 years ago

  • Status changed from In Progress to To Be Closed
  • Resolution set to Solved Issue
  • Platform Other Linux 64bit, Windows 10 64bit added
Actions #10

Updated by hidden about 4 years ago

  • Subject changed from Reading chunk ( CAN block ) APIs query to How to read chunks of type CAN using ADTF File Library
  • Description updated (diff)
Actions #11

Updated by hidden about 4 years ago

  • Project changed from 9 to Public Support
  • Private changed from Yes to No
Actions #12

Updated by hidden about 4 years ago

  • Status changed from To Be Closed to Closed
Actions

Also available in: Atom PDF