Esempio n. 1
0
        private void SetChannel(int channel, char thermoType)
        {
            short result = TC08DeviceImports.SetChannel(Handle, (short)channel, thermoType);

            if (result == 0)
            {
                throw new TC08Exception(result);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Devices poll to detect disconnect
        /// </summary>
        private void DevicePollOnElapsed(object sender, ElapsedEventArgs elapsedEventArgs)
        {
            TC08DeviceImports.SetChannel(Handle, 0, 'X');
            short error = TC08DeviceImports.GetLastError(Handle);

            if (error > 6 && Connected)
            {
                Connected = false;
                _devicePoll.Stop();
                _onClosed(Handle);
            }
        }