wlan_bearer/wlanengine/wlan_common/wlanengine_common_3.1/src/core_operation_get_rcpi.cpp
changeset 0 c40eb8fe8501
equal deleted inserted replaced
-1:000000000000 0:c40eb8fe8501
       
     1 /*
       
     2 * Copyright (c) 2005-2006 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:  Statemachine for getting the RCPI value of the current connection
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "core_operation_get_rcpi.h"
       
    20 #include "core_server.h"
       
    21 #include "am_debug.h"
       
    22 
       
    23 // ======== MEMBER FUNCTIONS ========
       
    24 
       
    25 // ---------------------------------------------------------------------------
       
    26 // ---------------------------------------------------------------------------
       
    27 //
       
    28 core_operation_get_rcpi_c::core_operation_get_rcpi_c(
       
    29     u32_t request_id,
       
    30     core_server_c* server,
       
    31     abs_core_driverif_c* drivers,
       
    32     abs_core_server_callback_c* adaptation,
       
    33     u32_t& rcpi ) :
       
    34     core_operation_base_c( core_operation_get_rcpi, request_id, server, drivers, adaptation,
       
    35         core_base_flag_none ),
       
    36     current_rcpi_m( rcpi )
       
    37     {
       
    38     DEBUG( "core_operation_get_rcpi_c::core_operation_get_rcpi_c()" );
       
    39     }
       
    40 
       
    41 // ---------------------------------------------------------------------------
       
    42 // ---------------------------------------------------------------------------
       
    43 //
       
    44 core_operation_get_rcpi_c::~core_operation_get_rcpi_c()
       
    45     {
       
    46     DEBUG( "core_operation_get_rcpi_c::~core_operation_get_rcpi_c()" );
       
    47     }
       
    48     
       
    49 // ---------------------------------------------------------------------------
       
    50 // ---------------------------------------------------------------------------
       
    51 //
       
    52 core_error_e core_operation_get_rcpi_c::next_state()
       
    53     {
       
    54     DEBUG( "core_operation_get_rcpi_c::next_state()" );
       
    55     
       
    56     switch ( operation_state_m )
       
    57         {
       
    58         case core_state_init:
       
    59             {
       
    60             DEBUG( "core_operation_get_rcpi_c::next_state() - requesting current RCPI value" );
       
    61             
       
    62             if( server_m->get_core_settings().is_connected() )
       
    63                 {
       
    64                 drivers_m->get_current_rcpi(
       
    65                     request_id_m,
       
    66                     current_rcpi_m );
       
    67                 operation_state_m = core_state_req_rcpi;
       
    68                 break;
       
    69                 }
       
    70             else
       
    71                 {
       
    72                 return core_error_not_supported;
       
    73                 }
       
    74             }
       
    75         case core_state_req_rcpi:
       
    76             {
       
    77             DEBUG1( "core_operation_get_rcpi_c::next_state() - current RCPI is %u",
       
    78                 current_rcpi_m );
       
    79 
       
    80             return core_error_ok;
       
    81             }
       
    82         default:
       
    83             {
       
    84             ASSERT( false_t );
       
    85             }
       
    86         }
       
    87 
       
    88     return core_error_request_pending;
       
    89     }