OSS ASN.1 Tools for C - GUI Tutorial
Introduction
This tutorial gives an introduction to some of the features provided by the OSS ASN.1 GUI.
Creating a New Project
To start our tutorial, we need to begin by creating a blank project file and populating it with ASN.1 and other files. Select "Project->New" from the menu. This will start the new project wizard.

Enter a name (ex. Tutorial) for the new project. Click the browse button and select the location
(e.g., ".\Examples\Tutorial"). Click the "Create" button to create and save the new project.

Another pane is displayed where the user has the option to add files to the project. Click "Add files to the Project", browse to the ".\Examples\Tutorial" directory and add the file "Tutorial.asn". This file will appear under the folder "ASN.1 files". Multiple files can be added at the same time: Click "Add files to the Project" and select more than one of the encoded files in the tutorial directory while holding down the Ctrl key, (e.g., "TutorialPDU (mixedSequence).xer", "TutorialPDU (stringSelection).upr" and "TutorialPDU (mixedSequence).ber"). Click OK and the files will be listed under the "Encoded Files" folder. Click "Finish" to exit the project wizard.

Compiling your ASN.1 Syntax
To compile your ASN.1 specification, you should:
- Set the compiler option from the Compiler Options window by clicking Project->Compiler Options. Verify that the ASN.1 compiler options are set as you desire them. Be sure to click on the "Output Files" tab to specify a working directory in which you wish for output files to appear.
- Finally, start the ASN.1 compiler with your specification as input by clicking on the compile syntax button. The diagnostic output of the ASN.1 compiler should show up in the Output pane. Additionally, the files containing target language representations of the ASN.1 data structures and encoding/decoding information will be created in the working directory you specified in the previous step.
To perform a syntax check only on your ASN.1 specification without producing the output files, simply click on the –“Only perform syntax check without generating output files” option in the "Output Files" tab of the Settings window and then click the compile button. Or click the check syntax button.
Using the Module Tree and Syntax Editor
Now that we have an active project that contains ASN.1 files, we can start browsing the syntax with the Module Tree. Click on the Module Tree pane, expand the folders: "Tutorial-Examples", "DEFINITIONS" and the named type "Mixed Sequence". Double-click on "Mixed Sequence". The Syntax Editor will be opened with the cursor placed on the first line of the named type "Mixed Sequence". Double-clicking on any node in the module tree will navigate the user to the correct position in the syntax file.
Let's add a new named type, "Person", to the definitions:

Now save the ASN.1 file by selecting "File->Save" from the menu and refresh the Module Tree by selecting "View->Refresh". Our new definition will be listed in the Module Tree:

Creating a PDU with the Value Editor
We will create an encoded PDU, from scratch, with the Value Editor. Click on the "PDU List" pane to display all PDUs contained within the syntax. Right-click on "Person" and select "Edit Definition". The Value editor will open with the filename "Person (New File.upr)" as a caption and with all the values initialized. To modify values, click inside the cells that contain values in the value column. Click the checkbox to enable OPTIONAL components. Fill in the values: (REAL values can be entered as real numbers, i.e. "1.73" and strings can be entered without using quotation marks).

To change the encoding rule-set that is used, right-click inside the Value Editor and select a different encoding from the list that is displayed. Now save the file under a new name and encoding, i.e. "Person (John Doe).ber", add it to the project and save the project. The encoded data can also be exported to the trace or to the hex editor. To do this, right-click inside the Value Editor and select "Encode Value to Trace(hex)" or "Encode PDU to Hex Editor".
Copyright © 2010 OSS Nokalva, Inc. All Rights Reserved.