Thoughts on the current state of ASN.1 and XML technologies.

The ASN1C Visual Studio Wizard

You may or not be aware that ASN1C includes a Visual Studio Wizard that you can use from Visual Studio to build a library from one or more ASN.1 files. If you have at least ASN1C v732, the wizard is present and usable.

The files for the wizard are in the vswizard folder of your ASN1C installation. There are three files here that are the components of the wizard: ASN1CWizard.ico, ASN1CWizard.vsdir, and ASN1CWizard.vsz. There is also a README.txt file here that provides instructions for configuring and installing the wizard. One of the steps is to modify the .vsz file, and note in particular the instructions to remove the comment-like lines that are at the top. In ASN1C v7.4, which will likely be released in January, this .vsz file will be generated during the installation, and there will no longer be a need to edit it.

Once the files for the wizard are correct and in place, you can use Visual Studio to create a new project just like you normally would, but now you can choose ASN1C as the project type. The wizard will invoke the ASN1C GUI, with some of the irrelevant options disabled. You can use the GUI to choose the ASN.1 files and define how you want the code to be generated for your library. Then you click on the Compile button to generate the code and a Visual Studio project file. Once you exit the GUI, the project file will be loaded into Visual Studio.

No Comments

Missing DLL Error When Trying to Start ASN1VE on Windows

If you’re running a Windows system with a version of the operating system that’s older than Windows 10, there’s a chance you’ll see a pop-up box like this if you install and try to start ASN1VE:

The missing DLL is part of the Visual Studio 2015 redistributable kit. If this error occurs, it means your Windows system doesn’t have this kit.

You can download the kit and install it from here.

No Comments

New ASN1VE and ASN2TXT releases for 2019

New major releases of our ASN1VE and ASN2TXT products are now available. The primary new feature added to each is support for the new ASN.1 JSON Encoding Rules (JER) as documented in the ITU-T X.697 standard that was made public last fall. ASN1VE now has a JSON tab that shows the JSON encoding for any binary message type. In addition, the Import and Export options under the File pulldown menu allow export to, or importing from JSON. ASN2TXT support translations in both directions (binary -> JSON and JSON -> binary).

Other improvements to ASN1VE included the following:

  • Added the capability to display and edit the contents of OCTET or BIT STRING types with contents constraints (CONTAINING constructs) using the inner contained type.
  • Added level to the tag search dialog to make it possible to search for tags at a given level instead of at any level.
  • Improved PDU tag matching for BER/DER messages with UNIVERSAL tags (common in ASN.1 used in security specifications). This makes it easier to find the PDU type of a message if it is not known.
  • Changed the Windows and Mac installation procedures to install the executable files in the Program Files area and sample programs in the User area. On Windows, sample programs are now copied to the user’s Documents directory under the ASN1VE folder.

For ASN2TXT, the capability do tag path filtering was another new feature that was added. This makes it possible to find and output elements in textual form if the full ASN.1 specification is not available. This capability was further described in this blog post.

Further details can be found in the release notes:

ASN1VE Release Notes
ASN2TXT Release Notes

No Comments

Easy V2X Conversions with Python

You can now use Python and our V2X ASN.1 API to easily convert binary V2X messages to text – whether JSON or XML – and vice versa.

Our V2X API is a C++ API, but the latest update provides a Python wrapper that can be used to convert V2X ASN.1-encoded data. There are three classes, each with methods for converting between binary (unaligned PER) and text (JSON or XML), in either direction.  The classes are:

  • For SAE J2735 DSRC (Dedicated Short Range Communications):
    • MessageFrame
  • For ETSI ITS:
    • CAM (Cooperative Awareness Message), ETSI EN 302 637-2
    • DENM (Decentralized Environmental Notification Message), ETSI EN 302 637-3

The API kit includes a sample Python program that handles things like using files for input/output and working with hexadecimal representations of the binary data, but at the end of the day, the conversion itself is simple, using one of the following function calls:

  • binary to JSON: buf = cls.to_json(inp_data, len(inp_data))
  • binary to XML: buf = cls.to_xml(inp_data, len(inp_data))
  • JSON to binary: buf = cls.from_json(inp_data)
  • XML to binary: cls.from_xml(inp_data)

(where cls is one of the provided classes: MessageFrame, CAM, or DENM.)

Download our V2X ASN.1 API and give it try!  Be sure to choose one of the 64-bit downloads, as the Python wrapper is not available for 32-bit systems.  Full documentation for the API is available on our website and included in the download.

No Comments

ASN.1 Tag Path Filtering in ASN2TXT

The latest release of our ASN.1 to Text Translation Tool (ASN2TXT) contains a new feature called “tag path filtering”. The purpose of this is to allow users to target specific items within a BER-encoded message without the need for full ASN.1 schema information. One use case for this would be the case where a user has a Call Detail Record (CDR) specification which has snippets of ASN.1 code, but which does not have the full specification. Another use case is where the user has the full specification, but is only interested in accessing a few specific items within the encoded data.

The way it works is the “tag path” to specific elements within the message is specified in an XML file along with other information such as the data type of the item and names to be used. The tag path is a concatenated list of ASN.1 tag values using a special compact syntax. So instead of using the full name for a tag such as [UNIVERSAL 22], only the first letter of the tag class would be used and there would be no space between the letter and the tag number. Therefore, [U22] would be the shorthand name for this tag.

In addition to the tag path, the following items can be used in a tag path specification:

  • name – a name that will be used in some types of output formats in place of the generated tag name.
  • type – the data type of the element used to format the value for output.
  • value – a textual value that would replace the actual data at the tag location.

The specification of a complete tag path is expressed in XML as follows:

  <path> path in tag path format </path>
  <name> name of the element </name>
  <type> data type of the element </type>
  <value> value to use for the element </value>

A tag path filter consists of one or more of these elements wrapped in an <asn1TagFilter> element.

This is just a brief summary of the basic idea behind tag paths. Full details can be found in the ASN2TXT User’s Manual in the section on ASN.1 Tag Path Filtering.

No Comments