Beispiel #1
0
 public static void SetSerialPortData(SerialPortType type, Dictionary <string, dynamic> data)
 {
     if (Instance == null)
     {
         Instance = GetInstance();
     }
     if (type == SerialPortType.Recieving)
     {
         Instance.Settings["SerialPort"]["Recieving"] = data;
     }
     else if (type == SerialPortType.Sending)
     {
         Instance.Settings["SerialPort"]["Sending"] = data;
     }
     Instance.Save();
 }
Beispiel #2
0
 public static void SetSerialPort(SerialPortType type, bool open)
 {
     if (Instance == null)
     {
         Instance = GetInstance();
     }
     if (type == SerialPortType.Recieving)
     {
         Instance.Settings["SerialPort"]["Recieving"]["Enable"] = open;
     }
     else if (type == SerialPortType.Sending)
     {
         Instance.Settings["SerialPort"]["Sending"]["Enable"] = open;
     }
     Instance.Save();
 }
Beispiel #3
0
 public static Dictionary <string, dynamic> GetSerialPortData(SerialPortType type)
 {
     if (Instance == null)
     {
         Instance = GetInstance();
     }
     Instance.LoadOrDefault();
     if (type == SerialPortType.Recieving)
     {
         return(Instance.Settings["SerialPort"]["Recieving"]);
     }
     else if (type == SerialPortType.Sending)
     {
         return(Instance.Settings["SerialPort"]["Sending"]);
     }
     return(null);
 }
Beispiel #4
0
 public TelnetForwardTask(ILinuxBoard board,
                          int telnetPort,
                          SerialPortType serialDeviceType,
                          int serialDeviceNum,
                          SerialPortSettings serialSettings,
                          int timeOutSeconds,
                          Predicate <TelnetCom> IsOk
                          ) : base()
 {
     Board              = board;
     SerialSettings     = serialSettings;
     SerialDeviceNum    = serialDeviceNum;
     SerialDeviceType   = serialDeviceType;
     TelnetPort         = telnetPort;
     TimeOutSeconds     = timeOutSeconds;
     TestFirst          = true;
     InspectConfigFiles = true;
     IsConnectionOk     = IsOk;
 }