-
Notifications
You must be signed in to change notification settings - Fork 1
/
CBlueTooth.h
47 lines (38 loc) · 1.06 KB
/
CBlueTooth.h
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
47
/*
* Copyright (c) 2012 Alexandros Nikolopoulos <[email protected]>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*/
#ifndef CBLUETOOTH_H_
#define CBLUETOOTH_H_
#include "fpd.h"
#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
#include <bluetooth/hci_lib.h>
#include <bluetooth/rfcomm.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <errno.h>
class CBlueTooth : public CInterface
{
public:
CBlueTooth(map<string, string> settings);
virtual ~CBlueTooth();
int Connect(void);
int Disconnect(void);
int Send(uint8_t *message, int length);
int Receive(uint8_t *message, int length, time_t timeout);
string GetMyAddress(void);
private:
string m_host;
bool m_IsConnected;
bdaddr_t m_LocalAddr;
int m_Socket;
};
#endif /* CBLUETOOTH_H_ */