|
TOBI Interface A
0.1
|
00001 /* 00002 This file is part of the TOBI Interface A (TiA) library. 00003 00004 Commercial Usage 00005 Licensees holding valid Graz University of Technology Commercial 00006 licenses may use this file in accordance with the Graz University 00007 of Technology Commercial License Agreement provided with the 00008 Software or, alternatively, in accordance with the terms contained in 00009 a written agreement between you and Graz University of Technology. 00010 00011 -------------------------------------------------- 00012 00013 GNU Lesser General Public License Usage 00014 Alternatively, this file may be used under the terms of the GNU Lesser 00015 General Public License version 3.0 as published by the Free Software 00016 Foundation and appearing in the file lgpl.txt included in the 00017 packaging of this file. Please review the following information to 00018 ensure the GNU General Public License version 3.0 requirements will be 00019 met: http://www.gnu.org/copyleft/lgpl.html. 00020 00021 In case of GNU Lesser General Public License Usage ,the TiA library 00022 is distributed in the hope that it will be useful, 00023 but WITHOUT ANY WARRANTY; without even the implied warranty of 00024 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00025 GNU General Public License for more details. 00026 00027 You should have received a copy of the GNU Lesser General Public License 00028 along with the TiA library. If not, see <http://www.gnu.org/licenses/>. 00029 00030 Copyright 2010 Graz University of Technology 00031 Contact: TiA@tobi-project.org 00032 */ 00033 00041 // local 00042 #include "tia/tia_client.h" 00043 #include "tia-private/client/tia_client_impl.h" 00044 #include "tia-private/client/tia_new_client_impl.h" 00045 00046 #include <iostream> 00047 00048 namespace tia 00049 { 00050 //----------------------------------------------------------------------------- 00051 00052 TiAClient::TiAClient(bool use_new_tia) : 00053 impl_(0) 00054 { 00055 if(use_new_tia) 00056 impl_ = new tia::TiANewClientImpl; 00057 else 00058 impl_ = new TiAClientImpl; 00059 } 00060 00061 //----------------------------------------------------------------------------- 00062 00063 TiAClient::~TiAClient() 00064 { 00065 if(impl_) 00066 delete impl_; 00067 } 00068 00069 //----------------------------------------------------------------------------- 00070 00071 void TiAClient::connect(const std::string& address, short unsigned port) 00072 { 00073 impl_->connect(address, port); 00074 } 00075 00076 //----------------------------------------------------------------------------- 00077 00078 bool TiAClient::connected() const 00079 { 00080 return impl_->connected(); 00081 } 00082 00083 //----------------------------------------------------------------------------- 00084 00085 void TiAClient::disconnect() 00086 { 00087 impl_->disconnect(); 00088 } 00089 00090 //----------------------------------------------------------------------------- 00091 00092 void TiAClient::requestConfig() 00093 { 00094 impl_->requestConfig(); 00095 } 00096 00097 //----------------------------------------------------------------------------- 00098 00099 SSConfig TiAClient::config() const 00100 { 00101 return impl_->config(); 00102 } 00103 00104 //----------------------------------------------------------------------------- 00105 00106 void TiAClient::startReceiving(bool use_udp_bc) 00107 { 00108 impl_->startReceiving(use_udp_bc); 00109 } 00110 00111 //----------------------------------------------------------------------------- 00112 00113 bool TiAClient::receiving() const 00114 { 00115 return impl_->receiving(); 00116 } 00117 00118 //----------------------------------------------------------------------------- 00119 00120 void TiAClient::stopReceiving() 00121 { 00122 impl_->stopReceiving(); 00123 } 00124 00125 //----------------------------------------------------------------------------- 00126 00127 void TiAClient::getDataPacket(DataPacket& packet) 00128 { 00129 impl_->getDataPacket(packet); 00130 } 00131 00132 //----------------------------------------------------------------------------- 00133 00134 DataPacket* TiAClient::getEmptyDataPacket() 00135 { 00136 return impl_->getEmptyDataPacket(); 00137 } 00138 00139 //----------------------------------------------------------------------------- 00140 00141 void TiAClient::setBufferSize(size_t size) 00142 { 00143 impl_->setBufferSize(size); 00144 } 00145 00146 //----------------------------------------------------------------------------- 00147 00148 } // Namespace tobiss