예제 #1
0
파일: KNXSender.cs 프로젝트: tcharp/knx.net
 internal KNXSender(KNXConnection connection)
 {
     this.KNXConnection = connection;
 }
예제 #2
0
 internal KNXReceiver(KNXConnection connection)
 {
     this.KNXConnection = connection;
 }
예제 #3
0
 /// <summary>
 /// Disconnects from the remote host.
 /// </summary>
 public KnxClientHelper Disconnect()
 {
     if (knxClient != null)
     {
         knxClient.KNXConnectedDelegate -= knxClient_Connected;
         knxClient.KNXDisconnectedDelegate -= knxClient_Disconnected;
         knxClient.KNXEventDelegate -= knxClient_EventReceived;
         knxClient.KNXStatusDelegate -= knxClient_StatusReceived;
         try { knxClient.Disconnect(); } catch { }
         knxClient = null;
     }
     return this;
 }
예제 #4
0
 /// <summary>
 /// Connect to the remote host using the specified port.
 /// </summary>
 /// <param name="port">Port number.</param>
 public KnxClientHelper Connect()
 {
     if (knxClient != null)
     {
         knxClient.Disconnect();
     }
     if (knxEndPoint == null)
     {
         knxClient = new KNXConnectionRouting();
     }
     else
     {
         if (knxEndPoint.RemoteIp != null && knxEndPoint.LocalIp != null)
         {
             knxClient = new KNXConnectionTunneling(knxEndPoint.RemoteIp, knxEndPoint.RemotePort, knxEndPoint.LocalIp, knxEndPoint.LocalPort);
         }
         else if (knxEndPoint.LocalIp != null && knxEndPoint.LocalPort > 0)
         {
             knxClient = new KNXConnectionRouting(knxEndPoint.LocalIp, knxEndPoint.LocalPort);
         }
         else if (knxEndPoint.LocalIp != null && knxEndPoint.LocalPort == 0)
         {
             knxClient = new KNXConnectionRouting(knxEndPoint.LocalIp);
         }
         else if (knxEndPoint.LocalPort > 0)
         {
             knxClient = new KNXConnectionRouting(knxEndPoint.LocalPort);
         }
     }
     knxClient.Connect();
     knxClient.KNXConnectedDelegate += knxClient_Connected;
     knxClient.KNXDisconnectedDelegate += knxClient_Disconnected;
     knxClient.KNXEventDelegate += knxClient_EventReceived;
     knxClient.KNXStatusDelegate += knxClient_StatusReceived;
     return this;
 }
예제 #5
0
 internal KNXReceiver(KNXConnection connection)
 {
     this.KNXConnection = connection;
 }
예제 #6
0
파일: KNXSender.cs 프로젝트: tcharp/knx.net
 internal KNXSender(KNXConnection connection)
 {
     this.KNXConnection = connection;
 }