Ejemplo n.º 1
0
 /// <summary>
 ///     init
 /// </summary>
 public void InitIo()
 {
     if (HANDLE != null)
     {
         aaeonSmbusClose(HANDLE);
     }
     HANDLE = aaeonSmbusOpen();
     try
     {
         aaeonSmbusWriteByte(HANDLE, 0X6E, (byte)(GROUP * 16), 0xFF);     //all output
         aaeonSmbusWriteByte(HANDLE, 0X6E, (byte)(GROUP * 16 + 1), 0x00); //all low
     }
     catch (Exception e)
     {
         gpioLog.WriteLog("gpio初始化失败", e.ToString());
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 ///     TCPServer 构造函数
 /// </summary>
 /// <param name="port"></param>
 /// <param name="count"></param>
 public TcpServer(int port, int count)
 {
     _ip             = GetLocalIPV4();
     Port            = port;
     _maxClientCount = count;
     _mClientSockets = new List <Socket>();
     //初始化IP终端
     _ipEndPoint = new IPEndPoint(IPAddress.Any, port);
     //初始化服务器端Socket
     _mServerSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
     //Socket绑定端口
     _mServerSocket.Bind(_ipEndPoint);
     //设置监听数目
     _mServerSocket.Listen(_maxClientCount);
     //写日志记录
     tcpLog.WriteLog("Tcp init", IP);
 }