I'm starting to use the pyasn1 library and I have a question on how to set default values in a SEQUENCE OF object. My ASN1 structure is the following:
Asn1Def DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
CasinoPlayer ::= SEQUENCE
{
name UTF8String (SIZE(1..16)),
luckyNumbers SEQUENCE (SIZE(3)) OF INTEGER DEFAULT {7,7,7}
}
END
I understood how to create a DEFAULT field in the CasinoPlayer SEQUENCE using namedtype.DefaultedNamedType objects and using subtype to add SIZE constraint but how shall I initialize the default value {7,7,7}?
Thank you
I am thinking it should look like this:
Plus you probably need to assign the tags to each ASN.1 type (as it's implied by the AUTOMATIC TAGS clause).
UPDATE:
Actually, this should work, but it does not! Luckily, there is the fix which should make defaulted
SequenceOfpropagating to theSequencefield for as long as it's aDefaultedNamedType.