Esempio n. 1
0
        /// <summary>
        /// 建立和Led的连接
        /// </summary>
        /// <returns></returns>
        public bool Open()
        {
            PDeviceParam param = new PDeviceParam();

            param.FlowCon = 0;
            param.devType = 1;
            param.rmtPort = Convert.ToUInt16(m_nServerPort);
            param.locPort = Convert.ToUInt16(m_nLocalPort);

            m_hDeviceHandle = LED_Open(ref param, 0, 0, 0);
            if (m_hDeviceHandle == -1)
            {
                m_bOpened     = false;
                m_szStateInfo = "close";
                return(false);
            }
            else
            {
                m_bOpened     = true;
                m_szStateInfo = "close";
                return(true);
            }
        }
Esempio n. 2
0
 public static extern int LED_Open(ref PDeviceParam param, int Notify, int Window, int Message);
Esempio n. 3
0
 public static extern int LED_Open(ref PDeviceParam param, int Notify, int Window, int Message);