Kallisto Linux API
Library for interacting with Kallisto devices
bluetooth_adapter_manager.hpp
Go to the documentation of this file.
1 
42 #ifndef BLUETOOTH_ADAPTER_MANAGER_HPP_
43 #define BLUETOOTH_ADAPTER_MANAGER_HPP_
44 
45 #include "bluetooth_adapter.hpp"
46 #include "../../util/error/kallisto_error.hpp"
47 
48 #include <vector>
49 #include <memory>
50 
51 namespace kallisto {
52 namespace bluetooth {
53 
54 class BluetoothAdapterManagerNative; //Forward declaration of the native implementation
55 
59 class BluetoothAdapterManager {
60 public:
64  class Listener {
65  protected:
66  virtual ~Listener(){}
67 
68  public:
73  virtual void onAdapterConnected(BluetoothAdapter& adapter) = 0;
74 
79  virtual void onAdapterDisconnected(BluetoothAdapter& adapter) = 0;
80  };
81 
82 private:
83  //Holds the native implementation
84  std::unique_ptr<BluetoothAdapterManagerNative> m_native_implementation;
85 
86 public:
91 
96 
102  void operator=(BluetoothAdapterManager const&) = delete;
103  void operator=(BluetoothAdapterManager &&) = delete;
104 
109  const std::vector<BluetoothAdapter*> getAdapters();
110 
115  BluetoothAdapter* getAdapter(std::string id);
116 
122  error::KallistoDetailedResult registerListener(BluetoothAdapterManager::Listener& listener);
123 
127  void unregisterListener();
128 
133  static bool supportsLowEnergy();
134 };
135 
136 } /* namespace bluetooth */
137 } /* namespace kallisto */
138 
139 #endif /* BLUETOOTH_ADAPTER_MANAGER_HPP_ */
Definition: bluetooth_adapter.hpp:52
virtual void onAdapterDisconnected(BluetoothAdapter &adapter)=0
virtual void onAdapterConnected(BluetoothAdapter &adapter)=0
const std::vector< BluetoothAdapter * > getAdapters()
BluetoothAdapter * getAdapter(std::string id)
error::KallistoDetailedResult registerListener(BluetoothAdapterManager::Listener &listener)