适配kit包的调整

Signed-off-by: lixxxww <941403820@qq.com>
This commit is contained in:
lixxxww
2024-01-23 12:21:01 +00:00
committed by Gitee
parent ebe33c1603
commit e9a187520c
3 changed files with 19 additions and 18 deletions

View File

@@ -26,7 +26,7 @@ type RpcRequest struct {
// RequestCmd 下发指令
func (rpc RpcRequest) RequestCmd(deviceId, rpcPayload string) error {
topic := fmt.Sprintf(RpcReqTopic, rpc.RequestId)
value, ok := MqttClient.Load(deviceId)
value, ok := Session.Load(deviceId)
if !ok {
return errors.New("为获取到设备的MQTT连接")
}
@@ -35,7 +35,7 @@ func (rpc RpcRequest) RequestCmd(deviceId, rpcPayload string) error {
func (rpc RpcRequest) Pub(deviceId, reqPayload string) error {
topic := fmt.Sprintf(RpcRespTopic, rpc.RequestId)
value, ok := MqttClient.Load(deviceId)
value, ok := Session.Load(deviceId)
if !ok {
return errors.New("为获取到设备的MQTT连接")
}