- Plugin Information
-
- Plugin Versions
Plugin Version | 3.11.3 |
Plugin File Version | 1.0 |
adtf::devicetb | 3.11.3 |
adtf | 3.16.2 |
adtf::ucom | 3.1.0 |
- Component Information
Name | SOME IP ARXML Support Service |
CID | someip.service.devicetb.cid |
Description | The SOME/IP service is responsible for loading a SOME/IP database parser library and providing access to the ISomeIpDatabse contained within. The service also handles the creaton of ISomeIpDecoder instances for convenient access of SOME/IP samples. |
Type | Service |
Default Runlevel | session |
- Properties
Name | Value | Type | Description | Subproperties |
someip_database_paths | | cFilenameList | List of files containing the SOME/IP database. | |
- Required Interfaces
IID |
someip_arxml.parser.someip.sdk.devicetb.adtf.iid |
macroresolver.ant.base.adtf.iid |
- Provided Interfaces
IID |
bus_database_registry.axle.sdk.devicetb.adtf.iid |
someip_service.hood.someip.sdk.devicetb.adtf.iid |
someip_database.hood.someip.sdk.devicetb.adtf.iid |
someip_decoder.hood.someip.sdk.devicetb.adtf.iid |
Structure of SOME/IP Samples
SOME/IP samples consist of a sample header followed by one or more SOME/IP messages. The header contains metadata such as the network endpoints and protocol as well as the number of messages contained in the sample. The messages themselves are stored in the sample in the unchanged on-wire format. Samples containig more than one message indicate, that the messages were part of a single UDP packet received from the network.
Processing SOME/IP Samples in a Filter
Receiving SOME/IP Samples
For a Fitler or Streaming Sink to process SOME/IP samples it must merely provide an input pin with the apropriate Stream Meta Type.
brake::stream_meta_type_someip stream_meta_type_someip
Definition of Stream Meta Type for SOME/IP.
Decoding SOME/IP Samples
For convenient access to the sample header as well as the contained messages you may use the adtf::devicetb::sdk::someip::ISomeIpDecoder interface. An instance of adtf::devicetb::sdk::someip::ISomeIpDecoder for a given sample can be obtained from the adtf::devicetb::sdk::someip::ISomeIpSupport Service.
object_ptr<ISomeIpSupport> pSomeIpSupport;
RETURN_IF_FAILED(_runtime->GetObject(pSomeIpSupport));
object_ptr<ISomeIpDecoder> pDecoder;
RETURN_IF_FAILED(pSomeIpSupport->CreateDecoder(pDecoder, pSample));
for (tSize i = 0; i < pDecoder->GetMessageCount())
{
tUInt32 nMessagId = 0;
RETURN_IF_FAILED(pDecoder->GetMessageId(nMessageId, i));
}
adtf::devicetb::sdk::someip::ISomeIpDecoder provides direct access to the messages' header fields as well as their raw payload. The message payload itself is dynamic by nature and decoding requires information about its structure. This information is provided to ADTF by a database parser library (e.g. for ARXML or Fibex) and may not always be present. adtf::devicetb::sdk::someip::ISomeIpDecoder can provide a Media Description (DDL) of the message payload, if a parser library and database file have been registered with the adtf::devicetb::sdk::someip::ISomeIpSupport Service.
const tChar* strPayloadDesc = nullptr;
RETURN_IF_FAILED(pDecoder->GetPayloadDescription(strPayloadDesc, nMessageIndex));
const tUInt8* pMessagePayload = nullptr;
tSize nPayloadSize = 0;
RETURN_IF_FAILED(pDecoder->GetPayload(pMessagePayload, nPayloadSize, nMessageIndex));
ddl::cCodecFactory oFactory("tPayload", strPayloadDesc);
ddl::cStaticDecoder oDecoder = oFactory.MakeStaticDecoderFor(pMessagePayload, nPayloadSize, ddl::tDataRepresentation::Serialized);
tSize nElementCount = oDecoder.GetElementCount();
for (tSize i = 0; i < nElementCount; ++i)
{
const ddl::tStructElement* pElement = nullptr;
oDecoder.GetElement(i, pElement);
adtf::util::cVariant oVar;
oDecoder.GetElementValue(i, oVar);
LOG_INFO("Name: %s -- Value: %s", pElement->strName, oVar.AsString().GetPtr());
}
Crafting SOME/IP Samples
The Device Toolbox does not currently provide the same convenience functions for writing SOME/IP samples as it does for reading. However, it is possible to manually craft samples and containing pre-existing messages.
std::vector<uUInt8> vecMessageData = ObtainMessageFromSomewhere();
oSampleHeader.nVLANId = 1;
oSampleHeader.bIsIpv6 = true;
oSampleHeader.nMessageCount = 1;
oSampleHeader.nMessageDataSize = vecMessageData.size();
object_ptr<ISample> pSomeIpSample;
RETURN_IF_FAILED(alloc_sample(pSomeIpSample, tmTimestamp));
object_ptr_locked<adtf::streaming::ant::ISampleBuffer> pBuffer;
RETURN_IF_FAILED(pEthernetSample->WriteLock(pBuffer, nSampleSize));
std::memcpy(pBuffer->GetPtr(), &oSampleHeader, sizeof(oSampleHeader));
std::memcpy(pBuffer->GetPtr() + sizeof(oSampleHeader), vecMessageData.data(), vecMessageData.size());
hood::tSomeIpSampleHeader tSomeIpSampleHeader
This struct describes the SOME/IP sample header which is placed in the beginning of every SOME/IP sam...