| | |
| | | var result = await RemoteMqttClient.SubscribeAsync(new MqttTopicFilter[] { topicFilterBusGateWayToClient, topicFilterPush2, topicAlinkStatus }); |
| | | if (result.Items[0].ResultCode == MQTTnet.Client.Subscribing.MqttClientSubscribeResultCode.GrantedQoS0) |
| | | { |
| | | Control.Ins.GatewayOnline = true; |
| | | isSubscribeSuccess = true; |
| | | Utlis.WriteLine("订阅成功!"); |
| | | |
| | |
| | | { |
| | | RemoteMqttClient.UseConnectedHandler(async (e) => |
| | | { |
| | | Control.Ins.GatewayOnline = true; |
| | | IfNeedReadAllDeviceStatus = true; |
| | | Utlis.WriteLine($"============>Mqtt远程连接成功"); |
| | | SendPushSignOut(); |
| | |
| | | /// <returns></returns> |
| | | public static async Task MqttRemoteSend(byte[] message, int optionType = 0) |
| | | { |
| | | //return; |
| | | |
| | | try |
| | | { |
| | | string topicName; |