| | |
| | | }); |
| | | } |
| | | |
| | | class GateWayBaseInfomation |
| | | { |
| | | //public string GatewayUniqueId;//"Emq网关1", <!-- 网关Mac --> |
| | | public bool MqttOnlineStatus;//: true, <!-- 网关在云端Emq是否在线 --> |
| | | public string AesKey;// : "a5d8da8a-ddea-48", <!-- 与此网关在云端Emq通信时,负载加解的16位Aes密钥 --> |
| | | public string MacMark;//: "61eaa0ea-4812-4a7a-86d6-3098c61e64ed" <!-- 网关对应的唯一码 --> |
| | | } |
| | | /// <summary> |
| | | /// 当前有帐号下所有的网关列表及信息 |
| | | /// </summary> |
| | | static Dictionary<string, GateWayBaseInfomation> GateWayBaseInfomations = new Dictionary<string, GateWayBaseInfomation> { }; |
| | | public static Dictionary<string, Shared.Phone.UserCenter.GatewayResult> GateWayBaseInfomations = new Dictionary<string, Shared.Phone.UserCenter.GatewayResult> { }; |
| | | /// <summary> |
| | | /// 获取当前帐号所有的网关信息 |
| | | /// </summary> |
| | |
| | | var list = JArray.Parse(responseData["PageData"].ToString());
|
| | | foreach (var v in list)
|
| | | {
|
| | | GateWayBaseInfomations[v["GatewayUniqueId"].ToString()] = new GateWayBaseInfomation { AesKey = v["AesKey"].ToString(), MacMark = v["MacMark"].ToString(), MqttOnlineStatus = bool.Parse(v["MqttOnlineStatus"].ToString()) };
|
| | | GateWayBaseInfomations[v["GatewayUniqueId"].ToString()] = new Shared.Phone.UserCenter.GatewayResult { AesKey = v["AesKey"].ToString(), MacMark = v["MacMark"].ToString(), MqttOnlineStatus = bool.Parse(v["MqttOnlineStatus"].ToString()) };
|
| | | //if (RemoteMqttClient.IsConnected)
|
| | | {
|
| | | await RemoteMqttClient.SubscribeAsync($"/ZigbeeGateWayToClient/{v["MacMark"].ToString()}/#", MQTTnet.Protocol.MqttQualityOfServiceLevel.ExactlyOnce);
|