source: source/ariba/utility/transport/rfcomm/bluetooth_rfcomm.hpp@ 12750

Last change on this file since 12750 was 10700, checked in by Michael Tänzer, 12 years ago

Merge CMake branch into trunk

File size: 1.2 KB
Line 
1#include "ariba/config.h"
2
3#ifdef HAVE_LIBBLUETOOTH
4
5#ifndef BOOST_ASIO_BLUETOOTH_RFCOMM_HPP__
6#define BOOST_ASIO_BLUETOOTH_RFCOMM_HPP__
7
8#include "bluetooth_endpoint.hpp"
9
10#include <bluetooth/bluetooth.h>
11#include <bluetooth/rfcomm.h>
12
13namespace boost {
14namespace asio {
15namespace bluetooth {
16
17/**
18 * The rfcomm class contains flags necessary for RFCOMM sockets.
19 *
20 * @author Martin Florian <mflorian@lafka.net>
21 */
22class rfcomm {
23public:
24 /// The type of endpoint.
25 typedef bluetooth_endpoint<rfcomm> endpoint;
26
27 /// Get an Instance.
28 /// We need this to fulfill the asio Endpoint requirements, I think.
29 static rfcomm get() {
30 return rfcomm();
31 }
32
33 /// Obtain an identifier for the type of the protocol.
34 int type() const {
35 return SOCK_STREAM;
36 }
37
38 /// Obtain an identifier for the protocol.
39 int protocol() const {
40 return BTPROTO_RFCOMM;
41 }
42
43 /// Obtain an identifier for the protocol family.
44 int family() const {
45 return AF_BLUETOOTH;
46 }
47
48 /// The RFCOMM socket type, lets pray that this will work.
49 typedef basic_stream_socket<rfcomm> socket;
50
51 /// The RFCOMM acceptor type.
52 typedef basic_socket_acceptor<rfcomm> acceptor;
53
54};
55
56}}} // namespace boost::asio::bluetooth
57
58#endif /* BOOST_ASIO_BLUETOOTH_RFCOMM_HPP__ */
59#endif /* HAVE_LIBBLUETOOTH */
Note: See TracBrowser for help on using the repository browser.