|
|
@@ -49,24 +49,38 @@ fields(jt808_frame) ->
|
|
|
];
|
|
|
fields(jt808_proto) ->
|
|
|
[
|
|
|
- {allow_anonymous, fun allow_anonymous/1},
|
|
|
- {registry, fun registry_url/1},
|
|
|
- {authentication, fun authentication_url/1},
|
|
|
+ {auth,
|
|
|
+ sc(
|
|
|
+ hoconsc:union([
|
|
|
+ ref(anonymous_true), ref(anonymous_false)
|
|
|
+ ])
|
|
|
+ )},
|
|
|
{up_topic, fun up_topic/1},
|
|
|
{dn_topic, fun dn_topic/1}
|
|
|
+ ];
|
|
|
+fields(anonymous_true) ->
|
|
|
+ [
|
|
|
+ {allow_anonymous,
|
|
|
+ sc(hoconsc:union([true]), #{desc => ?DESC(allow_anonymous), required => true})}
|
|
|
+ ];
|
|
|
+fields(anonymous_false) ->
|
|
|
+ [
|
|
|
+ {allow_anonymous,
|
|
|
+ sc(hoconsc:union([false]), #{desc => ?DESC(allow_anonymous), required => true})},
|
|
|
+ {registry, fun registry_url/1},
|
|
|
+ {authentication, fun authentication_url/1}
|
|
|
].
|
|
|
|
|
|
-jt808_frame_max_length(type) -> non_neg_integer();
|
|
|
-jt808_frame_max_length(desc) -> ?DESC(?FUNCTION_NAME);
|
|
|
-jt808_frame_max_length(default) -> 8192;
|
|
|
-jt808_frame_max_length(required) -> false;
|
|
|
-jt808_frame_max_length(_) -> undefined.
|
|
|
-
|
|
|
-allow_anonymous(type) -> boolean();
|
|
|
-allow_anonymous(desc) -> ?DESC(?FUNCTION_NAME);
|
|
|
-allow_anonymous(default) -> true;
|
|
|
-allow_anonymous(required) -> false;
|
|
|
-allow_anonymous(_) -> undefined.
|
|
|
+jt808_frame_max_length(type) ->
|
|
|
+ non_neg_integer();
|
|
|
+jt808_frame_max_length(desc) ->
|
|
|
+ ?DESC(?FUNCTION_NAME);
|
|
|
+jt808_frame_max_length(default) ->
|
|
|
+ 8192;
|
|
|
+jt808_frame_max_length(required) ->
|
|
|
+ false;
|
|
|
+jt808_frame_max_length(_) ->
|
|
|
+ undefined.
|
|
|
|
|
|
registry_url(type) -> binary();
|
|
|
registry_url(desc) -> ?DESC(?FUNCTION_NAME);
|