chore: fix dialyzer warnings

This commit is contained in:
JianBo He 2023-03-30 15:48:42 +08:00
parent 0b6c5c4c91
commit 40c413ac05
9 changed files with 19 additions and 7 deletions

View File

@ -2,7 +2,7 @@
{description, "CoAP Gateway"}, {description, "CoAP Gateway"},
{vsn, "0.1.0"}, {vsn, "0.1.0"},
{registered, []}, {registered, []},
{applications, [kernel, stdlib]}, {applications, [kernel, stdlib, emqx_gateway]},
{env, []}, {env, []},
{modules, []}, {modules, []},
{licenses, ["Apache 2.0"]}, {licenses, ["Apache 2.0"]},

View File

@ -37,4 +37,11 @@
config => emqx_config:config() config => emqx_config:config()
}. }.
-type gateway_def() ::
#{
name := gateway_name(),
callback_module := module(),
config_schema_module := module()
}.
-endif. -endif.

View File

@ -80,7 +80,11 @@ load_gateway_application(
name => Name, name => Name,
callback_module => CbMod callback_module => CbMod
}) })
end. end;
load_gateway_application(_) ->
?SLOG(error, #{
msg => "invalid_gateway_defination"
}).
load_gateway_by_default() -> load_gateway_by_default() ->
load_gateway_by_default(confs()). load_gateway_by_default(confs()).

View File

@ -564,6 +564,7 @@ make_compatible_schema2(Path, SchemaFun) ->
Schema Schema
). ).
-spec find_gateway_definations() -> list(gateway_def()).
find_gateway_definations() -> find_gateway_definations() ->
lists:flatten( lists:flatten(
lists:map( lists:map(

View File

@ -17,7 +17,7 @@
-module(emqx_lwm2m_channel). -module(emqx_lwm2m_channel).
-include_lib("emqx/include/logger.hrl"). -include_lib("emqx/include/logger.hrl").
-include("src/coap/include/emqx_coap.hrl"). -include_lib("emqx_coap/include/emqx_coap.hrl").
-include("src/lwm2m/include/emqx_lwm2m.hrl"). -include("src/lwm2m/include/emqx_lwm2m.hrl").
%% API %% API

View File

@ -17,7 +17,7 @@
-module(emqx_lwm2m_cmd). -module(emqx_lwm2m_cmd).
-include_lib("emqx/include/logger.hrl"). -include_lib("emqx/include/logger.hrl").
-include("src/coap/include/emqx_coap.hrl"). -include_lib("emqx_coap/include/emqx_coap.hrl").
-include("src/lwm2m/include/emqx_lwm2m.hrl"). -include("src/lwm2m/include/emqx_lwm2m.hrl").
-export([ -export([

View File

@ -15,12 +15,12 @@
%%-------------------------------------------------------------------- %%--------------------------------------------------------------------
-module(emqx_lwm2m_session). -module(emqx_lwm2m_session).
-include("src/coap/include/emqx_coap.hrl").
-include("src/lwm2m/include/emqx_lwm2m.hrl"). -include("src/lwm2m/include/emqx_lwm2m.hrl").
-include_lib("emqx/include/logger.hrl"). -include_lib("emqx/include/logger.hrl").
-include_lib("emqx/include/emqx.hrl"). -include_lib("emqx/include/emqx.hrl").
-include_lib("emqx/include/emqx_mqtt.hrl"). -include_lib("emqx/include/emqx_mqtt.hrl").
-include_lib("snabbkaffe/include/snabbkaffe.hrl"). -include_lib("snabbkaffe/include/snabbkaffe.hrl").
-include_lib("emqx_coap/include/emqx_coap.hrl").
%% API %% API
-export([ -export([

View File

@ -2,7 +2,7 @@
{description, "MQTT-SN Gateway"}, {description, "MQTT-SN Gateway"},
{vsn, "0.1.0"}, {vsn, "0.1.0"},
{registered, []}, {registered, []},
{applications, [kernel, stdlib]}, {applications, [kernel, stdlib, emqx_gateway]},
{env, []}, {env, []},
{modules, []}, {modules, []},
{licenses, ["Apache 2.0"]}, {licenses, ["Apache 2.0"]},

View File

@ -2,7 +2,7 @@
{description, "Stomp Gateway"}, {description, "Stomp Gateway"},
{vsn, "0.1.0"}, {vsn, "0.1.0"},
{registered, []}, {registered, []},
{applications, [kernel, stdlib]}, {applications, [kernel, stdlib, emqx_gateway]},
{env, []}, {env, []},
{modules, []}, {modules, []},
{licenses, ["Apache 2.0"]}, {licenses, ["Apache 2.0"]},