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.
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.