Esempio n. 1
0
/**
 * \\n
 * \date 15-November-2005\n
 * \brief Handles an AP discovery timer expiry, by setting necessary values in the
 * reply struct.\n
 *
 * Function Scope \e Private.\n
 * \param hMeasurementSRV - handle to the measurement SRV object.\n
 * \param requestIndex - index of the beacon request in the request structure.\n
 */
void measurementSRVHandleBeaconMsrComplete( TI_HANDLE hMeasurementSRV, TI_INT32 requestIndex )
{
	measurementSRV_t* pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV;
	TI_INT32 status;



	/* send stop AP discovery command */
	status = cmdBld_CmdApDiscoveryStop (pMeasurementSRV->hCmdBld, NULL, NULL);
}
Esempio n. 2
0
/**
 * \\n
 * \date 15-November-2005\n
 * \brief Handles an AP discovery timer expiry, by setting necessary values in the
 * reply struct.\n
 *
 * Function Scope \e Private.\n
 * \param hMeasurementSRV - handle to the measurement SRV object.\n
 * \param requestIndex - index of the beacon request in the request structure.\n
 */
void measurementSRVHandleBeaconMsrComplete( TI_HANDLE hMeasurementSRV, TI_INT32 requestIndex )
{
    measurementSRV_t* pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV;
    TI_INT32 status;


    TRACE0(pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ": Sending AP Discovery Stop to the HAL...");

    /* send stop AP discovery command */
    status = cmdBld_CmdApDiscoveryStop (pMeasurementSRV->hCmdBld, NULL, NULL);
    if ( TI_OK != status )
    {
        TRACE1( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": status %d received from cmdBld_CmdApDiscoveryStop\n", status);
    }
}
Esempio n. 3
0
/**
 * \\n
 * \date 08-November-2005\n
 * \brief handle a STOP_REQUEST event when in MEASURE_IN_PROGRESS by stopping all measure types and
 * \brief requesting measure stop from the FW.\n
 *
 * Function Scope \e Public.\n
 * \param hMeasurementSrv - handle to the Measurement SRV object.\n
 * \return always TI_OK.\n
 */
TI_STATUS measurementSRVSM_stopFromMeasureInProgress( TI_HANDLE hMeasurementSRV )
{
	measurementSRV_t* pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV;
	TNoiseHistogram   pNoiseHistParams;
	TI_STATUS         status;
	TI_INT32          i;

	/* stop all running measure types */
	for (i = 0; i < pMeasurementSRV->msrRequest.numberOfTypes; i++)
	{
		if (pMeasurementSRV->bRequestTimerRunning[i])
		{
			/* stop timer */
			tmr_StopTimer (pMeasurementSRV->hRequestTimer[i]);
			pMeasurementSRV->bRequestTimerRunning[i] = TI_FALSE;

			/* if necessary, stop measurement type */
			switch ( pMeasurementSRV->msrRequest.msrTypes[ i ].msrType )
			{
			case MSR_TYPE_BEACON_MEASUREMENT:
				/* send stop AP discovery command */
				status = cmdBld_CmdApDiscoveryStop (pMeasurementSRV->hCmdBld, NULL, NULL);
				if ( TI_OK != status )
				{
					TRACE1( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": TWD_ApDiscoveryStop returned status %d\n", status);
				}
				break;

			case MSR_TYPE_NOISE_HISTOGRAM_MEASUREMENT:
				/* Set Noise Histogram Cmd Params */
				pNoiseHistParams.cmd = STOP_NOISE_HIST;
				pNoiseHistParams.sampleInterval = 0;
				os_memoryZero( pMeasurementSRV->hOS, &(pNoiseHistParams.ranges[ 0 ]), MEASUREMENT_NOISE_HISTOGRAM_NUM_OF_RANGES );

				/* Send a Stop command to the FW */
				status = cmdBld_CmdNoiseHistogram (pMeasurementSRV->hCmdBld, &pNoiseHistParams, NULL, NULL);

				if ( TI_OK != status )
				{
					TRACE1( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": TWD_NoiseHistogramCmd returned status %d\n", status);
				}
				break;

				/* These are just to avoid compilation warnings, nothing is actualy done here! */
			case MSR_TYPE_BASIC_MEASUREMENT:
			case MSR_TYPE_CCA_LOAD_MEASUREMENT:
			case MSR_TYPE_FRAME_MEASUREMENT:
			case MSR_TYPE_MAX_NUM_OF_MEASURE_TYPES:
			default:
				TRACE1( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": unsupported measurement type: %d\n", pMeasurementSRV->msrRequest.msrTypes[ i ].msrType);
				break;
			}

			/* mark that measurement has failed */
			pMeasurementSRV->msrReply.msrTypes[ i ].status = TI_NOK;
		}
	}

	/* Send Measurement Stop command to the FW */
	status = cmdBld_CmdMeasurementStop (pMeasurementSRV->hCmdBld,
	                                    (void *)pMeasurementSRV->commandResponseCBFunc,
	                                    pMeasurementSRV->commandResponseCBObj);

	pMeasurementSRV->commandResponseCBFunc = NULL;
	pMeasurementSRV->commandResponseCBObj = NULL;

	if ( TI_OK != status )
	{
		TRACE1( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": Failed to send measurement stop command, statud=%d,\n", status);

		/* send a measurement complete event - since it can't be stopped */
		measurementSRVSM_SMEvent( hMeasurementSRV, &(pMeasurementSRV->SMState),
		                          MSR_SRV_EVENT_STOP_COMPLETE );
		return TI_OK;
	}

	TRACE0( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ": measure stop command sent.\n");

	/* start the FW guard timer */
	pMeasurementSRV->bStartStopTimerRunning = TI_TRUE;
	tmr_StartTimer (pMeasurementSRV->hStartStopTimer,
	                MacServices_measurementSRV_startStopTimerExpired,
	                (TI_HANDLE)pMeasurementSRV,
	                MSR_FW_GUARD_TIME,
	                TI_FALSE);

	return TI_OK;
}