COVESA / capicxx-someip-tools

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

BUG of structure nesting #25

Closed thun-res closed 8 months ago

thun-res commented 2 years ago

fidl:

package commonapi

interface DCusInterfaces {
    version { major 1 minor 0 }
    struct Domain {
        String name
    }
    struct Detail {
        Domain domain
    }
}

fdepl:

import "platform:/plugin/org.genivi.commonapi.someip/deployment/CommonAPI-SOMEIP_deployment_spec.fdepl"
import "DCusInterfaces_1.fidl"

define org.genivi.commonapi.someip.deployment for interface commonapi.DCusInterfaces {
    SomeIpServiceID = 15068
    struct Domain {
        SomeIpStructLengthWidth = 4
        name {
            SomeIpStringLengthWidth = 4
            SomeIpStringLength = 16
            SomeIpStringEncoding = utf8
        }
    }
    struct Detail {
        SomeIpStructLengthWidth = 4
    }
}

define org.genivi.commonapi.someip.deployment for provider as Service {
    instance commonapi.DCusInterfaces {
        InstanceId = "commonapi.DCusInterfaces"
        SomeIpInstanceID = 26068
    }
}

When I compile, I get the following error, It looks like an error caused by adding an extra prefix.:

/work1/test/gen/src/v1/commonapi/DCusInterfacesSomeIPDeployment.cpp:19:116: Error:‘Detail_domain_Domain_nameDeployment’ is not a member of ‘v1::commonapi::DCusInterfaces_’; did you mean ‘Detail_domainDeployment’?
   19 | Interfaces_::DomainDeployment_t Detail_domainDeployment(4, &::v1::commonapi::DCusInterfaces_::Detail_domain_Domain_nameDeployment);

When I do not specify SomeIpStringLength, the compilation passes: fdepl:

import "platform:/plugin/org.genivi.commonapi.someip/deployment/CommonAPI-SOMEIP_deployment_spec.fdepl"
import "DCusInterfaces_1.fidl"

define org.genivi.commonapi.someip.deployment for interface commonapi.DCusInterfaces {
    SomeIpServiceID = 15068
    struct Domain {
        SomeIpStructLengthWidth = 4
        name {
            SomeIpStringLengthWidth = 4
            #SomeIpStringLength = 16 //Remove this line
            SomeIpStringEncoding = utf8
        }
    }
    struct Detail {
        SomeIpStructLengthWidth = 4
    }
}

define org.genivi.commonapi.someip.deployment for provider as Service {
    instance commonapi.DCusInterfaces {
        InstanceId = "commonapi.DCusInterfaces"
        SomeIpInstanceID = 26068
    }
}

Thanks

goncaloalmeida commented 10 months ago

hello, this issue is still occurring with the last release?