Пример #1
0
        private void ButtonSendTrend_Click(object sender, RoutedEventArgs e)
        {
            byte[] data = new byte[1];

            if (TextBoxTrend.Text.Length > 1)
            {
                MessageBox.Show("Trend number too lengthy.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }

            byte[] value = System.Text.Encoding.UTF8.GetBytes(TextBoxTrend.Text);
            data[0] = value[0];

            if (!CommandHost.SendTrendReadings(_uart, data))
            {
                MessageBox.Show("Transmission error sending trend readings.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }