Esempio n. 1
0
        private async Task SetupCommunication()
        {
            serialDevice = await SerialCommunicationHelper.GetFirstDeviceAvailable();

            SerialCommunicationHelper.SetDefaultConfiguration(serialDevice);
            new Task(CommunicationListener).Start();
        }
        private async Task InitializeDevice()
        {
            if (serialDevice == null)
            {
                serialDevice = await SerialCommunicationHelper.GetFirstDeviceAvailable();

                SerialCommunicationHelper.SetDefaultConfiguration(serialDevice);

                if (serialDevice != null)
                {
                    dataWriter = new DataWriter(serialDevice.OutputStream);
                    dataReader = new DataReader(serialDevice.InputStream);
                }
            }
        }