Skip to content

Commit

Permalink
Correct the type name for db() to dbm()
Browse files Browse the repository at this point in the history
Corrects the type name db() to the more correct `dbm()`, and adds a brief
edoc explanation for the value.

Signed-off-by: Winford <[email protected]>
  • Loading branch information
UncleGrumpy committed Nov 20, 2024
1 parent 1cddf54 commit 1e894ab
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions libs/eavmlib/src/network.erl
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,10 @@

-type network_config() :: [sta_config() | ap_config() | sntp_config()].

-type db() :: integer().
-type dbm() :: integer().
%% `dbm()' decibel-milliwatts (or dBm) will typically be a negative number, but in the presence of
%% a powerful signal this can be a positive number. A level of 0 dBm corresponds to the power of 1
%% milliwatt. A 10 dBm decrease in level is equivalent to a ten-fold decrease in signal power.

-record(state, {
config :: network_config(),
Expand Down Expand Up @@ -307,12 +310,12 @@ stop() ->
gen_server:stop(?SERVER).

%%-----------------------------------------------------------------------------
%% @returns {ok, Rssi} in decibels, or {error, Reason}.
%% @returns {ok, Rssi} in dBm, or {error, Reason}.
%%
%% @doc Get the rssi information of AP to which the device is associated with.
%% @end
%%-----------------------------------------------------------------------------
-spec sta_rssi() -> {ok, Rssi :: db()} | {error, Reason :: term()}.
-spec sta_rssi() -> {ok, Rssi :: dbm()} | {error, Reason :: term()}.
sta_rssi() ->
Port = get_port(),
Ref = make_ref(),
Expand Down

0 comments on commit 1e894ab

Please sign in to comment.