27 #include <nidas/Config.h>
29 #ifdef HAVE_BLUETOOTH_RFCOMM_H
31 #ifndef NIDAS_UTIL_BLUETOOTHRFCOMMSOCKET_H
32 #define NIDAS_UTIL_BLUETOOTHRFCOMMSOCKET_H
37 namespace nidas {
namespace util {
42 class BluetoothRFCommSocket {
53 BluetoothRFCommSocket() throw(IOException);
58 BluetoothRFCommSocket(const BluetoothAddress& addr,
int channel)
64 BluetoothRFCommSocket(const std::
string& addr,
int channel)
65 throw(UnknownHostException,IOException);
70 BluetoothRFCommSocket(const SocketAddress& addr) throw(IOException);
76 BluetoothRFCommSocket(
int fd, const SocketAddress& raddr) throw(IOException);
81 BluetoothRFCommSocket(const BluetoothRFCommSocket&);
86 BluetoothRFCommSocket& operator = (const BluetoothRFCommSocket& rhs);
91 ~BluetoothRFCommSocket() throw();
93 void close() throw(IOException);
102 void setTimeout(
int val);
104 int getTimeout() const;
111 void setNonBlocking(
bool val) throw(IOException);
113 bool isNonBlocking() const throw(IOException);
127 void connect(const std::
string& addr,
int channel)
128 throw(UnknownHostException,IOException);
133 void connect(const BluetoothAddress& addr,
int channel)
139 void connect(const SocketAddress& addr)
155 void bind(
int channel) throw(IOException);
157 void bind(const BluetoothAddress& addr,
int channel)
160 void bind(const SocketAddress& sockaddr) throw(IOException);
162 void listen() throw(IOException);
164 BluetoothRFCommSocket* accept() throw(IOException);
169 int getFd()
const {
return _fd; }
171 size_t recv(
void* buf,
size_t len,
int flags = 0)
180 size_t send(const
void* buf,
size_t len,
int flags=0)
183 size_t send(const struct iovec* iov,
int iovcnt,
int flags=MSG_NOSIGNAL)
197 void sendall(const
void* buf,
size_t len,
int flags=MSG_NOSIGNAL)
203 const SocketAddress& getRemoteSocketAddress() const throw();
209 int getRemotePort() const throw();
214 const SocketAddress& getLocalSocketAddress() const throw();
220 int getLocalPort() const throw();
222 int getDomain()
const {
return AF_BLUETOOTH; }
229 void getLocalAddr() throw(IOException);
234 void getRemoteAddr() throw(IOException);
238 SocketAddress* _localaddr;
240 SocketAddress* _remoteaddr;
244 struct timespec _timeout;
int len
Definition: sing.cc:934
int fd
Definition: twod.c:56