# `VintageNetWiFi.Utils`
[🔗](https://github.com/nerves-networking/vintage_net_wifi/blob/v0.12.5/lib/vintage_net_wifi/utils.ex#L1)

Various utility functions for handling WiFi information

# `frequency_info`

```elixir
@type frequency_info() :: %{
  band: VintageNetWiFi.AccessPoint.band(),
  channel: non_neg_integer(),
  dbm_to_percent: function()
}
```

# `bit_to_boolean`

```elixir
@spec bit_to_boolean(0 | 1) :: boolean()
```

Converts 1 to true, 0 to false

# `dbm_to_percent`

```elixir
@spec dbm_to_percent(number(), number(), number()) :: 1..100
```

Convert power in dBm to a percent

The returned percentage is intended to shown to users
like to show a number of bars or some kind of signal
strength.

See [Displaying Associated and Scanned Signal
Levels](https://web.archive.org/web/20141222024740/http://www.ces.clemson.edu/linux/nm-ipw2200.shtml).

# `frequency_info`

```elixir
@spec frequency_info(non_neg_integer()) :: frequency_info()
```

Get information about a WiFi frequency

The frequency should be pass in MHz. The result is more
information about the frequency that may be helpful to
users.

---

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