The following is a hands-on example of asn2dataModel
usage:
AVALON:~/ASSERT$ asn2dataModel Usage: asn2dataModel <options> input1.asn1 [input2.asn1]... Where options are: -verbose Increase verbosity of output -lexonly Perform only lexical analysis -ignoreINTEGERranges Don't check INTEGERs for mandatory constraints -ignoreREALranges Don't check REALs for mandatory constraints -o dirname Directory to place generated files And one of: -toAda (for Ada) -toC (for C) -toOG (for SDL) -toSCADE5 (for SCADE5) -toSCADE6 (for SCADE6) -toSIMULINK (for Simulink) AVALON:~/ASSERT$ ls -l total 12 -rw-r--r-- 1 root root 716 2007-02-21 13:29 PosData.asn1 AVALON:~/ASSERT$ asn2dataModel -toSIMULINK PosData.asn1 AVALON:~/ASSERT$ ls -l total 16 -rw-r--r-- 1 root root 716 2008-07-29 13:29 PosData.asn1 -rw-r--r-- 1 root root 10289 2008-07-29 16:17 Simulink.PosData.asn1.m AVALON:~/ASSERT$ cat Simulink.PosData.asn1.m WorldCoordinate = Simulink.AliasType; WorldCoordinate.BaseType = 'uint8'; WorldCoordinate.Description = 'range is [0L, 10L]'; ...By simply invoking
asn2dataModel
and passing the ASN.1 grammar argument,
the data model mapper will create the requested equivalent definitions of the ASN.1 types
(in the example above, Simulink types, since -toSIMULINK was used).