1/** \file measurementSrvDbgPrint.c 2 * \brief This file include variuos measurement SRV debug print facilities 3 * \author Ronen Kalish 4 * \date 23-December-2005 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#include "MeasurementSrvSM.h" 42#include "MeasurementSrv.h" 43#include "measurementSrvDbgPrint.h" 44#include "report.h" 45 46#ifdef TI_DBG 47static char bandDesc[ RADIO_BAND_NUM_OF_BANDS ][ MAX_DESC_STRING_LEN ] = 48{ 49 "2.4 GHz", 50 "5.0 GHz" 51}; 52 53static char measurementTypeDesc[ MSR_TYPE_MAX_NUM_OF_MEASURE_TYPES ][ MAX_DESC_STRING_LEN ] = 54{ 55 "basic measurement", 56 "channel load measurement", 57 "noise histogram measurement", 58 "beacon measurement", 59 "frame measurement" 60}; 61 62static char measurementScanModeTypeDesc[ MSR_SCAN_MODE_MAX_NUM_OF_SCAN_MODES ][ MAX_DESC_STRING_LEN ] = 63{ 64 "scan mode passive", 65 "scan mode active", 66 "scan mode beacon table" 67}; 68#endif /* TI_DBG */ 69 70/** 71 * \author Ronen Kalish\n 72 * \date 23-December-2005\n 73 * \brief Prints a measurement request.\n 74 * 75 * Function Scope \e Public.\n 76 * \param hMeasurementSRV - handle to the measurement SRV object.\n 77 * \param pMsrRequest - the measurement request.\n 78 */ 79void measurementSRVPrintRequest( TI_HANDLE hMeasurementSRV, measurement_request_t *pMsrRequest ) 80{ 81#ifdef TI_DBG 82 measurementSRV_t* pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV; 83 int i; 84 85 WLAN_REPORT_INFORMATION( pMeasurementSRV->hReport, MEASUREMENT_SRV_MODULE_LOG, 86 ("Measurement request:\n") ); 87 WLAN_REPORT_INFORMATION( pMeasurementSRV->hReport, MEASUREMENT_SRV_MODULE_LOG, 88 ("band: %s, channel:%d, TX power level: %d, start time: %x-%x\n", 89 bandDesc[ pMsrRequest->band ], pMsrRequest->channel, pMsrRequest->txPowerDbm, 90 INT64_HIGHER( pMsrRequest->startTime ), INT64_LOWER( pMsrRequest->startTime )) ); 91 for ( i = 0; i < pMsrRequest->numberOfTypes; i++ ) 92 { 93 measurementSRVPrintTypeRequest( hMeasurementSRV, &(pMsrRequest->msrTypes[ i ]) ); 94 } 95#endif /* TI_DBG */ 96 97} 98 99/** 100 * \author Ronen Kalish\n 101 * \date 23-December-2005\n 102 * \brief Prints a measurement type request.\n 103 * 104 * Function Scope \e Public.\n 105 * \param hMeasurementSRV - handle to the measurement SRV object.\n 106 * \param pMsrTypeRequest - the measurement type request.\n 107 */ 108void measurementSRVPrintTypeRequest( TI_HANDLE hMeasurementSRV, measurement_typeRequest_t* pMsrTypeRequest ) 109{ 110#ifdef TI_DBG 111 measurementSRV_t* pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV; 112 113 WLAN_REPORT_INFORMATION( pMeasurementSRV->hReport, MEASUREMENT_SRV_MODULE_LOG, 114 ("Measurement type request: type: %s, duration:%d, scan mode: %s, reserved: %d\n", 115 measurementTypeDesc[ pMsrTypeRequest->msrType ], pMsrTypeRequest->duration, 116 measurementScanModeTypeDesc[ pMsrTypeRequest->scanMode ], pMsrTypeRequest->reserved) ); 117#endif /* TI_DBG */ 118} 119 120