Пример #1
0
        private void ProcessConnectionStateResponse(byte[] datagram)
        {
            // HEADER
            // 06 10 02 08 00 08 -- 48 21
            var knxDatagram = new KnxDatagram
            {
                header_length    = datagram[0],
                protocol_version = datagram[1],
                service_type     = new[] { datagram[2], datagram[3] },
                total_length     = datagram[4] + datagram[5],
                channel_id       = datagram[6]
            };

            var response = datagram[7];

            if (response != 0x21)
            {
                return;
            }

            if (KnxConnection.Debug)
            {
                Console.WriteLine("KnxReceiverTunneling: Received connection state response - No active connection with channel ID {0}", knxDatagram.channel_id);
            }

            KnxConnection.Disconnect();
        }
Пример #2
0
        private void ProcessConnectionStateResponse(byte[] datagram)
        {
            // HEADER
            // 06 10 02 08 00 08 -- 48 21
            var knxDatagram = new KnxDatagram
            {
                header_length    = datagram[0],
                protocol_version = datagram[1],
                service_type     = new[] { datagram[2], datagram[3] },
                total_length     = datagram[4] + datagram[5],
                channel_id       = datagram[6]
            };

            var response = datagram[7];

            //_logger.Debug(ClassName, "Received connection state response - response {0}", response);

            if (response != 0x21)
            {
                return;
            }

            _logger.Debug(ClassName, "Received connection state response - No active connection with channel ID {0}", knxDatagram.channel_id);

            KnxConnection.Disconnect();
        }
Пример #3
0
        private void ProcessDisconnectRequest(byte[] datagram)
        {
            var channelId = datagram[6];

            if (channelId != KnxConnectionTunneling.ChannelId)
            {
                return;
            }

            Stop();
            KnxConnection.Disconnected();
            _udpClient.Close();
        }
Пример #4
0
        private static void Main()
        {
            _connection = new KnxConnectionTunneling("10.0.250.20", 3671, "10.0.253.5", 3671) { Debug = false };
            _connection.KnxConnectedDelegate += Connected;
            _connection.KnxDisconnectedDelegate += Disconnected;
            _connection.KnxEventDelegate += Event;
            _connection.KnxStatusDelegate += Status;
            _connection.Connect();

            Console.WriteLine("Done. Press [ENTER] to finish");
            Console.Read();

            _connection.KnxDisconnectedDelegate -= Disconnected;
            _connection.Disconnect();
            Environment.Exit(0);
        }
Пример #5
0
        private static void Main()
        {
            _connection = new KnxConnectionRouting { Debug = false, ActionMessageCode = 0x29 };
            _connection.KnxConnectedDelegate += Connected;
            _connection.KnxDisconnectedDelegate += Disconnected;
            _connection.KnxEventDelegate += Event;
            _connection.KnxStatusDelegate += Status;
            _connection.Connect();

            LightOnOff();
            //BlindUpDown1();
            //BlindUpDown2();
            //TemperatureSetpoint();

            Console.WriteLine("Done. Press [ENTER] to finish");
            Console.Read();
            Environment.Exit(0);
        }
Пример #6
0
 internal KnxReceiverTunneling(KnxConnection connection, UdpClient udpClient, IPEndPoint localEndpoint)
     : base(connection)
 {
     _udpClient     = udpClient;
     _localEndpoint = localEndpoint;
 }
Пример #7
0
 internal KnxSenderRouting(KnxConnection connection, IList<UdpClient> udpClients, IPEndPoint remoteEndpoint)
     : base(connection)
 {
     _udpClients = udpClients;
     _remoteEndpoint = remoteEndpoint;
 }
Пример #8
0
 internal KnxReceiverRouting(KnxConnection connection, IList <UdpClient> udpClients)
     : base(connection)
 {
     _udpClients = udpClients;
 }
Пример #9
0
 internal KnxSenderTunneling(KnxConnection connection, UdpClient udpClient, IPEndPoint remoteEndpoint)
     : base(connection)
 {
     _udpClient      = udpClient;
     _remoteEndpoint = remoteEndpoint;
 }
Пример #10
0
 internal KnxReceiverTunneling(KnxConnection connection, UdpClient udpClient, IPEndPoint localEndpoint)
     : base(connection)
 {
     _udpClient = udpClient;
     _localEndpoint = localEndpoint;
 }
Пример #11
0
 protected KnxReceiver(KnxConnection connection)
 {
     KnxConnection = connection;
 }
Пример #12
0
 internal KnxSenderRouting(KnxConnection connection, IList <UdpClient> udpClients, IPEndPoint remoteEndpoint)
     : base(connection)
 {
     _udpClients     = udpClients;
     _remoteEndpoint = remoteEndpoint;
 }
Пример #13
0
 protected KnxSender(KnxConnection connection) => KnxConnection = connection;
Пример #14
0
 internal KnxSenderTunneling(KnxConnection connection, UdpClient udpClient, IPEndPoint remoteEndpoint)
     : base(connection)
 {
     _udpClient = udpClient;
     _remoteEndpoint = remoteEndpoint;
 }
Пример #15
0
 internal KnxReceiverRouting(KnxConnection connection, IList<UdpClient> udpClients)
     : base(connection)
 {
     _udpClients = udpClients;
 }
Пример #16
0
 protected KnxReceiver(KnxConnection connection)
 {
     KnxConnection = connection;
 }