BluetoothClient.h

Go to the documentation of this file.
00001 /*
00002  *    Copyright 2006 Baylor University
00003  * 
00004  *    Licensed under the Apache License, Version 2.0 (the "License");
00005  *    you may not use this file except in compliance with the License.
00006  *    You may obtain a copy of the License at
00007  * 
00008  *        http://www.apache.org/licenses/LICENSE-2.0
00009  * 
00010  *    Unless required by applicable law or agreed to in writing, software
00011  *    distributed under the License is distributed on an "AS IS" BASIS,
00012  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  *    See the License for the specific language governing permissions and
00014  *    limitations under the License.
00015  */
00016 
00017 #ifndef _OASYS_BT_CLIENT_H_
00018 #define _OASYS_BT_CLIENT_H_
00019 
00020 #include <config.h> 
00021 #ifdef OASYS_BLUETOOTH_ENABLED
00022 
00023 #include "../io/IOClient.h"
00024 #include "BluetoothSocket.h"
00025 
00026 namespace oasys {
00027 
00031 class BluetoothClient : public BluetoothSocket, public IOClient {
00032 public:
00033     BluetoothClient(int socktype, BluetoothSocket::proto_t proto,
00034                     const char* logbase, Notifier* intr=0);
00035     BluetoothClient(int socktype, BluetoothSocket::proto_t proto, int fd,
00036                     bdaddr_t remote_addr, u_int8_t remote_channel,
00037                     const char* logbase,Notifier* intr=0);
00038     virtual ~BluetoothClient();
00039     
00040     // Virtual from IOClient
00041     virtual int read(char* bp, size_t len);
00042     virtual int write(const char* bp, size_t len);
00043     virtual int readv(const struct iovec* iov, int iovcnt);
00044     virtual int writev(const struct iovec* iov, int iovcnt);
00045     
00046     virtual int readall(char* bp, size_t len);
00047     virtual int writeall(const char* bp, size_t len);
00048     virtual int readvall(const struct iovec* iov, int iovcnt);
00049     virtual int writevall(const struct iovec* iov, int iovcnt);
00050     
00051     virtual int timeout_read(char* bp, size_t len, int timeout_ms);
00052     virtual int timeout_readv(const struct iovec* iov, int iovcnt,
00053                               int timeout_ms);
00054     virtual int timeout_readall(char* bp, size_t len, int timeout_ms);
00055     virtual int timeout_readvall(const struct iovec* iov, int iovcnt,
00056                                  int timeout_ms);
00057 
00058     virtual int timeout_write(const char* bp, size_t len, int timeout_ms);
00059     virtual int timeout_writev(const struct iovec* iov, int iovcnt,
00060                                int timeout_ms);
00061     virtual int timeout_writeall(const char* bp, size_t len, int timeout_ms);
00062     virtual int timeout_writevall(const struct iovec* iov, int iovcnt,
00063                                   int timeout_ms);
00064 
00065     virtual int get_nonblocking(bool *nonblockingp);
00066     virtual int set_nonblocking(bool nonblocking);
00067 };
00068 
00069 } // namespace oasys
00070 
00071 #endif /* OASYS_BLUETOOTH_ENABLED */
00072 #endif /* _OASYS_BT_CLIENT_H_ */

Generated on Sat Sep 8 08:43:24 2007 for DTN Reference Implementation by  doxygen 1.5.3