automotive-message-broker  0.14.803
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
bluetooth5.h
1 #ifndef BLUETOOTH_5_H_
2 #define BLUETOOOTH_5_H_
3 
4 #include <string>
5 #include <functional>
6 #include <superptr.hpp>
7 
8 typedef std::function<void(int)> ConnectedCallback;
9 
10 std::string findDevice(std::string address, std::string adapterPath="");
11 
13 {
14 public:
15  Bluetooth5();
16 
17  bool setDevice(std::string address);
18  void getDeviceForAddress(std::string address, ConnectedCallback onnectedCallback);
19 
20  void connected_(int fd);
21 
22  void connect(ConnectedCallback onconnectedCallback);
23  void disconnect();
24 
25 
26 private:
27  ConnectedCallback mConnected;
28  amb::super_ptr<GDBusConnection> mConnection;
29  std::string mPath;
30 };
31 
32 #endif