diff -r 000000000000 -r c40eb8fe8501 wlan_bearer/wlanengine/wlan_common/wlanengine_common_3.1/inc/genscaninfo.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlan_bearer/wlanengine/wlan_common/wlanengine_common_3.1/inc/genscaninfo.inl Tue Feb 02 02:03:13 2010 +0200 @@ -0,0 +1,141 @@ +/* +* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of ScanInfo inline methods. +* +*/ + + +#include "genscanoffsets.h" + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +inline u8_t ScanInfo::SignalNoiseRatio() const + { + return *( current_m + CNTRL_RX_SNR_OFFSET ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +inline u8_t ScanInfo::RXLevel() const + { + if( !current_m ) + { + return 0; + } + + return *( current_m + CNTRL_RX_LEVEL_OFFSET ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +inline void ScanInfo::BSSID( + u8_t bssid[BSSID_LENGTH] ) const + { + u8_t* dst = bssid; + if ( !dst || !current_m ) + { + return; + } + + const u8_t* src = current_m + MGMT_BSSID_OFFSET; + const u8_t* end = src + BSSID_LENGTH; + + for ( ; src < end; ++dst, ++src ) + { + *dst = *src; + } + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +inline u16_t ScanInfo::BeaconInterval() const + { + if( !current_m ) + { + return 0; + } + + return *( reinterpret_cast( current_m + MGMT_BEACON_INTERVAL_OFFSET ) ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +inline u16_t ScanInfo::Capability() const + { + if( !current_m ) + { + return 0; + } + + return *( reinterpret_cast( current_m + MGMT_CAPABILITY_OFFSET ) ); + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +inline bool_t ScanInfo::Privacy() const + { + if ( Capability() & SCAN_CAPABILITY_BIT_MASK_PRIVACY ) + { + return true_t; + } + + return false_t; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +inline WlanOperatingMode ScanInfo::OperatingMode() const + { + if ( Capability() & SCAN_CAPABILITY_BIT_MASK_ESS ) + { + return WlanOperatingModeInfra; + } + + return WlanOperatingModeAdhoc; + } + +// --------------------------------------------------------------------------- +// +// --------------------------------------------------------------------------- +// +inline void ScanInfo::Timestamp( u8_t timestamp[TIMESTAMP_LENGTH] ) const + { + u8_t* dst = timestamp; + if ( !dst ) + { + return; + } + + const u8_t* src = current_m + MGMT_TIMESTAMP_OFFSET; + const u8_t* end = src + TIMESTAMP_LENGTH; + + for ( ; src < end; ++dst, ++src ) + { + *dst = *src; + } + }