docs(jt808): fix doc references

This commit is contained in:
Andrew Mayorov 2024-02-13 16:27:41 +01:00
parent 0e1d27c836
commit 8f7b0ac498
No known key found for this signature in database
GPG Key ID: 2837C62ACFBFED5D
2 changed files with 23 additions and 11 deletions

View File

@ -54,9 +54,8 @@ fields(jt808_proto) ->
[ [
{auth, {auth,
sc( sc(
hoconsc:union([ hoconsc:union([ref(anonymous_true), ref(anonymous_false)]),
ref(anonymous_true), ref(anonymous_false) #{desc => ?DESC(jt808_auth)}
])
)}, )},
{up_topic, fun up_topic/1}, {up_topic, fun up_topic/1},
{dn_topic, fun dn_topic/1} {dn_topic, fun dn_topic/1}
@ -64,12 +63,18 @@ fields(jt808_proto) ->
fields(anonymous_true) -> fields(anonymous_true) ->
[ [
{allow_anonymous, {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_reg_auth_required(false);
fields(anonymous_false) -> fields(anonymous_false) ->
[ [
{allow_anonymous, {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(true).
fields_reg_auth_required(Required) -> fields_reg_auth_required(Required) ->
@ -105,14 +110,14 @@ jt808_frame_max_length(_) ->
undefined. undefined.
up_topic(type) -> binary(); 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(default) -> ?DEFAULT_UP_TOPIC;
up_topic(validator) -> [?NOT_EMPTY("the value of the field 'up_topic' cannot be empty")]; up_topic(validator) -> [?NOT_EMPTY("the value of the field 'up_topic' cannot be empty")];
up_topic(required) -> true; up_topic(required) -> true;
up_topic(_) -> undefined. up_topic(_) -> undefined.
dn_topic(type) -> binary(); 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(default) -> ?DEFAULT_DN_TOPIC;
dn_topic(validator) -> [?NOT_EMPTY("the value of the field 'dn_topic' cannot be empty")]; dn_topic(validator) -> [?NOT_EMPTY("the value of the field 'dn_topic' cannot be empty")];
dn_topic(required) -> true; dn_topic(required) -> true;
@ -124,6 +129,10 @@ desc(jt808_frame) ->
"Limits for the JT/T 808 frames."; "Limits for the JT/T 808 frames.";
desc(jt808_proto) -> desc(jt808_proto) ->
"The JT/T 808 protocol options."; "The JT/T 808 protocol options.";
desc(anonymous_false) ->
?DESC(jt808_allow_anonymous);
desc(anonymous_true) ->
?DESC(jt808_allow_anonymous);
desc(_) -> desc(_) ->
undefined. undefined.

View File

@ -3,19 +3,22 @@ emqx_jt808_schema {
jt808_frame_max_length.desc: jt808_frame_max_length.desc:
"""The maximum length of the JT/T 808 frame.""" """The maximum length of the JT/T 808 frame."""
jt808_auth.desc:
"""Authentication settings of the JT/T 808 Gateway."""
jt808_allow_anonymous.desc: jt808_allow_anonymous.desc:
"""Allow anonymous access to the JT/T 808 Gateway.""" """Allow anonymous access to the JT/T 808 Gateway."""
registry_url.desc registry_url.desc:
"""The JT/T 808 device registry central URL.""" """The JT/T 808 device registry central URL."""
authentication_url.desc authentication_url.desc:
"""The JT/T 808 device authentication central URL.""" """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.""" """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.""" """The topic of the JT/T 808 protocol downstream message."""
retry_interval.desc: retry_interval.desc: