Open lucka-me opened 4 years ago
Please check whether this problem persists with CommonAPI v3.2. If yes, please also provide the content of the .fdepl.
This problem persists with v3.2
(v3.2.0.1
of both tools).
The Sample.fidl
:
package sample
typeCollection CommonType {
version { major 1 minor 0 }
enumeration ValueType {
None = 0
Size = 1
Items = 2
}
struct ValueBase polymorphic {
}
struct Data {
ValueType type
ValueBase value
}
struct ValueA extends ValueBase {
UInt32 id
}
struct Item {
UInt32 size
}
struct ValueB extends ValueBase {
Item [ ] items
}
}
interface MessageBus {
version { major 1 minor 0 }
attribute CommonType.Data data readonly
}
And Sample.fdepl
:
import "platform:/plugin/org.genivi.commonapi.someip/deployment/CommonAPI-SOMEIP_deployment_spec.fdepl"
import "Sample.fidl"
define org.genivi.commonapi.someip.deployment for interface sample.MessageBus {
SomeIpServiceID = 4660
attribute data {
SomeIpNotifierID = 33333
SomeIpNotifierReliable = true
SomeIpEventGroups = { 33333 }
//SomeIpNotifierEventGroups = { 222 }
}
}
define org.genivi.commonapi.someip.deployment for provider as SampleService {
instance sample.MessageBus as bus {
InstanceId = "test"
SomeIpInstanceID = 22136
}
}
Error:
<.>/capicxx-core-runtime/include/CommonAPI/OutputStream.hpp:121:47: error: no matching function for call to ‘CommonAPI::SomeIP::OutputStream::writeValue(const std::vector<v1::sample::CommonType::Item>&, const CommonAPI::EmptyDeployment*&)’
And there are two more errors:
<.>/src-gen/v1/sample/MessageBusSomeIPStubAdapter.hpp:79:36: error: ‘DataDeployment’ is not a member of ‘v1::sample::CommonType_’
<.>/src-gen/v1/sample/MessageBusSomeIPStubAdapter.hpp:102:128: error: ‘DataDeployment’ is not a member of ‘v1::sample::CommonType_’
By the way, src-gen/v1/sample/MessageBusStubDefault.cpp
is not generated and I removed it from CMakeLists.txt
.
Here is a work around (NOT solution) from my colleague: replace the array with a map.
In the sample I provided before, replace:
struct ValueB extends ValueBase {
Item [ ] items
}
With:
map ItemMap {
Int16 to Item
}
struct ValueB extends ValueBase {
ItemMap items
}
Hello, I'm studying the SOME/IP by following the Wiki but encontered a compile error and I have no idea about how to solve it.
The
.fidl
file:After generating code with commonapi-generator and commonapisomeip_generator, I compiled my test code but failed with:
I haven't dive into CommonAPI yet but it seems that the server write
ValueBase
with anEmptyDeployment
, which doesn't work with array. The compile error won't occur if I removeValueB
and keepValueA
. Should I add something to the.fdepl
file or replace thevalue
inData
with a byte buffer and serialize theValueA
andValueB
by myself?