TBCD and BCD Strings

TBCD and BCD strings represent telephony digits using one nibble per digit. In TBCD strings, the low nibble represents a digit that precedes the high nibble. To get a nicer string representation for these octet strings (giving the digits rather than the binary content), ASN1C has classes Asn1BCDString and Asn1TBCDString, which are subclasses of Asn1OctetString. ASN1C will automatically treat the following types as BCD/TBCD strings by using the alternative subclass to represent the type:

Additionally, you can use a configuration file and the isTBCDString element to apply this special treatment to other types.

This special treatment of BCD and TBCD strings can be disabled using the -noTBCD or -noBCD command-line option; these two options are equivalent and either option disables special treatement in both cases. Use of this option is necessary for certain specifications, which use the above type names for types that are not strictly TBCD strings.