17 #include <sys/types.h> 28 : configuration_(configuration),
30 startTime_(
senf::ClockService::
now()),
31 nextTimeout_(
senf::ClockService::clock_type(0)),
32 athSpectralScan_(configuration.phyName),
33 spectralUnknownType_(0),
40 pktFrequencyMismatch_(0)
53 return athSpectralScan_;
56 prefix_ void AnalyzerBase::timerEvent()
81 bool rtn = athSpectralScan_.
callback(
87 prefix_ void AnalyzerBase::request()
89 senf::RadiotapPacket rtPacket (
input());
90 senf::RadiotapPacket::Parser rtParser (rtPacket.parser());
92 if (!rtParser.tsftPresent()) {
125 if (rtParser.channelOptionsPresent()) {
126 freq = rtParser.channelOptions().freq();
130 if (rtParser.mcsPresent()) {
132 rtParser.mcs().mcsIndex(),
133 rtParser.mcs().bandwidth(),
134 rtParser.mcs().guardInterval() ));
137 else if (rtParser.vhtPresent()) {
140 rtParser.vht().mcs_user0(),
141 rtParser.vht().nss_user0(),
142 rtParser.bandwidth(),
143 rtParser.vht().guardInterval() ));
147 else if (rtParser.ratePresent()) {
148 rate = rtParser.rate() * 500;
151 rssi = short(rtParser.dbmAntennaSignal());
152 length = rtPacket.size() - rtParser.length();
161 pktFrequencyMismatch_++;
177 spectralUnknownType_++;
184 std::stringstream ss;
185 athSpectralScan_.
stats(ss);
187 return "pktData " + senf::str(pktData_) +
188 ", pktManagement " + senf::str(pktManagement_) +
189 ", pktControl " + senf::str(pktControl_) +
190 ", pktOther " + senf::str(pktOther_) +
191 ", pktTx " + senf::str(pktTx_) +
192 ", pktExceptions " + senf::str(pktExceptions_) +
193 ", pktFrequencyMismatch " + senf::str(pktFrequencyMismatch_) +
195 " --- " + senf::str(ss) +
", spectralUnknown " + senf::str(spectralUnknownType_);
senf::ClockService::clock_type duration
config::time_type clock_type
virtual void v_80211FrameReceived(std::uint64_t tsft, unsigned frequency, signed rssi, unsigned rate, unsigned length, senf::RadiotapPacket &rt)=0
unsigned spectralShortRepeat() const
virtual void v_terminate(senf::ClockService::clock_type const &sessionDuration)=0
unsigned spectralCount() const
virtual void terminate() const
unsigned spectralFFTPeriod() const
boost::function< R(Args)> membind(R(T::*fn)(Args), T *ob)
Annotations public header.
bool callback(AthSpectralScanCallback const &cb)
void noroute(connector::Connector &connector)
ClockService::clock_type const & now()
WLANPacket_DataFrameType::packet WLANPacket_DataFrame
WLANPacket_MgtFrameType::packet WLANPacket_MgtFrame
void processSpectralEvent(std::uint64_t tsft, std::uint16_t frequency, unsigned numBins, void *spectralSample)
unsigned rate
Bitrate in kbit/s.
void timeout(ClockService::clock_type const &timeout, bool initiallyEnabled=true)
senf::ClockService::clock_type reportingInterval
WLANPacket_CtrlFrameType::packet WLANPacket_CtrlFrame
unsigned spectralBins() const
virtual void v_timerInterval(senf::ClockService::clock_type const ×tamp, senf::ClockService::clock_type const &actualDuration)=0
AnalyzerBase(Configuration const &configuration)
void onRequest(Handler handler)
senf::emu::AthSpectralScan & athSpectralScan()
Configuration const & configuration_
WLANInterface public header.
WLANModulationParameter const & findModulationById(ModulationParameter::id_t id) const
static WLANModulationParameterRegistry & instance()
void frequency(std::uint32_t freq, std::uint32_t bandwidth, std::int32_t offset=0)
unsigned spectralFFTPeriod
senf::ppi::connector::PassiveInput< senf::RadiotapPacket > input
virtual void v_SpectralDataReceived(std::uint64_t tsft, unsigned frequency, unsigned bins, fft_sample_ht20 const &)=0
void stats(std::ostream &os)
unsigned spectralPeriod() const