Пример #1
0
 /// <summary>
 /// 建立和Led的连接
 /// </summary>
 /// <returns></returns>
 public bool Open()
 {
     LedSdk.PDeviceParam param = new LedSdk.PDeviceParam();
     param.FlowCon = 0;
     param.devType = LedSdk.DEVICE_TYPE_UDP;
     param.rmtPort = _remote_port;
     param.locPort = _local_port;
     // 建立连接
     _dev = LedSdk.LED_Open(ref param, 0, 0, 0);
     if (_dev == -1)
     {
         Status = DeviceStatus.CLOSE;
         return(false);
     }
     else
     {
         Status = DeviceStatus.INIT;
         return(true);
     }
 }
Пример #2
0
 /// <summary>
 /// 建立和Led的连接
 /// </summary>
 /// <returns></returns>
 public bool Open()
 {
     LedSdk.PDeviceParam param = new LedSdk.PDeviceParam();
     param.FlowCon = 0;
     param.devType = LedSdk.DEVICE_TYPE_UDP;
     param.rmtPort = _remote_port;
     param.locPort = _local_port;
     // 建立连接
     _dev = LedSdk.LED_Open(ref param, 0, 0, 0);
     if (_dev == -1)
     {
         Status =  DeviceStatus.CLOSE;
         return false;
     }
     else
     {
         Status = DeviceStatus.INIT;
         return true;
     }
 }