BinStruct.BuiltIn.Asn1 (bin_struct v0.2.16)

Asn1 is BinStructCustomType and it uses erlang asn1 compiler output as implementation.

Asn1 modules and types can be compiled using this command

erlc -o "$OUTPUT_DIR" -I "$OUTPUT_DIR" +noobj -bper +maps +undec_rest TEST-ASN1.asn1

+maps is optional, change -bper to your target encoding (erlang compiler support BER, PER and so on) +undec_rest is required to current BinStructCustomType implementation, but this may be non-ideal and sometimes shadow errors in data, returning :not_enough_bytes instead

defmodule Struct do
  use BinStruct

  alias BinStruct.BuiltIn.Asn1

  field :asn1, { Asn1, asn1_module: :"TEST-ASN1", asn1_type: :"SimpleType" }
end

Summary

Functions

dump_binary(unmanaged, custom_type_args)

from_managed_to_unmanaged(managed, custom_type_args)

from_unmanaged_to_managed(unmanaged, custom_type_args)

init_args(custom_type_args)

known_total_size_bytes(custom_type_args)

module_code()

parse_exact_returning_options(bin, custom_type_args, options \\ nil)

parse_returning_options(bin, custom_type_args, opts)

size(unmanaged, custom_type_args)