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