feat: mqtt

This commit is contained in:
dawnwinterLiu 2024-05-31 11:26:21 +08:00
parent 022dbeeb79
commit 186fe57c90

View File

@ -156,7 +156,7 @@ send(ProductId, DevAddr, Topic, Payload) ->
-spec(publish(Client :: binary(), Topic :: binary(), Payload :: binary()) -spec(publish(Client :: binary(), Topic :: binary(), Payload :: binary())
-> ok | {error, Reason :: any()}). -> ok | {error, Reason :: any()}).
publish(Client, Topic, Payload) -> publish(Client, Topic, Payload) ->
timer:sleep(10), timer:sleep(1),
Msg = emqx_message:make(dgiot_utils:to_binary(Client), 0, Topic, Payload), Msg = emqx_message:make(dgiot_utils:to_binary(Client), 0, Topic, Payload),
emqx:publish(Msg), emqx:publish(Msg),
ok. ok.