fix(doc): add auto sub docs & more notes
This commit is contained in:
parent
5a6023676e
commit
ad12c3a4e3
|
@ -1,4 +1,21 @@
|
||||||
|
|
||||||
|
## When the device log in successfully,
|
||||||
|
## The auto-subscribe will complete the subscription for the device
|
||||||
|
## according to the preset topics list.
|
||||||
|
## Placeholders is supported.
|
||||||
|
##
|
||||||
|
## - ${clientid}
|
||||||
|
## - ${username}
|
||||||
|
## - ${host}
|
||||||
|
## - ${port}
|
||||||
|
##
|
||||||
|
## Subscription options can be set at the same time.
|
||||||
|
## Please refer to the official MQTT definition for these configuration items.
|
||||||
|
## - qos
|
||||||
|
## - rh
|
||||||
|
## - rap
|
||||||
|
## - nl
|
||||||
|
##
|
||||||
auto_subscribe {
|
auto_subscribe {
|
||||||
topics = [
|
topics = [
|
||||||
## {
|
## {
|
||||||
|
|
|
@ -34,11 +34,22 @@ fields("auto_subscribe") ->
|
||||||
];
|
];
|
||||||
|
|
||||||
fields("topic") ->
|
fields("topic") ->
|
||||||
[ {topic, sc(binary(), #{example => topic_example()})}
|
[ {topic, sc(binary(), #{
|
||||||
, {qos, sc(emqx_schema:qos(), #{default => 0})}
|
example => topic_example(),
|
||||||
, {rh, sc(range(0,2), #{default => 0})}
|
desc => "Topic name, placeholders is supported. For example: "
|
||||||
, {rap, sc(range(0, 1), #{default => 0})}
|
++ binary_to_list(topic_example())})}
|
||||||
, {nl, sc(range(0, 1), #{default => 0})}
|
, {qos, sc(emqx_schema:qos(), #{
|
||||||
|
default => 0,
|
||||||
|
desc => "Quality of service. MQTT definition."})}
|
||||||
|
, {rh, sc(range(0,2), #{
|
||||||
|
default => 0,
|
||||||
|
desc => "Retain handling. MQTT 5.0 definition."})}
|
||||||
|
, {rap, sc(range(0, 1), #{
|
||||||
|
default => 0,
|
||||||
|
desc => "Retain as Published. MQTT 5.0 definition."})}
|
||||||
|
, {nl, sc(range(0, 1), #{
|
||||||
|
default => 0,
|
||||||
|
desc => "Not local. MQTT 5.0 definition."})}
|
||||||
].
|
].
|
||||||
|
|
||||||
topic_example() ->
|
topic_example() ->
|
||||||
|
|
Loading…
Reference in New Issue