ADTF_DEVICE_TOOLBOX  3.12.1 (ADTF 3.18.3)
canfd_coder_intf.h
Go to the documentation of this file.
1 
8 #pragma once
9 
10 #include "canfd_database_intf.h"
11 #include "can_types.h"
12 #include <adtf_streaming3.h>
13 #include <adtfmediadescription/type_reflection.h>
14 #include <limits>
15 
19 namespace adtf
20 {
21 
25 namespace devicetb
26 {
27 
31 namespace sdk
32 {
33 
37 namespace canfd
38 {
39 
43 namespace axle
44 {
45 class ICANFDCoder : public adtf::ucom::ant::IObject
46 {
47 public:
48  ADTF_IID(ICANFDCoder, "canfd_coder.axle.canfd.sdk.devicetb.adtf.iid");
49 
50  virtual tResult Begin(const adtf::streaming::ISampleBuffer *pData) = 0;
60  virtual tResult Begin(const void *pData, int64_t nSize) = 0;
61  virtual tResult End() = 0;
62 
77  virtual tResult SetMessageInfo(tChannelID nChannel, tMessageID nMsgID, bool bExtended, uint16_t nFlags = 0) = 0;
78 
91  virtual tResult GetMessageInfo(tChannelID* pnChannel, tMessageID* pnMsgID, bool* pbExtended, uint16_t* pnFlags) = 0;
92 
108  virtual tResult Set(const char* strValueID, const void* pValue) = 0;
109 
125  virtual tResult Get(const char* strValueID, void* pValue) = 0;
126 
144  virtual tResult SetSignalValue(tSignalID nSignalID, const tSignalValue* pSignalValue) = 0;
145 
161  virtual tResult GetSignalValue(tSignalID nSignalID, tSignalValue* pSignalValue) const = 0;
162 
172  virtual tResult SetRawData(const uint8_t* pData, uint8_t nLength) = 0;
173 
182  virtual tResult GetRawData(const uint8_t** pData, uint8_t* nLength) const = 0;
183 
197  virtual tResult GetSignalID(tChannelID nChannel, const char* strValueID, tSignalID* pSignalID) const = 0;
198 
208  virtual tResult GetDatabase(tChannelID nChannel,
209  adtf::ucom::ant::iobject_ptr<ICANFDDatabase>& pCANFDDatabase) const = 0;
210 
221  virtual tResult SetDatabase(tChannelID nChannel, const char* strFileName) = 0;
222 };
223 
224 } // namespace axle
225 
229 namespace ignition
230 {
231 class ICANFDCoder : public adtf::ucom::ant::IObject
232 {
233 public:
234  ADTF_IID(ICANFDCoder, "canfd_coder.ignition.canfd.sdk.devicetb.adtf.iid");
235 
243  virtual tResult SetData(const tCANFDData *pData) = 0;
244 
252  virtual tResult SetData(const adtf::devicetb::sdk::can::tCANData *pData) = 0;
253 
262  virtual tResult CreateMessage(const tMessageID nMsgId, const tChannelID nChannelId) = 0;
263 
271  virtual tResult GetMessageData(tCANFDData* pMsgData) = 0;
272 
281  virtual tResult GetMessageData(adtf::devicetb::sdk::can::tCANData* pMsgData) = 0;
282 
290  virtual tResult GetMessageId(tMessageID& nMessageId) const = 0;
291 
301  virtual tResult SetRawSignalValue(tSignalID nSignalId, const tSignalValue& oRawValue) = 0;
302 
313  virtual tResult SetRawSignalValue(tSignalID nSignalId, const void* pRawValue, uint64_t nSize) = 0;
314 
325  virtual tResult SetPhysicalSignalValue(tSignalID nSignalId, double nPhysValue) = 0;
326 
339  virtual tResult GetSignalValue(tSignalID nSignalId, tSignalValue& oRawValue, double& nPhysValue) const = 0;
340 
353  virtual tResult GetSignalValue(tSignalID nSignalId, void* pRawValue, uint64_t nSize) const = 0;
354 
365  virtual tResult SetRawData(const void* pData, uint8_t nLength) = 0;
366 
375  virtual tResult GetDatabase(tChannelID nChannelId,
376  adtf::ucom::ant::iobject_ptr<ICANFDDatabase>& pCANFDDatabase) const = 0;
377 
386  virtual tResult GetAllSignalValues(const ucom::nitro::ifunction<void(tSignalID nSignalId, tSignalValue oRawValue, double nPhysValue)>& fnCallback) const = 0;
387 
395  virtual tResult GetMultiplexSelectorFieldCode(uint32_t& nSelectorFieldCode) = 0;
396 
404  virtual tResult SetMultiplexSelectorFieldCode(uint32_t nSelectorFieldCode) = 0;
405 
406 };
407 
408 } // namespace ignition
409 
413 namespace jack
414 {
416  {
417  public:
418  using tPduIndex = uint32_t;
419 
420  ADTF_IID(ICANFDCoder, "canfd_coder.jack.canfd.sdk.devicetb.adtf.iid");
421 
429  virtual tResult GetContainedPdus(const ucom::nitro::ifunction<void(const tPduInfo* pPduInfo, tPduIndex nPduIndex)>& fnCallback) const = 0;
430 
445  virtual tResult AddContainedPdu(tPduIndex& nPduIndexContained, tPDUID nPduId, tPduIndex nPduIndexContainer = 0) = 0;
446 
456  virtual tResult SelectContainedPdu(tPduIndex nPduIndex = 0) = 0;
457  };
458 
459 }// namespace jack
460 
462 
463 } // namespace canfd
464 } // namespace sdk
465 } // namespace devicetb
466 } // namespace adtf
Copyright 2024 CARIAD SE.
Copyright © CARIAD SE.
virtual tResult GetSignalID(tChannelID nChannel, const char *strValueID, tSignalID *pSignalID) const =0
Returns the value ID of a given CAN FD signal name for the specified channel.
virtual tResult SetRawData(const uint8_t *pData, uint8_t nLength)=0
Copies the given raw data to the raw data of the message given by Begin().
virtual tResult GetMessageInfo(tChannelID *pnChannel, tMessageID *pnMsgID, bool *pbExtended, uint16_t *pnFlags)=0
Returns information about the CAN FD message.
virtual tResult SetDatabase(tChannelID nChannel, const char *strFileName)=0
Loads the CAN FD database file and uses it for (de-)coding of signal values for the specified channel...
virtual tResult Set(const char *strValueID, const void *pValue)=0
Sets the value, which is defined with strValueID.
virtual tResult GetSignalValue(tSignalID nSignalID, tSignalValue *pSignalValue) const =0
Returns the decoded value of one CAN FD signal from the data area given by Begin() On return the fiel...
virtual tResult SetSignalValue(tSignalID nSignalID, const tSignalValue *pSignalValue)=0
Sets the value of one CAN FD signal in the data area given by ICANFDCoder::Begin To set the raw value...
virtual tResult SetMessageInfo(tChannelID nChannel, tMessageID nMsgID, bool bExtended, uint16_t nFlags=0)=0
Inits a new CAN FD message.
virtual tResult Begin(const void *pData, int64_t nSize)=0
Creates read and write acces for writing the desired information.
virtual tResult Get(const char *strValueID, void *pValue)=0
Gets the value, which is defined with strValueID.
virtual tResult GetDatabase(tChannelID nChannel, adtf::ucom::ant::iobject_ptr< ICANFDDatabase > &pCANFDDatabase) const =0
Returns the CAN Database for the channel.
virtual tResult GetRawData(const uint8_t **pData, uint8_t *nLength) const =0
Returns the the raw data and the length of the message given by Begin()
virtual tResult GetMessageData(adtf::devicetb::sdk::can::tCANData *pMsgData)=0
Return information about the CAN message.
virtual tResult GetSignalValue(tSignalID nSignalId, void *pRawValue, uint64_t nSize) const =0
Return the decoded value of one CAN FD signal from the data area given by SetData or CreateMessage.
virtual tResult SetRawData(const void *pData, uint8_t nLength)=0
Copy the given CAN FD raw message payload to the payload of the message.
virtual tResult SetData(const tCANFDData *pData)=0
Set a message from an input CAN FD sample.
virtual tResult CreateMessage(const tMessageID nMsgId, const tChannelID nChannelId)=0
Create a new message.
virtual tResult GetAllSignalValues(const ucom::nitro::ifunction< void(tSignalID nSignalId, tSignalValue oRawValue, double nPhysValue)> &fnCallback) const =0
Return all signal values from the current data buffer.
virtual tResult GetMessageData(tCANFDData *pMsgData)=0
Return information about the CAN FD message.
virtual tResult SetMultiplexSelectorFieldCode(uint32_t nSelectorFieldCode)=0
Set the selector field code for the current data buffer.
virtual tResult SetData(const adtf::devicetb::sdk::can::tCANData *pData)=0
Set a message from an input CAN sample or raw data.
virtual tResult GetSignalValue(tSignalID nSignalId, tSignalValue &oRawValue, double &nPhysValue) const =0
Return the decoded value of one CAN FD signal from the data area given by SetData or CreateMessage.
virtual tResult GetMessageId(tMessageID &nMessageId) const =0
Return the CAN FD message identifier without any flags.
virtual tResult GetDatabase(tChannelID nChannelId, adtf::ucom::ant::iobject_ptr< ICANFDDatabase > &pCANFDDatabase) const =0
Return the CAN FD Database for the channel.
virtual tResult SetRawSignalValue(tSignalID nSignalId, const void *pRawValue, uint64_t nSize)=0
Set a raw signal value byte array given by the signal id.
virtual tResult SetPhysicalSignalValue(tSignalID nSignalId, double nPhysValue)=0
Set a physical value given by the signal id.
virtual tResult SetRawSignalValue(tSignalID nSignalId, const tSignalValue &oRawValue)=0
Set a raw signal value given by the signal id.
virtual tResult GetMultiplexSelectorFieldCode(uint32_t &nSelectorFieldCode)=0
Return the selector field code from the current data buffer.
virtual tResult GetContainedPdus(const ucom::nitro::ifunction< void(const tPduInfo *pPduInfo, tPduIndex nPduIndex)> &fnCallback) const =0
Return the contained PduInfos and the corresponding index located in a container PDU from the current...
virtual tResult SelectContainedPdu(tPduIndex nPduIndex=0)=0
Set the current index of a contained PDU within a container PDU.
virtual tResult AddContainedPdu(tPduIndex &nPduIndexContained, tPDUID nPduId, tPduIndex nPduIndexContainer=0)=0
Add a PDU to the container PDU and returns the index at which the new PDU was set.
jack::ICANFDCoder ICANFDCoder
ignition::tPDUID tPDUID
Definition: canfd_types.h:731
ADTF - Namespace.
The CAN data structure is used by CAN MediaSamples use following code within your filter:
Definition: can_types.h:183
The CAN FD data structure is used by CAN FD MediaSamples.
Definition: canfd_types.h:193
Message/PDU structure which contain all information about one specific message.
Definition: canfd_types.h:616
Signal value structure which keeps one signal specific value.
Definition: canfd_types.h:480