Пример #1
0
 void client_MqttMsgSubscribed(object sender, MqttMsgSubscribedEventArgs e)
 {
     MessageBox.Show(e.ToString());
 }
Пример #2
0
        //private string Base64DecodeAndStringify(string base64EncodedData)
        //{
        //    var base64EncodedBytes = Convert.FromBase64String(base64EncodedData);
        //    StringBuilder sb = new StringBuilder();
        //    foreach (var bytes in base64EncodedBytes)
        //    {
        //        string x = bytes.ToString("X").Replace((char) 0xA, '0');
        //        //x must be two chars
        //        sb.Append(x);
        //    }
        //    return sb.ToString();
        //}



        private void Client_MqttMsgSubscribed(object sender, MqttMsgSubscribedEventArgs e)
        {
            Console.WriteLine("Client_MqttMsgSubscribed: " + e.ToString());
            File.AppendAllText(AppConstants.LogStorageFilePath, $"{DateTime.Now} - Client_MqttMsgSubscribed: {e}\n");
        }
Пример #3
0
 /// <summary>
 /// The event received when the subscription has been accepted.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Client_MqttMsgSubscribed(object sender, MqttMsgSubscribedEventArgs e)
 {
     Program.Log("The client is subscribed to the broker... \n" + e.ToString());
 }
Пример #4
0
 /// <summary>
 /// This function will simple print the message from the mqtt broker once there is a message.
 /// </summary>
 private static void Client_MqttMsgSubscribed(
      object sender, MqttMsgSubscribedEventArgs e)
 {
     Console.WriteLine("Client_MqttMsgSubscribed: " + e.ToString() + "\n");
 }