libknx
connection.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <functional>
4 
5 #include "debug.hpp"
6 #include "config.hpp"
7 #include "dpt.hpp"
8 #include "group.hpp"
9 
14 namespace knx
15 {
16 
20 class connection_private;
21 
25 class KNX_IMPORT_EXPORT connection
26 {
27 public:
31  connection ( const knx::config & config );
32 
34  ~connection();
35 
44  void start();
45 
51  void stop();
52 
58  template<typename data_type>
59  void set ( knx::group group, typename data_type::set_type data );
60 
69  template<typename data_type>
70  bool get ( knx::group group, typename data_type::set_type & data );
71 
104  template<typename data_type>
105  bool listen ( knx::group group, std::function<void ( typename data_type::set_type & ) > callback );
106 
107 
108 private:
110  connection_private * connection_private_pointer;
112  connection ( connection & rhs );
114  connection & operator= ( connection & rhs );
115 };
116 
117 }
118 
This class represents a KNX group address which might be either 3 compnent "a/b/c" or 2 component "a/...
Definition: group.hpp:16
This class represents the configuration of the knx connection.
Definition: config.hpp:18
separated namespace to embed all libknx related classes
Definition: connection.hpp:14
This class handles the ip connection(s) to the knx gateway.
Definition: connection.hpp:25