mavros-output \- output of the MAVROS ASN.1 compiler


#include "asn1.h"

#include ".h"

asn1 XXXXXX_cod(area,type_scope,type_number,argument_list)
asn1 area;
int type_scope;
int type_number;

asn1 XXXXXX_dec(area,area_limit,argument_list)
asn1 area, area_limit;


asn1_uint32 XXXXXX_len(type_number,argument_list)
int type_number;

char \(**XXXXXX_out(area, argument_list)
char \(**area;

char \(**XXXXXX_in(area, area_limit, argument_list)
char \(**area, \(**area_limit;

int XXXXXX_olen(argument_list)

void XXXXXX_cpy(target_argument_list,source_argument_list)

int XXXXXX_cmp(argument_list_1,argument_list_2)

asn1_uint32 XXXXXX_hash(h,argument_list) asn1_uint32 h;

int XXXXXX_stp(argument_list)


For every data type, MAVROS will generate four 'C' procedures for the basic coding and decoding functions, a subtype verification routine, plus optionally text coding and decoding routines, copying, comparison and hashing routines.

The list of procedures above mentions the data types:

In all these declarations, the string XXXXXX will indeed be replaced by the actual name of the data-type, as declared in the MAVROS input.

The four basic coding routines perform the following functions:

All these routines include in their argument list the list of arguments which was passed in the MAVROS declaration, whith the following precisions: When the -a argument is present, MAVROS will generate text coding and decoding routines, which will take the same C arguments as the ASN.1 coding and decoding routines, but will generate a null terminated text string of the form:
orname = <
C= "FR";
PersonalName = <
Surname= "Huitema";
GivenName= "Christian">>

For each data type, MAVROS will generate three routines:

There is no specific memory deallocation routine for the text syntax. The routine XXXXXX_free should be used to release the memory allocated during the decoding, when the data are not anymore needed. It should also be used after an error detection.

If the -c argument is present, MAVROS will generate copying, comparison and hashing routines:


mavcod (9x),
mavros (9x),
mavros-input (9x),
C. Huitema, "General Presentation of the MAVROS Compiler" ,INRIA, 1990


Application programmers may be tempted to use the XXXXXX_free routines to free the input of coding functions, e.g. after formatting a message. This may not yeld the expected results, except if the data have been produced by a decoding or a copying procedure: MAVROS uses its own memory allocation procedures, described in the asn1_malloc manual.

MAVROS may decide to encode some procedures by using macros rather than actual procedures. When one needs a real function, e.g. to insert it in a table of functions, this can be prevented by declaring the type in the list of exported variables, in the MAVROS input.