diff --git a/apps/emqx_bridge/include/emqx_bridge_v2_register.hrl b/apps/emqx_bridge/include/emqx_bridge_v2_register.hrl index 186564bef..3f3d0a66b 100644 --- a/apps/emqx_bridge/include/emqx_bridge_v2_register.hrl +++ b/apps/emqx_bridge/include/emqx_bridge_v2_register.hrl @@ -1,3 +1,20 @@ +%%-------------------------------------------------------------------- +%% Copyright (c) 2020-2023 EMQ Technologies Co., Ltd. All Rights Reserved. +%% +%% Licensed under the Apache License, Version 2.0 (the "License"); +%% you may not use this file except in compliance with the License. +%% You may obtain a copy of the License at +%% +%% http://www.apache.org/licenses/LICENSE-2.0 +%% +%% Unless required by applicable law or agreed to in writing, software +%% distributed under the License is distributed on an "AS IS" BASIS, +%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +%% See the License for the specific language governing permissions and +%% limitations under the License. +%%-------------------------------------------------------------------- + + %% This function is called to register a bridge V2. It should be called before %% the system boots in a function triggered by an -on_load() directive %% since it should be called before the system boots because the config diff --git a/apps/emqx_bridge/src/emqx_bridge_v2.erl b/apps/emqx_bridge/src/emqx_bridge_v2.erl index 66d8e1899..6406f7df2 100644 --- a/apps/emqx_bridge/src/emqx_bridge_v2.erl +++ b/apps/emqx_bridge/src/emqx_bridge_v2.erl @@ -42,7 +42,7 @@ %% Getting registered bridge schemas: -export([ - bridge_v2_type_to_schame_stuct_field/1, + bridge_v2_type_to_schame_struct_field/1, registered_schema_modules/0 ]). @@ -195,7 +195,7 @@ on_load() -> end, ok. -bridge_v2_type_to_schame_stuct_field(BridgeV2Type) -> +bridge_v2_type_to_schame_struct_field(BridgeV2Type) -> InfoMap = persistent_term:get(internal_emqx_bridge_v2_persistent_term_info_key()), Map = maps:get(bridge_v2_type_to_schema_struct_field, InfoMap), maps:get(BridgeV2Type, Map). diff --git a/apps/emqx_bridge/src/schema/emqx_bridge_v2_schema.erl b/apps/emqx_bridge/src/schema/emqx_bridge_v2_schema.erl index 5fe86ec51..c380ac933 100644 --- a/apps/emqx_bridge/src/schema/emqx_bridge_v2_schema.erl +++ b/apps/emqx_bridge/src/schema/emqx_bridge_v2_schema.erl @@ -156,7 +156,7 @@ fields(actions) -> registered_schema_fields() -> [ - Module:fields(emqx_bridge_v2:bridge_v2_type_to_schame_stuct_field(BridgeV2Type)) + Module:fields(emqx_bridge_v2:bridge_v2_type_to_schame_struct_field(BridgeV2Type)) || {BridgeV2Type, Module} <- emqx_bridge_v2:registered_schema_modules() ].