00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include <config.h>
00018 #ifdef OASYS_BLUETOOTH_ENABLED
00019
00020 #include <errno.h>
00021 extern int errno;
00022
00023 #include "BluetoothClient.h"
00024
00025 namespace oasys {
00026
00027 BluetoothClient::BluetoothClient(int socktype, BluetoothSocket::proto_t proto,
00028 const char* logbase, Notifier* intr)
00029 : IOHandlerBase(intr),
00030 BluetoothSocket(socktype, proto, logbase)
00031 {
00032 }
00033
00034 BluetoothClient::BluetoothClient(int socktype, BluetoothSocket::proto_t proto,
00035 int fd, bdaddr_t remote_addr,
00036 u_int8_t remote_channel,
00037 const char* logbase, Notifier* intr)
00038 : IOHandlerBase(intr),
00039 BluetoothSocket(socktype, proto, fd, remote_addr,
00040 remote_channel, logbase)
00041 {
00042 }
00043
00044 BluetoothClient::~BluetoothClient()
00045 {
00046 }
00047
00048 int
00049 BluetoothClient::read(char* bp, size_t len)
00050 {
00051 return IO::read(fd_, bp, len, get_notifier(), logpath_);
00052 }
00053
00054 int
00055 BluetoothClient::readv(const struct iovec* iov, int iovcnt)
00056 {
00057 return IO::readv(fd_, iov, iovcnt, get_notifier(), logpath_);
00058 }
00059
00060 int
00061 BluetoothClient::write(const char* bp, size_t len)
00062 {
00063 return IO::write(fd_, bp, len, get_notifier(), logpath_);
00064 }
00065
00066 int
00067 BluetoothClient::writev(const struct iovec* iov, int iovcnt)
00068 {
00069 return IO::writev(fd_, iov, iovcnt, get_notifier(), logpath_);
00070 }
00071
00072 int
00073 BluetoothClient::readall(char* bp, size_t len)
00074 {
00075 return IO::readall(fd_, bp, len, get_notifier(), logpath_);
00076 }
00077
00078 int
00079 BluetoothClient::writeall(const char* bp, size_t len)
00080 {
00081 return IO::writeall(fd_, bp, len, get_notifier(), logpath_);
00082 }
00083
00084 int
00085 BluetoothClient::readvall(const struct iovec* iov, int iovcnt)
00086 {
00087 return IO::readvall(fd_, iov, iovcnt, get_notifier(), logpath_);
00088 }
00089
00090 int
00091 BluetoothClient::writevall(const struct iovec* iov, int iovcnt)
00092 {
00093 return IO::writevall(fd_, iov, iovcnt, get_notifier(), logpath_);
00094 }
00095
00096 int
00097 BluetoothClient::timeout_read(char* bp, size_t len, int timeout_ms)
00098 {
00099 return IO::timeout_read(fd_, bp, len, timeout_ms,
00100 get_notifier(), logpath_);
00101 }
00102
00103 int
00104 BluetoothClient::timeout_readv(const struct iovec* iov,
00105 int iovcnt,
00106 int timeout_ms)
00107 {
00108 return IO::timeout_readv(fd_, iov, iovcnt, timeout_ms, get_notifier(),
00109 logpath_);
00110 }
00111
00112 int
00113 BluetoothClient::timeout_readall(char* bp, size_t len, int timeout_ms)
00114 {
00115 return IO::timeout_readall(fd_, bp, len, timeout_ms, get_notifier(),
00116 logpath_);
00117 }
00118
00119 int
00120 BluetoothClient::timeout_readvall(const struct iovec* iov, int iovcnt,
00121 int timeout_ms)
00122 {
00123 return IO::timeout_readvall(fd_, iov, iovcnt, timeout_ms, get_notifier(),
00124 logpath_);
00125 }
00126
00127 int
00128 BluetoothClient::timeout_write(const char* bp, size_t len, int timeout_ms)
00129 {
00130 int cc = IO::timeout_write(fd_, bp, len, timeout_ms,
00131 get_notifier(), logpath_);
00132 return cc;
00133 }
00134
00135 int
00136 BluetoothClient::timeout_writev(const struct iovec* iov, int iovcnt, int timeout_ms)
00137 {
00138 int cc = IO::timeout_writev(fd_, iov, iovcnt, timeout_ms,
00139 get_notifier(), logpath_);
00140 return cc;
00141 }
00142
00143 int
00144 BluetoothClient::timeout_writeall(const char* bp, size_t len, int timeout_ms)
00145 {
00146 int cc = IO::timeout_writeall(fd_, bp, len, timeout_ms,
00147 get_notifier(), logpath_);
00148 return cc;
00149 }
00150
00151 int
00152 BluetoothClient::timeout_writevall(const struct iovec* iov, int iovcnt, int timeout_ms)
00153 {
00154 int cc = IO::timeout_writevall(fd_, iov, iovcnt, timeout_ms,
00155 get_notifier(), logpath_);
00156 return cc;
00157 }
00158
00159 int
00160 BluetoothClient::get_nonblocking(bool *nonblockingp)
00161 {
00162 return IO::get_nonblocking(fd_, nonblockingp, logpath_);
00163 }
00164
00165 int
00166 BluetoothClient::set_nonblocking(bool nonblocking)
00167 {
00168 ASSERT(fd_ != -1);
00169 return IO::set_nonblocking(fd_, nonblocking, logpath_);
00170 }
00171
00172 }
00173 #endif