Skip to content

Support BER long-form length encoding in AARE parsing #116

Description

@marco92

Pull request: #115

In the Application Association Response (AARE, aare.py), only ASN.1 BER short-form length encoding was previously supported. This caused parsing to fail for responses using long-form length encoding.

This change adds automatic detection of BER short-form vs long-form length encoding and correctly parses the length in both cases.

Reference (ASN.1 BER length encoding):
https://www.oss.com/asn1/resources/asn1-made-simple/asn1-quick-reference/basic-encoding-rules.html

This improves compatibility with DLMS/COSEM devices that encode AARE APDUs using BER long-form lengths.

Issue observed on "Kamstrup OMNIA® e-meter" and fix tested successfully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions