Exmbus.Parser.Apl.DataRecord (Exmbus v0.3.0)

View Source

Parser for a DataRecord.

Summary

Functions

Decodes a single DataRecord from a binary.

decodes a value associated with a given header.

Returns the unit for a DataRecord as a string. This string will have any relevant extensions added it to, so it might differ from the raw unit in the header's Value Information Block.

Retrieve the simplified value of the DataRecord. The value is calculated from the decoded data, modified with added extensions found in the header.

Types

t()

@type t() :: %Exmbus.Parser.Apl.DataRecord{
  data: term(),
  header: Exmbus.Parser.Apl.DataRecord.Header.t()
}

Functions

compact_profile?(data_record)

See Exmbus.Parser.Apl.DataRecord.CompactProfile.compact_profile?/1.

compact_profile_records(data_record, all_records)

See Exmbus.Parser.Apl.DataRecord.CompactProfile.compact_profile_records/2.

expand_compact_profile(data_record, ctx)

See Exmbus.Parser.Apl.DataRecord.CompactProfile.expand_compact_profile/2.

parse(bin, ctx)

Decodes a single DataRecord from a binary.

parse_data(header, bin)

decodes a value associated with a given header.

to_map!(dr)

unit(arg1)

Returns the unit for a DataRecord as a string. This string will have any relevant extensions added it to, so it might differ from the raw unit in the header's Value Information Block.

unit!(record)

unparse(data_record)

unparse_data(map, data)

value(dr)

@spec value(t()) :: {:ok, value :: term()} | {:error, reason :: term()}

Retrieve the simplified value of the DataRecord. The value is calculated from the decoded data, modified with added extensions found in the header.

value!(record)