
Using the GUI Wizard to Run ASN1C
The Windows version of ASN1C includes a graphical user interface (GUI) wizard that can be used as an alternative to the command-line version. This makes it possible to specify ASN.1 files and configuration files via file navigation windows, to set command line options by checking boxes, and to get online help on specific options.
The Windows installation program should have installed an `ASN1C Compiler' option on your computer desktop and an `ASN1C' option on the start menu. The wizard can be launched using either of these items. The following shows the initial Window that is displayed:
In this window, the ASN.1 file or files to be compiled are selected. This is done by clicking the "Add" button on the right hand side of the top windows pane. A file selection box will appear allowing you to select the ASN.1 files to be compiled. Files can be removed from the pane by highlighting the entry and clicking the "Remove" button.
Include directories are selected in a similar manner in the middle pane. These are directories the compiler will search for import files. By default, the compiler looks for files in the current working directory with the name of the module being imported and extension ".asn". Additional directories can be searched for these files by adding them here.
User defined configuration files are specified in the third pane. These allow further control of the compilation process. They are optional and are only needed if the default compilation process is to be altered (for example, if a type prefix is to be added to a generated type name). See the Compiler Configuration File section for details on defining these files.
After specification of these files and directories is complete, click the `Next' button to proceed to the next window.
In this window, the encoding rules, target language, and ASN.1 syntax version (1990 or later) options are specified. Encoding rules are BER/DER, PER, XER or XML and can be specified using check boxes. This allows multiple sets of rules to be specified for a single compiler run. Target language and syntax version have radio button controls that only allow a single choice in each of these categories to be specified. It is required that at least one item from each of these categories be specified. Once these items have been specified, click `Next' to proceed to the next window.
This dialog contains additional optional tabs that allow code reduction options, code addition/alter options, PRO version options and other options to be specified. Select the Code Reduction Options tab. These options reduce the amount of code generated at the expense of some features that are normally added to the code. Click on `Help' to get a summary of what each of these options do or read the section Running ASN1C from the Command-line. All of these items are optional. Some items will be grayed-out if they are not applicable to the encoding rules / language combination selected on the previous page.
This tab contains additional optional items that allow additional code to be generated and that alters the type of code generated in some cases to be specified. Named bit macros control the generation of special macros for setting, clearing and testing bits in BIT STRING types. Print routines are special functions for printing the contents of generated type variables. Trace diagnostic messages are added to encode/decode functions to trace the sequence of function calls used in the encoding or decoding of a message.
The `Generate static elements' option is used to add static elements to CHOICE constructs instead of pointer values.
The `Generate code compatible ...' option is for generating code compatible with an older release of the compiler.
The `Generate code for main file and dependent IMPORT items' option adds the -depends option which causes code in the main file to be compiled as well as all of the dependent items from imported modules.
The `Automatically generate unique names to resolve name clashes' option cause unique names to be generated in instances where items in different modules have the same name.
Click on `Help' to get a summary of what each of these options do or read the section Running ASN1C from the Command-line. All of these items are optional. Some items will be grayed-out if they are not applicable to the encoding rules / language combination selected on the previous page.
Click on `Help' to get a summary of what each of these options do. All of these items are optional. Some items will be grayed-out if they are not applicable to the encoding rules / language combination selected on the previous page.
The `Output Directory Name' control at the bottom of the page allows you to specify where your generated code will be stored. By default, this is the same directory as the ASN.1 source files. A different output can be selected by either typing the name directly into the box or clicking the "[ ... ]" button to open a file navigation window.
This window is specific to the target language (C/C++, Java, or XML Schema) that was selected earlier. The window shown here is for C/C++. If Java or XML Schema was selected, a different window will be presented allowing selection of options specific to those languages.
The C/C++ window allows additional code generation options and output filenames to be chosen. The output filenames are optional; the compiler will create default names using the name of the ASN.1 modules being compiled. Once again, options may be grayed out based on selections made on previous pages. Click `Next' to move to the next window.
This allows options specific to XML Schema to be selected. The user can specify that annotation application information (<appinfo>) be added for ASN.1 tag values. This application information can be used by an XML data binding application to generate BER or DER encoders/decoders directly from the schema definition.
The user can also specify that the generated schema be compatible with the ASN.1 XML encoding rules (XER). By default, the generated schema is compatible with the standard XML schema types.
As can be seen, the GUI has constructed an ASN1C command-line using the specified options. The user can now click `Compile' to execute the compilation. The `Back' button can be used to step back through the sequence of screens in order to change any of the previous inputs.
Objective Systems, Inc.102 Pickering Way, Suite #506Exton, Pennsylvania 19341 http://www.obj-sys.com Phone: (484) 875-9841 Toll-free: (877) 307-6855 (US only) Fax: (484) 875-9830 info@obj-sys.com |