# `ExDlt645.Query`
[🔗](https://github.com/Ultraluv/ex_dlt645/blob/v0.1.0/lib/ex_dlt645/query.ex#L1)

Inspection, diagnostic, and query tools for DL/T 645-2007.

Provides utilities for protocol inspection and diagnosis:
- Query metadata for any Data Identifier (DI)
- Search DIs by keyword (e.g. "电压", "电流", "有功", "需量")
- Detailed inspection and visual formatting of raw hex frames

# `info`

```elixir
@spec info(non_neg_integer() | binary() | String.t()) ::
  {:ok, ExDlt645.DataId.Info.t()} | {:error, :unknown_di}
```

Returns metadata info for the given Data Identifier (number, hex string, or binary).

# `inspect_frame`

```elixir
@spec inspect_frame(binary() | String.t()) ::
  {:ok, ExDlt645.Frame.t()} | {:error, term()}
```

Inspects and decodes a raw frame binary or hex string, printing a human-readable
breakdown with parsed frame headers, data identifier info, and payload content.

# `search`

```elixir
@spec search(String.t()) :: [map()]
```

Searches standard DL/T 645 Data Identifiers matching a keyword.

## Examples

    iex> ExDlt645.Query.search("电压")
    [
      %{di: 0x02010100, name: "A相电压", unit: "V", format: :xxx_x},
      %{di: 0x02010200, name: "B相电压", unit: "V", format: :xxx_x},
      ...
    ]

# `show_info`

```elixir
@spec show_info(non_neg_integer() | binary() | String.t()) ::
  :ok | {:error, :unknown_di}
```

Prints formatted metadata for the given Data Identifier to the console.

---

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