wlan_bearer/wlanengine/wlan_common/wlanengine_common_3.1/src/core_frame_rm_ie_beacon_request_detail_ie.cpp
changeset 0 c40eb8fe8501
equal deleted inserted replaced
-1:000000000000 0:c40eb8fe8501
       
     1 /*
       
     2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Class parsing 802.11k Beacon Request Reporting Detail IEs.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "genscaninfo.h"
       
    20 #include "core_frame_rm_ie_beacon_request_detail_ie.h"
       
    21 #include "core_tools.h"
       
    22 #include "core_tools_parser.h"
       
    23 #include "am_debug.h"
       
    24 
       
    25 const u8_t CORE_FRAME_RM_IE_BEACON_REQUEST_DETAIL_IE_MIN_LENGTH = 3;
       
    26 const u8_t CORE_FRAME_RM_IE_BEACON_REQUEST_DETAIL_IE_REPORTING_DETAIL_OFFSET = 2;
       
    27 
       
    28 // ======== MEMBER FUNCTIONS ========
       
    29 
       
    30 // ---------------------------------------------------------------------------
       
    31 // ---------------------------------------------------------------------------
       
    32 //
       
    33 core_frame_rm_ie_beacon_request_detail_ie_c* core_frame_rm_ie_beacon_request_detail_ie_c::instance(
       
    34     const core_frame_dot11_ie_c& ie )
       
    35     {
       
    36     if ( ie.data_length() < CORE_FRAME_RM_IE_BEACON_REQUEST_DETAIL_IE_MIN_LENGTH )
       
    37         {
       
    38         DEBUG( "core_frame_rm_ie_beacon_request_detail_ie_c::instance() - not a valid IE, invalid length" );
       
    39 
       
    40         return NULL;
       
    41         }
       
    42 
       
    43     core_frame_rm_ie_beacon_request_detail_ie_c* instance = new core_frame_rm_ie_beacon_request_detail_ie_c(
       
    44         ie.data_length(),
       
    45         ie.data(),
       
    46         0 );
       
    47     
       
    48     if ( !instance )
       
    49         {
       
    50         DEBUG( "core_frame_rm_ie_beacon_request_detail_ie_c::instance() - unable to create an instance" );
       
    51 
       
    52         return NULL;
       
    53         }
       
    54 
       
    55     DEBUG1( "core_frame_rm_ie_beacon_request_detail_ie_c::instance() - Reporting Detail: 0x%02X",
       
    56             instance->reporting_detail() );
       
    57     
       
    58     return instance;
       
    59     }
       
    60 
       
    61 // ---------------------------------------------------------------------------
       
    62 // ---------------------------------------------------------------------------
       
    63 //    
       
    64 u8_t core_frame_rm_ie_beacon_request_detail_ie_c::reporting_detail() const
       
    65     {
       
    66     return data_m[CORE_FRAME_RM_IE_BEACON_REQUEST_DETAIL_IE_REPORTING_DETAIL_OFFSET];
       
    67     }
       
    68 
       
    69 // ---------------------------------------------------------------------------
       
    70 // ---------------------------------------------------------------------------
       
    71 //
       
    72 core_frame_rm_ie_beacon_request_detail_ie_c::core_frame_rm_ie_beacon_request_detail_ie_c(
       
    73     u16_t data_length,
       
    74     const u8_t* data,
       
    75     u16_t max_data_length ) :
       
    76     core_frame_dot11_ie_c( data_length, data, max_data_length )
       
    77     {
       
    78     }