I have a question about working with CHOICE alternative using libtasn1.
Consider simple example. Here is test.asn file:
TestType ::= SEQUENCE {
A INTEGER,
F MyChoice
}
MyChoice ::= CHOICE {
V1 INTEGER,
V2 OCTET STRING
}
END
Firstly, I want to work with V2 alternative:
asn1_node tree = NULL, node = NULL;
char error_string[1024];
asn1_parser2tree("test.asn", &tree, error_string);
asn1_create_element(tree, "TEST.TestType", &node);
asn1_write_value(node, "F", "V2", 1);
asn1_write_value(node, "F.V2", "abc", 3);
// Some other operations here ...
Then I want to use the same structure (node), but with "V1" alternative.
Unfortunately asn1_write_value(node, "F", "V1", 1); returns ELEMENT_NOT_FOUND now. What is the right way to change V2 to V1?
--
Best regards,
Alevtina Glonina