From 7bd55799804a659baeb11d62da04d957f041d034 Mon Sep 17 00:00:00 2001 From: JianBo He Date: Tue, 7 Nov 2023 11:09:39 +0800 Subject: [PATCH] chore: fix the documentation generation and example conf checking --- apps/emqx_gateway/src/emqx_gateway_utils.erl | 4 ++- .../test/emqx_exproto_SUITE.erl | 12 ++++---- .../src/emqx_ocpp_schema.erl | 2 +- .../ee-examples/gateway.gbt32960.conf.example | 28 +++++++++++++++++++ 4 files changed, 38 insertions(+), 8 deletions(-) create mode 100644 rel/config/ee-examples/gateway.gbt32960.conf.example diff --git a/apps/emqx_gateway/src/emqx_gateway_utils.erl b/apps/emqx_gateway/src/emqx_gateway_utils.erl index 1b84a5209..ed3f10594 100644 --- a/apps/emqx_gateway/src/emqx_gateway_utils.erl +++ b/apps/emqx_gateway/src/emqx_gateway_utils.erl @@ -748,7 +748,9 @@ ensure_gateway_loaded() -> emqx_gateway_stomp, emqx_gateway_coap, emqx_gateway_lwm2m, - emqx_gateway_mqttsn + emqx_gateway_mqttsn, + emqx_gateway_gbt32960, + emqx_gateway_ocpp ] ). diff --git a/apps/emqx_gateway_exproto/test/emqx_exproto_SUITE.erl b/apps/emqx_gateway_exproto/test/emqx_exproto_SUITE.erl index 1c4c7ba08..76e11ef00 100644 --- a/apps/emqx_gateway_exproto/test/emqx_exproto_SUITE.erl +++ b/apps/emqx_gateway_exproto/test/emqx_exproto_SUITE.erl @@ -636,18 +636,18 @@ close({dtls, Sock}) -> %% Server-Opts socketopts(tcp) -> - #{tcp => tcp_opts()}; + #{tcp_options => tcp_opts()}; socketopts(ssl) -> #{ - tcp => tcp_opts(), - ssl => ssl_opts() + tcp_options => tcp_opts(), + ssl_options => ssl_opts() }; socketopts(udp) -> - #{udp => udp_opts()}; + #{udp_options => udp_opts()}; socketopts(dtls) -> #{ - udp => udp_opts(), - dtls => dtls_opts() + udp_options => udp_opts(), + dtls_options => dtls_opts() }. tcp_opts() -> diff --git a/apps/emqx_gateway_ocpp/src/emqx_ocpp_schema.erl b/apps/emqx_gateway_ocpp/src/emqx_ocpp_schema.erl index 61747404a..774907d6c 100644 --- a/apps/emqx_gateway_ocpp/src/emqx_ocpp_schema.erl +++ b/apps/emqx_gateway_ocpp/src/emqx_ocpp_schema.erl @@ -88,7 +88,7 @@ fields(upstream) -> {topic_override_mapping, sc( %% XXX: more clearly type defination - hoconsc:map(string(), string()), + hoconsc:map(name, string()), #{ required => false, default => #{}, diff --git a/rel/config/ee-examples/gateway.gbt32960.conf.example b/rel/config/ee-examples/gateway.gbt32960.conf.example new file mode 100644 index 000000000..768eca9aa --- /dev/null +++ b/rel/config/ee-examples/gateway.gbt32960.conf.example @@ -0,0 +1,28 @@ +##-------------------------------------------------------------------- +## Gateway GB/T 32960 +## +## Add a GB/T 32960 gateway +##-------------------------------------------------------------------- +## Note: This is an example of how to configure this feature +## you should copy and paste the below data into the emqx.conf for working + +gateway.gbt32960 { + + ## When publishing or subscribing, prefix all topics with a mountpoint string. + ## It's a way that you can use to implement isolation of message routing between different + ## gateway protocols + mountpoint = "gbt32960/" + + ## Re-send time interval + retry_interval = "8s" + + ## Re-send max times + max_retry_times = 3 + + ## Max message queue length + message_queue_len = 10 + + listeners.tcp.default { + bind = "0.0.0.0:7325" + } +}