Skip to content

How to extract A2L specific parameters #7

@MatinF

Description

@MatinF

Thanks for a great library!

I am trying to use the library in parsing A2L files for XCP on CAN use cases.

As part of this, I am trying to extract the below parameters in a consistent way across A2L files:

xcp_parameters = {"MAX_CTO": None, "MAX_DTO": None, "CAN_ID_MASTER": None, "CAN_ID_MASTER_EXTENDED": None, "CAN_ID_SLAVE": None, "CAN_ID_SLAVE_EXTENDED": None, "XCP_VERSION": None, "BYTE_ORDER": None}

I seem partially able to do this via e.g. looking at sections like below:

ast["PROJECT"]["MODULE"]["IF_DATA"]["XCP_ON_CAN"]["DataParams"]

And doing some ad hoc indexing. However, it seems to not be a stable way to do it - and I am wondering if there is a better method. For example, it seems like information such as MAX_DTO and MAX_CTO values are hard to extract via the methods I am trying to use. It would be greatly appreciated if you have suggestions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions