-
Notifications
You must be signed in to change notification settings - Fork 65
Issue334 #335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
There are two problems here. The first one is the compiler crash you reported. The second one concerns issues with the provided ACN grammar. 1. Compiler CrashTo illustrate the problem, I've included a simplified part of the grammar you sent (some fields were removed for readability): CfdpPDU ::= SEQUENCE {
pdu-header PDUHeader,
payload OCTET STRING (CONTAINING PayloadData)
}
PayloadData ::= CHOICE {
file-directive FileDirectiveType,
file-data FileDataType
}
FileDataType ::= SEQUENCE {
file-data-pdu FileDataPDU
}CfdpPDU [] {
pdu-header [] {
pdu-type PDUType [encoding pos-int, size 1],
pdu-data-field-length PDUDataFieldLength [encoding pos-int, size 16]
},
payload [size pdu-header.pdu-data-field-length] {
file-directive [present-when pdu-header.pdu-type == 0],
file-data <pdu-header.pdu-data-field-length> [present-when pdu-header.pdu-type == 1]
}
}
FileDataType <PDUDataFieldLength: pdu-data-field-length> [] {
file-data-pdu <pdu-data-field-length> []
}In this example:
However, since PayloadData [] {
file-directive [],
file-data []
}This default specification is problematic because the Temporary SolutionI modified the compiler so that, instead of crashing, it now generates an error message indicating that the dataview.asn:185:13: error: ACN parameters and arguments do not match. Expected 1 parameter but got 0 arguments. Reftype is FileDataTypeHowever, note that the error message references the ASN.1 file ( 2. ACN Grammar IssuesTo resolve the above issue, I modified the ACN grammar as follows: CfdpPDU [] {
pdu-header [] {
version NULL [pattern '000'B],
pdu-type PDUType [encoding pos-int, size 1],
direction [encoding pos-int, size 1],
transmission-mode [encoding pos-int, size 1],
crc-flag [encoding pos-int, size 1],
large-file-flag NULL [pattern '0'B],
pdu-payload-length INTEGER [encoding pos-int, size 16], -- Added to specify payload length explicitly
pdu-data-field-length PDUDataFieldLength [encoding pos-int, size 16],
segmentation-control NULL [pattern '0'B],
length-of-entity-ids LengthOfEntityIds [encoding pos-int, size 3], -- TODO: Add mapping-function
segment-metadata-flag NULL [pattern '0'B],
length-of-transaction-sequence-number LengthOfTransactionSequenceNumber [encoding pos-int, size 3], -- TODO: Add mapping-function
source-entity-id [size length-of-entity-ids],
transaction-sequence-number [size length-of-transaction-sequence-number],
destination-entity-id [size length-of-entity-ids]
},
payload <pdu-header.pdu-data-field-length, pdu-header.pdu-type> [size pdu-header.pdu-payload-length]
}
PayloadData <PDUDataFieldLength: pdu-data-field-length, PDUType: pdu-type>[] {
file-directive [present-when pdu-type == 0],
file-data <pdu-data-field-length> [present-when pdu-type == 1]
}The main change here is that the During testing, I encountered another runtime encoding issue. After debugging, I realized that the field However, encoding still fails at runtime. The cause is that the To avoid this issue, you should modify the ASN.1/ACN grammar to ensure that the Additionally, please ensure you update your compiler to the latest version 4.6.0.4 to apply these improvements and resolve the reported issues. |
#334