MyTest DEFINITIONS ::=
BEGIN
Client ::= CHOICE {
clientInt INTEGER,
clientStr OCTET STRING,
clientOID OBJECT IDENTIFIER
}
END
Client_t *newClient; //new client struct
newClient = calloc(1, sizeof(Client_t));
asn_enc_rval_t encode_rtn;
printf("input integer: ");
scanf("%d", &((*newClient).choice.clientInt));
encode_rtn = der_encode_to_buffer(&asn_DEF_Client, newClient,
send_buffer, BUFFER_SIZE);
if (encode_rtn.encoded == -1){
printf("Error while encoding %s: %s\n", encode_rtn.failed_type->name, strerror(errno));
exit(1);
}
Hi, there. This code can be compiled, but I always get "Client: Error 0" after I input an integer. What exactly is error 0? Thank you.
What i'm trying to do is encode the integer using BER to a serial sequence of bytes and store in the send buffer. I start using asn1 compiler today. The only doc I read is Using the Open Source ASN.1 Compiler, and it doesn't provide much information. I will appreciate if you can provide me useful information.
The documentation for the compiler is http://lionet.info/asn1c/documentation.html