COVESA/capicxx-core-tools

Example E03Methods - suspicious error enumeration

Closed this issue · 1 comments

When running the commonapi-core-generator on the .fidl code in CommonAPI-Examples/E03Methods/README the generated header file includes some suspicious code for the error enumeration.

Input:

package commonapi.examples

interface E03Methods {

	version { major 1 minor 2 }

	method foo {
		in {
			Int32 x1
			String x2
		}
		out {
			Int32 y1
			String y2
		}
		error {
			stdErrorTypeEnum
	   	}
	}

	broadcast myStatus {
		out {
			Int32 myCurrentValue
		}
	}

	enumeration stdErrorTypeEnum {
		NO_FAULT
		MY_FAULT
	}
}

Generated E03Methods.hpp:
...

    struct stdErrorTypeEnum : CommonAPI::Enumeration< uint8_t> {
        enum Literal : uint8_t {
            NO_FAULT = 0,
            MY_FAULT = 1
        };

...

    struct fooError : CommonAPI::Enumeration< uint8_t> {
        enum Literal : uint8_t {
            stdErrorTypeEnum = 0
        };

...

I don't really know what I am expecting here, but I am surprised that there are two enum lists defined here - from the FIDL it looks like fooError should somehow refer to stdErrorTypeEnum rather than (re?)define it with a value of 0.

E03_fidl.txt
E03Methods_hpp.txt

Could not recreate this problem.