|
1 /* |
|
2 * Copyright (c) 2006-2007 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 setting U-APSD settings. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "core_operation_set_uapsd_settings.h" |
|
20 #include "core_server.h" |
|
21 #include "am_debug.h" |
|
22 |
|
23 // ======== MEMBER FUNCTIONS ======== |
|
24 |
|
25 // --------------------------------------------------------------------------- |
|
26 // --------------------------------------------------------------------------- |
|
27 // |
|
28 core_operation_set_uapsd_settings_c::core_operation_set_uapsd_settings_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 const core_uapsd_settings_s& settings ) : |
|
34 core_operation_base_c( core_operation_set_uapsd_settings, request_id, server, drivers, adaptation, |
|
35 core_base_flag_none ), |
|
36 uapsd_settings_m( settings ) |
|
37 { |
|
38 DEBUG( "core_operation_set_uapsd_settings_c::core_operation_set_uapsd_settings_c()" ); |
|
39 } |
|
40 |
|
41 // --------------------------------------------------------------------------- |
|
42 // --------------------------------------------------------------------------- |
|
43 // |
|
44 core_operation_set_uapsd_settings_c::~core_operation_set_uapsd_settings_c() |
|
45 { |
|
46 DEBUG( "core_operation_set_uapsd_settings_c::~core_operation_set_uapsd_settings_c()" ); |
|
47 } |
|
48 |
|
49 // --------------------------------------------------------------------------- |
|
50 // --------------------------------------------------------------------------- |
|
51 // |
|
52 core_error_e core_operation_set_uapsd_settings_c::next_state() |
|
53 { |
|
54 DEBUG( "core_operation_set_uapsd_settings_c::next_state()" ); |
|
55 |
|
56 switch ( operation_state_m ) |
|
57 { |
|
58 case core_state_init: |
|
59 { |
|
60 server_m->get_core_settings().set_uapsd_settings( |
|
61 uapsd_settings_m ); |
|
62 |
|
63 if ( !server_m->get_core_settings().is_connected() ) |
|
64 { |
|
65 DEBUG( "core_operation_set_uapsd_settings_c::next_state() - not connected, no reason to set anything" ); |
|
66 |
|
67 return core_error_ok; |
|
68 } |
|
69 |
|
70 operation_state_m = core_state_set_uapsd_settings; |
|
71 |
|
72 DEBUG( "core_operation_set_uapsd_settings_c::next_state() - setting U-APSD settings" ); |
|
73 DEBUG1( "core_operation_set_uapsd_settings_c::next_state() - max_service_period: %u", |
|
74 uapsd_settings_m.max_service_period ); |
|
75 DEBUG1( "core_operation_set_uapsd_settings_c::next_state() - uapsd_enabled_for_voice: %u", |
|
76 uapsd_settings_m.uapsd_enabled_for_voice ); |
|
77 DEBUG1( "core_operation_set_uapsd_settings_c::next_state() - uapsd_enabled_for_video: %u", |
|
78 uapsd_settings_m.uapsd_enabled_for_video ); |
|
79 DEBUG1( "core_operation_set_uapsd_settings_c::next_state() - uapsd_enabled_for_best_effort: %u", |
|
80 uapsd_settings_m.uapsd_enabled_for_best_effort ); |
|
81 DEBUG1( "core_operation_set_uapsd_settings_c::next_state() - uapsd_enabled_for_background: %u", |
|
82 uapsd_settings_m.uapsd_enabled_for_background ); |
|
83 |
|
84 drivers_m->set_uapsd_settings( |
|
85 request_id_m, |
|
86 uapsd_settings_m ); |
|
87 |
|
88 break; |
|
89 } |
|
90 case core_state_set_uapsd_settings: |
|
91 { |
|
92 return core_error_ok; |
|
93 } |
|
94 default: |
|
95 { |
|
96 ASSERT( false_t ); |
|
97 } |
|
98 } |
|
99 |
|
100 return core_error_request_pending; |
|
101 } |