Project

General

Profile

Actions

Support Request #9832

closed

adtf/anonymous would not be deserialized

Added by hidden over 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Customer:
AUDI
Department:
EF
Requester's Priority:
Normal
Support Level:
3rd Level
Resolution:
Product Issue Opened
Platform:
Windows 10 64bit
Topic:
ADTF::Common
FAQ Links:

Description

Supportanfrage

Beim Versuch, Daten zwischen ADTF2 und ADTF3 auszutauschen, bekomme ich das mit der Rückrichtung noch nicht hin (3 -> 2). Inhalt soll einfach ein beliebig großer Byte-Blob sein.


 
Bekomme in ADTF2 die Fehlermeldung:

error | 00:05:39:390 | Unable to read from input stream: Class not found: Class not found: "oid.adtf.adtf3.type_deserialization.adtf/anonymous" | ipc_sample_source.cpp(157) | 16692/23548 | E:\CONAN\.conan\data\ADTF\2.14.0\ex24\testing\package\85f780d0530411a64b0be4407b381706014b445d\bin\adtf_launcher.exe | OK | No error | cIPCPlugin

Hier der Code-Snippet aus dem ADTF3-Sender (ich habe leider kein Beispiel gefunden, wo ein Blob geschickt wird)

writerLinkLayer_ = CreateOutputPin("link_layer", adtf::streaming::stream_meta_type_anonymous());

// ...

std::string serializedData;
serialize_to_string(*link_layer_short_range, serializedData);
adtf::ucom::object_ptr_locked<adtf::streaming::ISampleBuffer> pBuffer;
adtf::ucom::object_ptr<adtf::streaming::ISample> pSample;
adtf::streaming::alloc_sample(pSample,tTimeStamp(0));
adtf::streaming::write_to_sample(*pSample, serializedData);
writerLinkLayer_->Write(pSample);

Lösung

Dafür gibt's in der Toolbox tatsächlich keinen Deserialisierer. Im Moment fällt mir für Dich als Workaround nur ein einen adtf/default Type zu verwenden, der einfach eine leere Struktur beschreibt. Dann sollte es klappen.

Ticket ASUPTB-63 in der Support Toolbox erstellt, damit es da in Zukunft einen Deserialisierer gibt.

Was mir in deinem Code noch aufgefallen ist:

std::string serializedData;
serialize_to_string(*link_layer_short_range, serializedData);
adtf::streaming::alloc_sample(pSample,tTimeStamp(0));
adtf::streaming::write_to_sample(*pSample, serializedData);

write_to_sample funktioniert nicht mit std::string, sondern nur mit std::is_trivially_copyable Daten Typen (das fehlt leider im template als static_assert).

mach am besten folgendes:

std::string serializedData;
serialize_to_string(*link_layer_short_range, serializedData);
adtf::ucom::object_ptr<adtf::streaming::ISample> pSample;
adtf::streaming::alloc_sample(pSample,tTimeStamp(0));

{
    adtf::ucom::object_ptr_locked<adtf::streaming::ISampleBuffer> pBuffer;
    RETURN_IF_FAILED(pSample->WriteLock(pBuffer));
    RETURN_IF_FAILED(pBuffer->Write(adtf::base::adtf_memory_buffer<const char>(serializedData.data(), serializedData.length()));
}

Files

image001.png (11.4 KB) image001.png hidden, 2020-01-15 09:00
image002.png (9.36 KB) image002.png hidden, 2020-01-15 09:00
Actions

Also available in: Atom PDF