-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbluetoothtools.h
More file actions
46 lines (34 loc) · 814 Bytes
/
bluetoothtools.h
File metadata and controls
46 lines (34 loc) · 814 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef BLUETOOTHTOOLS_H
#define BLUETOOTHTOOLS_H
#include <glib.h>
#include <gio/gio.h>
#include <dbus/dbus.h>
#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
#include <bluetooth/hci_lib.h>
#include <bluetooth/rfcomm.h>
#include <vector>
#include <cstring>
#include <string>
#include <iostream>
#include <algorithm>
class BluetoothTools
{
private:
///
int m_socket ;
public:
///
BluetoothTools ( ) ;
///
size_t scan_devices ( std::vector< std::pair< std::string, std::string > > & list , int search_timeout ) ;
///
int pair_device ( std::string address , char * pin ) ;
///
int connect_device ( std::string address) ;
///
ssize_t recv ( char * , size_t ) ;
///
ssize_t send ( const char * , size_t ) ;
};
#endif // BLUETOOTHTOOLS_H