27#include <nidas/Config.h>
29#ifdef HAVE_BLUETOOTH_RFCOMM_H
31#ifndef NIDAS_UTIL_BLUETOOTHRFCOMMSOCKET_H
32#define NIDAS_UTIL_BLUETOOTHRFCOMMSOCKET_H
37namespace nidas {
namespace util {
42class BluetoothRFCommSocket {
55 BluetoothRFCommSocket();
62 BluetoothRFCommSocket(
const BluetoothAddress& addr,
int channel);
70 BluetoothRFCommSocket(
const std::string& addr,
int channel);
77 BluetoothRFCommSocket(
const SocketAddress& addr);
85 BluetoothRFCommSocket(
int fd,
const SocketAddress& raddr);
90 BluetoothRFCommSocket(
const BluetoothRFCommSocket&);
95 BluetoothRFCommSocket& operator = (
const BluetoothRFCommSocket& rhs);
100 ~BluetoothRFCommSocket() throw();
114 void setTimeout(
int val);
116 int getTimeout() const;
125 void setNonBlocking(
bool val);
130 bool isNonBlocking() const;
147 void connect(const std::
string& addr,
int channel);
154 void connect(const BluetoothAddress& addr,
int channel);
161 void connect(const SocketAddress& addr);
178 void bind(
int channel);
183 void bind(const BluetoothAddress& addr,
int channel);
188 void bind(const SocketAddress& sockaddr);
198 BluetoothRFCommSocket* accept();
203 int getFd()
const {
return _fd; }
208 size_t recv(
void* buf,
size_t len,
int flags = 0);
218 size_t send(
const void* buf,
size_t len,
int flags=0);
223 size_t send(
const struct iovec* iov,
int iovcnt,
int flags=MSG_NOSIGNAL);
238 void sendall(
const void* buf,
size_t len,
int flags=MSG_NOSIGNAL);
245 const SocketAddress& getRemoteSocketAddress()
const;
253 int getRemotePort()
const;
260 const SocketAddress& getLocalSocketAddress()
const;
268 int getLocalPort()
const;
270 int getDomain()
const {
return AF_BLUETOOTH; }
286 void getRemoteAddr();
290 SocketAddress* _localaddr;
292 SocketAddress* _remoteaddr;
296 struct timespec _timeout;
Root namespace for the NCAR In-Situ Data Acquisition Software.
Definition A2DConverter.h:31
int len
Definition sing.cc:948
int fd
Definition twod.c:56