This commit is contained in:
narawat lamaiin
2024-10-04 13:37:56 +07:00
parent 05efa05ef5
commit 20ae5e45e0

View File

@@ -535,7 +535,10 @@ end
# Signature
"""
function sendMqttMsg(outgoingMsg::Dict{Symbol, T})::NamedTuple where {T<:Any}
mqttMsgReceiveTopic = ["/GeneralUtils_sendMqttMsg/$(outgoingMsg[:msgMeta][:senderId])"]
# sendMqttMsg() doesn't need to receive msg but mqttClientInstance_v2 requires to have receive topic
mqttMsgReceiveTopic = "/GeneralUtils_sendMqttMsg/$(outgoingMsg[:msgMeta][:senderId])"
mqttMsgReceiveChannel = (ch1=Channel(8),)
keepaliveChannel = Channel(8)
@@ -548,7 +551,7 @@ function sendMqttMsg(outgoingMsg::Dict{Symbol, T})::NamedTuple where {T<:Any}
mqttInstance = mqttClientInstance_v2(
outgoingMsg[:msgMeta][:mqttBrokerAddress],
mqttMsgReceiveTopic,
[mqttMsgReceiveTopic],
mqttMsgReceiveChannel,
keepaliveChannel,
onMsgCallback;