Crc in the child packet #319
Replies: 3 comments
-
Packet ::= SEQUENCE { --add post encoding property in ACN } SrcAndDesAdd ::= OCTET STRING (SIZE (1..7)) Header ::= CHOICE { Something like that I mean can solve the problem |
Beta Was this translation helpful? Give feedback.
-
If I have a variable size type in body and it's size declare by the external field in header then I can not pass size to it |
Beta Was this translation helpful? Give feedback.
-
May be if we have just a property to returning position of a specefic field we would be more powefull // Suggestion// Packet ::= SEQUENCE { CrcHeader ::= OCTET STRING (SIZE (2)) Child ::= CHOICE { FirstPacket ::= SEQUENCE { -- Imaginary ACN -- FirstPacket ::= SEQUENCE { When the user encode/decode it with Packet then we will return crcHeaderr position + offset And calculating the offset is not complicated because you will just add what ever you encode before calling FirstPacket_ACN_encode in function Packet_ACN_encode Maybe passing an extra argument as a int* to Packet_ACN_encode (.... , int * returned_positions) is enough for that I think this is better approach to handling post encoding situations |
Beta Was this translation helpful? Give feedback.
-
Hello , suppose that I have a structure like this :
Pdu DEFINITIONS AUTOMATIC TAGS ::= BEGIN
AddressSize ::= INTEGER (0..7)
HeaderSize ::= INTEGER (0..31)
Packet ::= SEQUENCE {
--Common fields
field1 INTEGER(0..255) ,
--Common fields
child Child
}
SrcAndDesAdd ::= OCTET STRING (SIZE (1..7))
Child ::= CHOICE {
first First,
second Second
}
FirstPacket ::= SEQUENCE { --in this PDU HeaderSize is always const excluding SrcAndDesAdd <We don't consider SrcAndDesAdd>
--Because nobodies size depends on sizeHeader we declare it in ASN
--Size of Address Field 3 bits: must declare in ACN
sizeHeader HeaderSize,
srcAndDesAddress SrcAndDesAdd,
crcHeaderr CrcHeader
}
CrcHeader ::= OCTET STRING (SIZE (2))
SegmentCrc ::= OCTET STRING (SIZE (4))
SecondPacket ::= SEQUENCE { --In this case size of header is var + consult so we declare it in ACN and by using the mapping function
add an offset for it
--Size of Address Field 3 bits: must declare in ACN
--Size of Header Field 5 bits: must declare in ACN
srcAndDesAddress SrcAndDesAdd,
var Var,
crcHeaderr CrcHeader
}
Var ::= OCTET STRING (SIZE (0..16))
END
Is it possible to calculate crcHeaderr in the child packets <FirstPacket , SecondPacket> ?
This scenario happen when I want have access to common fields that are exist in Packet and also what are exist for Child Packet
As I see for solving this problem I should change my structure to body and header for all childs and after header add crc in the Packet type instead of adding it in all children. Am I right?
Beta Was this translation helpful? Give feedback.
All reactions