Пример #1
0
        public async Task InitializeSettings(ConnectionSettings connectionSettings)
        {
            WriteToLog("Initializing connection.");

            try
            {
                await device.SetConnectionSettings(connectionSettings);

                WriteToLog("Connection settings succesfully applied: {0}.", connectionSettings);
            }
            catch (Exception ex)
            {
                WriteToLog("Unable to apply connection settings, communication may not function properly. Exception={0}.", ex.Message);
            }

            State = ConnectionState.Ready;

            StartReadingData();
            WriteToLog("Connection ready.");
        }