# `IEC60870.InformationObject`
[🔗](https://github.com/Ultraluv/ex_iec60870/blob/main/lib/iec60870/information_object.ex#L1)

Unified dispatcher and helper functions for all IEC 60870-5-101/104 Information Objects.

# `t`

```elixir
@type t() :: struct()
```

# `decode_payload`

```elixir
@spec decode_payload(IEC60870.Types.TypeID.t(), non_neg_integer(), binary()) ::
  {:ok, t(), binary()} | {:error, term()}
```

Decodes an Information Object payload for a known `type_atom` and `ioa`.

# `encode`

```elixir
@spec encode(t(), IEC60870.AppLayerParameters.t(), boolean()) :: binary()
```

Encodes an Information Object into binary.
If `include_ioa?` is true, prepends the encoded IOA (`1..3` bytes per `params`).
For sequence elements (`SQ=1`, element index > 0), `include_ioa?` is `false`.

# `encode_payload`

```elixir
@spec encode_payload(t()) :: binary()
```

# `ioa`

```elixir
@spec ioa(t()) :: non_neg_integer()
```

Returns the Information Object Address (`ioa`) of any Information Object struct.

# `type_id`

```elixir
@spec type_id(t()) :: IEC60870.Types.TypeID.name() | IEC60870.Types.TypeID.code()
```

Infers the `TypeID` atom for any Information Object struct based on its type and timestamp.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
