COVESA / capicxx-someip-tools

Common API C++ SOMEIP tooling
Mozilla Public License 2.0
76 stars 55 forks source link

Compile error related to enumeration definition inside of typeCollection with generator 3.2.0.1 #24

Closed arik000 closed 2 years ago

arik000 commented 2 years ago

Our fidl file: package com.conti.uisrv

interface qplayer { version { major 1 minor 0 }

attribute qplayerTypes.playStatus currentStatus
attribute qplayerTypes.playStatus targetStatus

}

typeCollection qplayerTypes { version { major 1 minor 0 }

enumeration playStatus {
    UNKNOWN = 0
    READY = 1
    PLAYING = 2
    PAUSED = 3
    FINISHED  = 4
    STOPPED = 5
}

} ########################################################################################## Our fdepl file: import "platform:/plugin/org.genivi.commonapi.someip/deployment/CommonAPI-SOMEIP_deployment_spec.fdepl"

import "qplayer.fidl"

define org.genivi.commonapi.someip.deployment for interface com.conti.uisrv.qplayer {

SomeIpServiceID = 4096

attribute currentStatus
{
    SomeIpGetterID = 400
    SomeIpSetterID = 401
    SomeIpNotifierID = 402
    SomeIpEventGroups =
    {   4000}
}

attribute targetStatus
{
    SomeIpGetterID = 403
    SomeIpSetterID = 404
    SomeIpNotifierID = 405
    SomeIpEventGroups =
    {   4000}
}

}

define org.genivi.commonapi.someip.deployment for provider CorePartition { instance com.conti.uisrv.qplayer { InstanceId = "Display0" SomeIpInstanceID = 256 } instance com.conti.uisrv.qplayer { InstanceId = "Display1" SomeIpInstanceID = 257 } instance com.conti.uisrv.qplayer { InstanceId = "Display2" SomeIpInstanceID = 258 } instance com.conti.uisrv.qplayer { InstanceId = "Display3" SomeIpInstanceID = 259 } instance com.conti.uisrv.qplayer { InstanceId = "Display4" SomeIpInstanceID = 260 } instance com.conti.uisrv.qplayer { InstanceId = "Display5" SomeIpInstanceID = 261 } } ########################################################################################## Error: qplayerSomeIPProxy.cpp:72:307: error: no member named 'playStatusDeployment' in namespace 'v1::com::conti::uisrv::qplayerTypes_

The reason is clear for me: generator (v3.2.0.1) generates the wrong type inside of the constructor: qplayerSomeIPProxy::qplayerSomeIPProxy( const CommonAPI::SomeIP::Address &_address, const std::shared_ptr &_connection) : CommonAPI::SomeIP::Proxy(_address, connection), currentStatus(this, CommonAPI::SomeIP::eventgroup_id_t(0xfa0), CommonAPI::SomeIP::event_id_t(0x192), CommonAPI::SomeIP::method_id_t(0x190), false, CommonAPI::SomeIP::reliability_type_e::RT_UNRELIABLE, false, CommonAPI::SomeIP::method_idt(0x191), false, &::v1::com::conti::uisrv::qplayerTypes::playStatusDeployment), targetStatus_(this, CommonAPI::SomeIP::eventgroup_id_t(0xfa0), CommonAPI::SomeIP::event_id_t(0x195), CommonAPI::SomeIP::method_id_t(0x193), false, CommonAPI::SomeIP::reliability_type_e::RT_UNRELIABLE, false, CommonAPI::SomeIP::method_idt(0x194), false, &::v1::com::conti::uisrv::qplayerTypes::playStatusDeployment) { } I compared qplayerSomeIPProxy.cpp, generated with generator 3.1.12.1 and the parameters for currentStatus_ generated properly: qplayerSomeIPProxy::qplayerSomeIPProxy( const CommonAPI::SomeIP::Address &_address, const std::shared_ptr &_connection) : CommonAPI::SomeIP::Proxy(_address, connection ) , currentStatus(this, CommonAPI::SomeIP::eventgroup_id_t(0xfa0), CommonAPI::SomeIP::event_id_t(0x192), CommonAPI::SomeIP::method_id_t(0x190), false, false, CommonAPI::SomeIP::method_id_t(0x191), false, staticcast< ::v1::com::conti::uisrv::qplayerTypes::playStatusDeployment_t >(nullptr)), targetStatus_(this, CommonAPI::SomeIP::eventgroup_id_t(0xfa0), CommonAPI::SomeIP::event_id_t(0x195), CommonAPI::SomeIP::method_id_t(0x193), false, false, CommonAPI::SomeIP::method_id_t(0x194), false, staticcast< ::v1::com::conti::uisrv::qplayerTypes::playStatusDeployment_t >(nullptr)) { }

For verification I shifted qplayerTypes enumeration from typeCollection into interface description and it will solve the problem, but of course requires the changes in source code.

Is the issue already known ?

arik000 commented 2 years ago

Solved adding follow section to fdepl file: define org.genivi.commonapi.someip.deployment for typeCollection com.conti.uisrv.qplayerTypes { enumeration playStatus { } }