![]() |
User Manual, Developers Guide and API Documentation |
![]() |
00001 /******************************************************************************* 00002 * This file is part of openWNS (open Wireless Network Simulator) 00003 * _____________________________________________________________________________ 00004 * 00005 * Copyright (C) 2004-2007 00006 * Chair of Communication Networks (ComNets) 00007 * Kopernikusstr. 5, D-52074 Aachen, Germany 00008 * phone: ++49-241-80-27910, 00009 * fax: ++49-241-80-22242 00010 * email: info@openwns.org 00011 * www: http://www.openwns.org 00012 * _____________________________________________________________________________ 00013 * 00014 * openWNS is free software; you can redistribute it and/or modify it under the 00015 * terms of the GNU Lesser General Public License version 2 as published by the 00016 * Free Software Foundation; 00017 * 00018 * openWNS is distributed in the hope that it will be useful, but WITHOUT ANY 00019 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 00020 * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 00021 * details. 00022 * 00023 * You should have received a copy of the GNU Lesser General Public License 00024 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00025 * 00026 ******************************************************************************/ 00027 00028 #include <RISE/transceiver/SCTransmitter.hpp> 00029 #include <RISE/medium/PhysicalResource.hpp> 00030 00031 #include <WNS/pyconfig/View.hpp> 00032 00033 #include <sstream> 00034 00035 using namespace rise; 00036 00037 SCTransmitter::SCTransmitter(const wns::pyconfig::View& config, Station* s, antenna::Antenna* a) : 00038 Transmitter(config, s, a), 00039 active(false) 00040 { 00041 } 00042 00043 SCTransmitter::~SCTransmitter() 00044 { 00045 } 00046 00047 void SCTransmitter::startTransmitting(TransmissionObjectPtr transmissionObject) 00048 { 00049 assure(!prc.empty(), "PhysicalResource is missing"); 00050 assure(!active, "This Transmitter allows only one Transmission at a time"); 00051 active = true; 00052 Transmitter::startTransmitting(transmissionObject, 0); 00053 } 00054 00055 void SCTransmitter::stopTransmitting(TransmissionObjectPtr transmissionObject) 00056 { 00057 assure(active, "Transmitter not active, although trying to stop a transmission"); 00058 active = false; 00059 Transmitter::stopTransmitting(transmissionObject); 00060 } 00061 00062 void SCTransmitter::tune(double f, double b) 00063 { 00064 Transmitter::tune(f, b, 1); 00065 } 00066 00067 void SCTransmitter::mobilityUpdate() 00068 { 00069 assure(!prc.empty(), "SCTransmitter must be tuned to PhysicalResource"); 00070 prc.at(0)->mobilityUpdate(this); 00071 } 00072 00073 double SCTransmitter::getFrequency() 00074 { 00075 assure(!prc.empty(), "SCTransmitter not tuned."); 00076 return prc.at(0)->getFrequency(); 00077 } 00078 00079 bool SCTransmitter::isActive() const 00080 { 00081 return active; 00082 } 00083 00084
1.5.5