Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

DBUS generated code of enumeration type error(default uint8_t) #79

Open
DKSH10 opened this issue Nov 25, 2024 · 0 comments
Open

DBUS generated code of enumeration type error(default uint8_t) #79

DKSH10 opened this issue Nov 25, 2024 · 0 comments

Comments

@DKSH10
Copy link

DKSH10 commented Nov 25, 2024

Hello,
I am facing the same issue for commonapi-dbus-runtime . Below are the details.
Commonapi version:- 3.2.0
dbus:- 1.10.20

Issue:
Step 1: We have define enums as follows in the fidl file (types.fidl)

*/
enumeration ReturnValue_enum {
NOK = -1
OK = 0
INVALID = 260
}

Step2: We faced the compilation error as overflow because the default backingtype for enum in 3.2.0 is uint8_t.
Step 3: Used deployment.fdepl to resolve the compilation issue (set default backend type to int32_t). The deployment.fdepl content is as below.

**import "CommonAPI-4_deployment_spec.fdepl"
import "types.fidl"

define org.genivi.commonapi.core.deployment for typeCollection example.abcd.Types {
enumeration ReturnValue_enum {
EnumBackingType = Int16
}
}**

Step 4: For the specific enum where the backend type is int16_t we see the signature i still as "y"(byte) where as the payload is 2 byte.This results in the disconnection of dbus with error as corrupted message. Below are the contents for the error.

Corrupted message stream, disconnecting
Disconnect transport.

Step 5 : Generate:

execute_process(COMMAND ..../commonapi-generator/commonapi-core-generator-linux-x86_64 -sk -d ${DEST_PATH}${fidl_name} ${FIDL_DIR}/${FIDL_PATH} ${FIDL_DIR}/deployment.fdepl RESULT_VARIABLE res)
execute_process(COMMAND ...../commonapi_dbus_generator/commonapi-dbus-generator-linux-x86_64 -dest ${DEST_PATH}${fidl_name} ${FIDL_DIR}/${FDEPL_PATH} RESULT_VARIABLE res)

Please suggest if something has been missed in the deployment.fdepl.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant