From 8f7b0ac49837ab740cc7507e4471b1831b6dcf13 Mon Sep 17 00:00:00 2001 From: Andrew Mayorov Date: Tue, 13 Feb 2024 16:27:41 +0100 Subject: [PATCH] docs(jt808): fix doc references --- .../src/emqx_jt808_schema.erl | 23 +++++++++++++------ rel/i18n/emqx_jt808_schema.hocon | 11 +++++---- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/apps/emqx_gateway_jt808/src/emqx_jt808_schema.erl b/apps/emqx_gateway_jt808/src/emqx_jt808_schema.erl index 427c7bdfe..d4b0a0b5e 100644 --- a/apps/emqx_gateway_jt808/src/emqx_jt808_schema.erl +++ b/apps/emqx_gateway_jt808/src/emqx_jt808_schema.erl @@ -54,9 +54,8 @@ fields(jt808_proto) -> [ {auth, sc( - hoconsc:union([ - ref(anonymous_true), ref(anonymous_false) - ]) + hoconsc:union([ref(anonymous_true), ref(anonymous_false)]), + #{desc => ?DESC(jt808_auth)} )}, {up_topic, fun up_topic/1}, {dn_topic, fun dn_topic/1} @@ -64,12 +63,18 @@ fields(jt808_proto) -> fields(anonymous_true) -> [ {allow_anonymous, - sc(hoconsc:union([true]), #{desc => ?DESC(allow_anonymous), required => true})} + sc( + hoconsc:union([true]), + #{desc => ?DESC(jt808_allow_anonymous), required => true} + )} ] ++ fields_reg_auth_required(false); fields(anonymous_false) -> [ {allow_anonymous, - sc(hoconsc:union([false]), #{desc => ?DESC(allow_anonymous), required => true})} + sc( + hoconsc:union([false]), + #{desc => ?DESC(jt808_allow_anonymous), required => true} + )} ] ++ fields_reg_auth_required(true). fields_reg_auth_required(Required) -> @@ -105,14 +110,14 @@ jt808_frame_max_length(_) -> undefined. up_topic(type) -> binary(); -up_topic(desc) -> ?DESC(?FUNCTION_NAME); +up_topic(desc) -> ?DESC(jt808_up_topic); up_topic(default) -> ?DEFAULT_UP_TOPIC; up_topic(validator) -> [?NOT_EMPTY("the value of the field 'up_topic' cannot be empty")]; up_topic(required) -> true; up_topic(_) -> undefined. dn_topic(type) -> binary(); -dn_topic(desc) -> ?DESC(?FUNCTION_NAME); +dn_topic(desc) -> ?DESC(jt808_dn_topic); dn_topic(default) -> ?DEFAULT_DN_TOPIC; dn_topic(validator) -> [?NOT_EMPTY("the value of the field 'dn_topic' cannot be empty")]; dn_topic(required) -> true; @@ -124,6 +129,10 @@ desc(jt808_frame) -> "Limits for the JT/T 808 frames."; desc(jt808_proto) -> "The JT/T 808 protocol options."; +desc(anonymous_false) -> + ?DESC(jt808_allow_anonymous); +desc(anonymous_true) -> + ?DESC(jt808_allow_anonymous); desc(_) -> undefined. diff --git a/rel/i18n/emqx_jt808_schema.hocon b/rel/i18n/emqx_jt808_schema.hocon index cd853df4d..71c76ae52 100644 --- a/rel/i18n/emqx_jt808_schema.hocon +++ b/rel/i18n/emqx_jt808_schema.hocon @@ -3,19 +3,22 @@ emqx_jt808_schema { jt808_frame_max_length.desc: """The maximum length of the JT/T 808 frame.""" +jt808_auth.desc: +"""Authentication settings of the JT/T 808 Gateway.""" + jt808_allow_anonymous.desc: """Allow anonymous access to the JT/T 808 Gateway.""" -registry_url.desc +registry_url.desc: """The JT/T 808 device registry central URL.""" -authentication_url.desc +authentication_url.desc: """The JT/T 808 device authentication central URL.""" -jt808_up_topic.desc +jt808_up_topic.desc: """The topic of the JT/T 808 protocol upstream message.""" -jt808_dn_topic.desc +jt808_dn_topic.desc: """The topic of the JT/T 808 protocol downstream message.""" retry_interval.desc: