Exemple #1
0
        //Wysyła wiadomość z odpowiednimi atrybutami
        private async void uxSend_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                var data = new IoTMessage()
                {
                    Message = uxCommand.Text
                };
                data.DeviceName = m_telemetrySource.GetDeviceName();
                var messageString = JsonConvert.SerializeObject(data);
                var message       = new Message(Encoding.UTF8.GetBytes(messageString));

                await m_deviceClient.SendEventAsync(message);

                uxValues.Text = data.ToString();
                Debug.WriteLine(data.ToString());
                m_lcd?.home();
                m_lcd?.printstr(data.Message);
            }
            catch (Exception ex)
            {
                m_lcd?.home();
                m_lcd?.printstr("ERROR");
            }

            m_tc.TrackEvent($"uxSend_Click - {uxCommand.Text}");
        }
        //Wysyła wiadomość z odpowiednimi atrybutami
        private async void uxSend_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                var data = new IoTMessage() { Message = uxCommand.Text };
                data.DeviceName = m_telemetrySource.GetDeviceName();
                var messageString = JsonConvert.SerializeObject(data);
                var message = new Message(Encoding.UTF8.GetBytes(messageString));

                await m_deviceClient.SendEventAsync(message);
                uxValues.Text = data.ToString();
                Debug.WriteLine(data.ToString());
                m_lcd?.home();
                m_lcd?.printstr(data.Message);
            }
            catch (Exception ex)
            {
                m_lcd?.home();
                m_lcd?.printstr("ERROR");
            }

            m_tc.TrackEvent($"uxSend_Click - {uxCommand.Text}");

        }