Project

General

Profile

Actions

Support Request #1039

closed

ADTF UI service function to access CAN data

Added by hidden over 6 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Customer:
BOSCH
Department:
Requester's Priority:
Normal
Support Level:
2nd Level
Resolution:
Solved Issue
Product Issue Numbers:
Affected Products:
Platform:
Windows 7 64bit
Topic:
DeviceTB::CAN
FAQ Links:

Description

Supportanfrage

Hello,
I'm Vignesh from Bosch India.
I'm using ADTF2.13.3.
Could you please let me know if there is any function which can be used in an ADTF service to process the CAN message received via Vector_CAN_XL_Receiver.
I'm looking for a function similar to OnPinEvent() function (which we can override in a filter) in an ADTF service.
Is this possible? If not, Please let us know if there are any alternate approach to be followed.

My scenario:
I need a function to process a CAN message as an when it is received in an ADTF service because, I want to show an UI to the user(so I'm implementing a ADTF UI service) which should be displayed even before the ADTF configuration is activated.
User would provide details in the UI after which the configuration should be started and based on that inputs, the CAN messages received would be used to perform certain tasks.

Please let me know if more information is required.
Many thanks in advance!!!

Regards,
Vignesh

Lösung

To be able to read CAN signal values, you will need a can media coder which is responsible to decode the raw can data stream.

Please find the the below code snippet to get a first impression:

...
// get can support service interface
cObjectPtr<adtf_devicetb::ICANSupport> pCANSupport;
_runtime->GetObject(OID_ADTF_CAN_SUPPORT, IID_ADTF_CAN_SUPPORT, (tVoid**) &pCANSupport);

// create can coder for decoding
cObjectPtr<adtf_devicetb::ICANMediaCoder> pCANDecoder;
pCANSupport->CreateCoder(&pCANDecoder);

// set raw data from media sample and its size to decode the message
pCANDecoder->Begin(psample_data, sizeof(sample_size)));

// get message information
pCANDecoder->GetMessageInfo(&nChannel, &nMsgID, &bExtended));

// get desired signal id
pCANDecoder->GetSignalID(nChannel, "signal name", &pSignalID);

// get appropriate signal value relating to the signal id
pCANDecoder->GetSignalValue(nSignalID, &sSignalValue)))

// terminate coder activities for this message
pCANDecoder->End();

...
Actions #1

Updated by hidden over 6 years ago

  • Project changed from Public Support to 5
  • Description updated (diff)
  • Topic set to DeviceTB::CAN
  • Customer set to BOSCH
  • Affected Products ADTF 2.13.3 added
  • Platform Windows 7 64bit added
Actions #2

Updated by hidden over 6 years ago

  • Status changed from New to Customer Feedback Required

Dear Vignesh,

thank you for your email.

To be able to read CAN signal values, you will need a can media coder which is responsible to decode the raw can data stream.

Please find the the below code snippet to get a first impression:

...
// get can support service interface
cObjectPtr<adtf_devicetb::ICANSupport> pCANSupport;
_runtime->GetObject(OID_ADTF_CAN_SUPPORT, IID_ADTF_CAN_SUPPORT, (tVoid**) &pCANSupport);

// create can coder for decoding
cObjectPtr<adtf_devicetb::ICANMediaCoder> pCANDecoder;
pCANSupport->CreateCoder(&pCANDecoder);

// set raw data from media sample and its size to decode the message
pCANDecoder->Begin(psample_data, sizeof(sample_size)));

// get message information
pCANDecoder->GetMessageInfo(&nChannel, &nMsgID, &bExtended));

// get desired signal id
pCANDecoder->GetSignalID(nChannel, "signal name", &pSignalID);

// get appropriate signal value relating to the signal id
pCANDecoder->GetSignalValue(nSignalID, &sSignalValue)))

// terminate coder activities for this message
pCANDecoder->End();

...

Greetings
Frank

Actions #3

Updated by hidden over 6 years ago

Dear Vignesh,

please give us a short feedback if this solves your problem, otherwise we will close the issue at the end of the week.

Here's the last reply:

To be able to read CAN signal values, you will need a can media coder which is responsible to decode the raw can data stream.

Please find the the below code snippet to get a first impression:

...
// get can support service interface
cObjectPtr<adtf_devicetb::ICANSupport> pCANSupport;
_runtime->GetObject(OID_ADTF_CAN_SUPPORT, IID_ADTF_CAN_SUPPORT, (tVoid**) &pCANSupport);

// create can coder for decoding
cObjectPtr<adtf_devicetb::ICANMediaCoder> pCANDecoder;
pCANSupport->CreateCoder(&pCANDecoder);

// set raw data from media sample and its size to decode the message
pCANDecoder->Begin(psample_data, sizeof(sample_size)));

// get message information
pCANDecoder->GetMessageInfo(&nChannel, &nMsgID, &bExtended));

// get desired signal id
pCANDecoder->GetSignalID(nChannel, "signal name", &pSignalID);

// get appropriate signal value relating to the signal id
pCANDecoder->GetSignalValue(nSignalID, &sSignalValue)))

// terminate coder activities for this message
pCANDecoder->End();

...
Actions #4

Updated by hidden over 6 years ago

Thanks a lot for the reply!!!
You can close the ticket.

From: [mailto:]
Sent: Wednesday, September 06, 2017 12:49 PM
Subject: [BOSCH Support - Issue #1039] ADTF UI service function

Actions #5

Updated by hidden over 6 years ago

  • Description updated (diff)
  • Status changed from Customer Feedback Required to To Be Closed
  • Resolution set to Solved Issue
Actions #6

Updated by hidden over 6 years ago

  • Status changed from To Be Closed to Closed
Actions #7

Updated by hidden over 6 years ago

  • Subject changed from ADTF UI service function to ADTF UI service function to access CAN data
Actions #8

Updated by hidden over 6 years ago

  • Project changed from 5 to Public Support
  • Private changed from Yes to No
Actions

Also available in: Atom PDF