1 /** \file ScanCncnOidSM.h 2 * \brief This file include definitions for the scan concentrator OID request SM module. 3 * \author Ronen Kalish 4 * \date 11-May-2006 5 */ 6 /**************************************************************************** 7 **+-----------------------------------------------------------------------+** 8 **| |** 9 **| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |** 10 **| All rights reserved. |** 11 **| |** 12 **| Redistribution and use in source and binary forms, with or without |** 13 **| modification, are permitted provided that the following conditions |** 14 **| are met: |** 15 **| |** 16 **| * Redistributions of source code must retain the above copyright |** 17 **| notice, this list of conditions and the following disclaimer. |** 18 **| * Redistributions in binary form must reproduce the above copyright |** 19 **| notice, this list of conditions and the following disclaimer in |** 20 **| the documentation and/or other materials provided with the |** 21 **| distribution. |** 22 **| * Neither the name Texas Instruments nor the names of its |** 23 **| contributors may be used to endorse or promote products derived |** 24 **| from this software without specific prior written permission. |** 25 **| |** 26 **| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |** 27 **| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |** 28 **| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |** 29 **| A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |** 30 **| OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |** 31 **| SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |** 32 **| LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |** 33 **| DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |** 34 **| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |** 35 **| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |** 36 **| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |** 37 **| |** 38 **+-----------------------------------------------------------------------+** 39 ****************************************************************************/ 40 41 #ifndef __SCANCNCNOIDSM_H__ 42 #define __SCANCNCNOIDSM_H__ 43 44 #include "osTIType.h" 45 #include "osApi.h" 46 47 #include "scanTypes.h" 48 #include "commonTypes.h" 49 50 /* 51 *********************************************************************** 52 * Constant definitions. 53 *********************************************************************** 54 */ 55 56 #define SCAN_OID_DEFAULT_PROBE_REQUEST_RATE_G DRV_RATE_MASK_2_BARKER 57 #define SCAN_OID_DEFAULT_PROBE_REQUEST_RATE_A DRV_RATE_6M 58 #define SCAN_OID_DEFAULT_PROBE_REQUEST_NUMBER_G 3 59 #define SCAN_OID_DEFAULT_PROBE_REQUEST_NUMBER_A 3 60 #define SCAN_OID_DEFAULT_MAX_DWELL_TIME_PASSIVE_G 100000 61 #define SCAN_OID_DEFAULT_MAX_DWELL_TIME_PASSIVE_A 100000 62 #define SCAN_OID_DEFAULT_MAX_DWELL_TIME_ACTIVE_G 25000 63 #define SCAN_OID_DEFAULT_MAX_DWELL_TIME_ACTIVE_A 25000 64 #define SCAN_OID_DEFAULT_MIN_DWELL_TIME_PASSIVE_G 100000 65 #define SCAN_OID_DEFAULT_MIN_DWELL_TIME_PASSIVE_A 100000 66 #define SCAN_OID_DEFAULT_MIN_DWELL_TIME_ACTIVE_G 5000 67 #define SCAN_OID_DEFAULT_MIN_DWELL_TIME_ACTIVE_A 5000 68 #define SCAN_OID_DEFAULT_EARLY_TERMINATION_EVENT_PASSIVE_G SCAN_ET_COND_BEACON 69 #define SCAN_OID_DEFAULT_EARLY_TERMINATION_EVENT_PASSIVE_A SCAN_ET_COND_BEACON 70 #define SCAN_OID_DEFAULT_EARLY_TERMINATION_EVENT_ACTIVE_G SCAN_ET_COND_ANY_FRAME 71 #define SCAN_OID_DEFAULT_EARLY_TERMINATION_EVENT_ACTIVE_A SCAN_ET_COND_ANY_FRAME 72 #define SCAN_OID_DEFAULT_EARLY_TERMINATION_COUNT_PASSIVE_G 2 73 #define SCAN_OID_DEFAULT_EARLY_TERMINATION_COUNT_PASSIVE_A 2 74 #define SCAN_OID_DEFAULT_EARLY_TERMINATION_COUNT_ACTIVE_G 3 75 #define SCAN_OID_DEFAULT_EARLY_TERMINATION_COUNT_ACTIVE_A 3 76 77 /* 78 *********************************************************************** 79 * Enums. 80 *********************************************************************** 81 */ 82 83 /** \enum scan_oidSMEvents_e 84 * \brief enumerates the different scan OID request SM events 85 */ 86 typedef enum 87 { 88 OID_SCAN_EVENT_START_SCAN = 0, 89 OID_SCAN_EVENT_SCAN_COMPLETE, 90 OID_SCAN_EVENT_SCAN_FAILED, 91 OID_SCAN_NUM_OF_EVENTS 92 } scan_oidSMEvents_e; 93 94 /** \enum scan_oidSMStates_e 95 * \brief enumerates the different scan OID request SM states 96 */ 97 typedef enum 98 { 99 OID_SCAN_STATE_IDLE = 0, 100 OID_SCAN_STATE_SCAN_ON_G, 101 OID_SCAN_STATE_SCAN_ON_A, 102 OID_SCAN_NUM_OF_STATES 103 } scan_oidSMStates_e; 104 105 /* 106 *********************************************************************** 107 * Typedefs. 108 *********************************************************************** 109 */ 110 111 /* 112 *********************************************************************** 113 * Structure definitions. 114 *********************************************************************** 115 */ 116 117 /* 118 *********************************************************************** 119 * External data definitions. 120 *********************************************************************** 121 */ 122 123 /* 124 *********************************************************************** 125 * External functions definitions 126 *********************************************************************** 127 */ 128 /** 129 * \author Ronen Kalish\n 130 * \date 11-May-2006\n 131 * \brief Initialize the scan concentrator OID request SM. 132 * 133 * Function Scope \e Public.\n 134 * \param hScanCncn - handle to the scan concentrator object.\n 135 * \return OK if successful, NOK otherwise.\n 136 */ 137 TI_STATUS scanConcentratorOidSM_init( TI_HANDLE hScanCncn ); 138 139 /** 140 * \author Ronen Kalish\n 141 * \date 11-May-2006\n 142 * \brief Processes an event. 143 * 144 * Function Scope \e Public.\n 145 * \param hScanCncn - handle to the scan concentrator object.\n 146 * \param currentState - the current OID request SM state.\n 147 * \param event - the event to handle.\n 148 * \return OK if successful, NOK otherwise.\n 149 */ 150 TI_STATUS scanConcentratorOidSM_SMEvent( TI_HANDLE hScanCncn, scan_oidSMStates_e* currentState, 151 scan_oidSMEvents_e event ); 152 153 /** 154 * \author Ronen Kalish\n 155 * \date 11-May-2006\n 156 * \brief SM action - starts a scan on G band 157 * 158 * Function Scope \e Public.\n 159 * \param hScanCncn - handle to the scan concentrator object.\n 160 * \return OK if successful, NOK otherwise.\n 161 */ 162 TI_STATUS scanConcentratorOidSM_actionStartGScan( TI_HANDLE hScanCncn ); 163 164 /** 165 * \author Ronen Kalish\n 166 * \date 11-May-2006\n 167 * \brief SM action - starts a scan on A band 168 * 169 * Function Scope \e Public.\n 170 * \param hScanCncn - handle to the scan concentrator object.\n 171 * \return OK if successful, NOK otherwise.\n 172 */ 173 TI_STATUS scanConcentratorOidSM_actionStartAScan( TI_HANDLE hScanCncn ); 174 175 /** 176 * \author Ronen Kalish\n 177 * \date 14-May-2006\n 178 * \brief SM action - Cleans up an OID scan operation 179 * 180 * Function Scope \e Public.\n 181 * \param hScanCncn - handle to the scan concentrator object.\n 182 * \return OK if successful, NOK otherwise.\n 183 */ 184 TI_STATUS scanConcentratorOidSM_actionCleanup( TI_HANDLE hScanCncn ); 185 186 /** 187 * \author Ronen Kalish\n 188 * \date 14-May-2006\n 189 * \brief Fills a chhanel array with valid channels (and their params) according to band and scan type\n 190 * 191 * Function Scope \e Public.\n 192 * \param hScanCncn - handle to the scan concentrator object.\n 193 * \param band - band to extract channels for.\n 194 * \param scanType - scan type tp ectract channels for.\n 195 * \param channelArray - where to store allowed channels information.\n 196 * \param maxDwellTime - maximum dwell time value to be used for each channel.\n 197 * \param minDwellTime - minimum dwell time value to be used for each channel.\n 198 * \param ETCondition - early termination condition value to be used for each channel.\n 199 * \param ETFrameNumber - early termination frame number value to be used for each channel.\n 200 * \return Number of allowed channels (that were placed in the given channels array).\n 201 */ 202 UINT32 scanConcentratorOidSM_FillAllAvailableChannels( TI_HANDLE hScanCncn, radioBand_e band, scan_Type_e scanType, 203 scan_channelEntry_u* channelArray, UINT32 maxDwellTime, 204 UINT32 minChannelTime, scan_ETCondition_e ETCondition, 205 UINT8 ETFrameNumber ); 206 207 #endif /* __SCANCNCNOIDSM_H__ */ 208 209