Kallisto Linux API
Library for interacting with Kallisto devices
bluetooth_dispatcher.hpp
Go to the documentation of this file.
1 
42 #ifndef BLUETOOTH_DISPATCHER_HPP
43 #define BLUETOOTH_DISPATCHER_HPP
44 
45 #include <string>
46 #include <vector>
47 #include <functional>
48 #include <memory>
49 
50 #include "../../util/error/kallisto_error.hpp"
51 
52 namespace kallisto {
53 namespace bluetooth {
54 
58 class BluetoothDispatcher {
59 protected:
64 
68  virtual ~BluetoothDispatcher();
69 
75  void operator=(BluetoothDispatcher const&) = delete;
76  void operator=(BluetoothDispatcher &&) = delete;
77 
78 public:
82  class NotificationListener {
83  protected:
88 
92  virtual ~NotificationListener();
93 
99  void operator=(NotificationListener const&) = delete;
100  void operator=(NotificationListener &&) = delete;
101 
102  public:
112  virtual void onNotification(std::string address, std::string service_uuid, std::string characteristic_uuid, const std::vector<unsigned char>& values) = 0;
113  };
114 
120  virtual error::KallistoDetailedResult getRssi(int& buffer) = 0;
121 
126  virtual std::vector<std::string> getServices() = 0;
127 
134  virtual std::vector<std::string> getCharacteristics(std::string service_uuid) = 0;
135 
143  virtual error::KallistoDetailedResult readCharacteristic(std::string service_uuid, std::string characteristic_uuid, std::vector<unsigned char>& buffer) = 0;
144 
152  virtual error::KallistoDetailedResult writeCharacteristic(std::string service_uuid, std::string characteristic_uuid, std::vector<unsigned char>& buffer) = 0;
153 
161  virtual error::KallistoDetailedResult enableNotification(std::string service_uuid, std::string characteristic_uuid, NotificationListener& listener) = 0;
162 
170  virtual error::KallistoDetailedResult disableNotification(std::string service_uuid, std::string characteristic_uuid, NotificationListener& listener) = 0;
171 };
172 
173 } /* namespace bluetooth */
174 } /* namespace kallisto */
175 
176 #endif // BLUETOOTH_DISPATCHER_HPP
Definition: bluetooth_adapter.hpp:52
virtual std::vector< std::string > getServices()=0
virtual std::vector< std::string > getCharacteristics(std::string service_uuid)=0
virtual error::KallistoDetailedResult writeCharacteristic(std::string service_uuid, std::string characteristic_uuid, std::vector< unsigned char > &buffer)=0
virtual error::KallistoDetailedResult disableNotification(std::string service_uuid, std::string characteristic_uuid, NotificationListener &listener)=0
virtual error::KallistoDetailedResult getRssi(int &buffer)=0
virtual void onNotification(std::string address, std::string service_uuid, std::string characteristic_uuid, const std::vector< unsigned char > &values)=0
virtual error::KallistoDetailedResult enableNotification(std::string service_uuid, std::string characteristic_uuid, NotificationListener &listener)=0
virtual error::KallistoDetailedResult readCharacteristic(std::string service_uuid, std::string characteristic_uuid, std::vector< unsigned char > &buffer)=0