mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-24 03:18:35 +08:00
优化
This commit is contained in:
@@ -16,7 +16,9 @@ const (
|
||||
TelemetryGatewayTopic = "v1/gateway/telemetry"
|
||||
ConnectGatewayTopic = "v1/gateway/connect"
|
||||
|
||||
RpcReq = `v1/devices/me/rpc/request/(.*?)$`
|
||||
RpcReq = `v1/devices/me/rpc/(.*?)/(.*?)$`
|
||||
|
||||
EventReq = `v1/devices/event/(.*?)$`
|
||||
)
|
||||
|
||||
var IotHubTopic = NewIotHubTopic()
|
||||
@@ -39,8 +41,11 @@ func (iht TopicMeg) GetMessageType(topic string) string {
|
||||
if meg, ok := iht[topic]; ok {
|
||||
return meg
|
||||
}
|
||||
if strings.Contains(topic, "v1/devices/me/rpc/request") {
|
||||
if strings.Contains(topic, "v1/devices/me/rpc/request") || strings.Contains(topic, "v1/devices/me/rpc/response") {
|
||||
return message.RpcRequestFromDevice
|
||||
}
|
||||
if strings.Contains(topic, "v1/devices/event") {
|
||||
return message.UpEventMes
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user