/**
 * The callback called by the MLME.
 * 
 * @param hMeasurementMgr A handle to the Measurement Manager module.
 * 
 * @date 01-Jan-2006
 */
void measurementMgr_mlmeResultCB(TI_HANDLE hMeasurementMgr, TMacAddr * bssid, mlmeFrameInfo_t * frameInfo, 
                                 TRxAttr * pRxAttr, TI_UINT8 * buffer, TI_UINT16 bufferLength)
{
    measurementMgr_t * pMeasurementMgr = (measurementMgr_t *) hMeasurementMgr;
    TScanFrameInfo      tScanFrameInfo;

	if (measurementMgrSM_measureInProgress(pMeasurementMgr) == TI_FALSE)
	{
		TRACE0(pMeasurementMgr->hReport, REPORT_SEVERITY_INFORMATION , "measurementMgr_mlmeResultCB: measurement not in progress, return\n");
		return;
	}

	
	/* erroneous frames are notifed to the measurmenet manager to update counter 
    (add counter sometimes in the future) Look at: scanCncn_ScanCompleteNotificationCB and
    scanCncn_MlmeResultCB */
    if (NULL == bssid)
    {
        TRACE0(pMeasurementMgr->hReport, REPORT_SEVERITY_INFORMATION , "measurementMgr_mlmeResultCB: received an empty frame notification from MLME\n");
        return;
    }

    if (pMeasurementMgr == NULL || pRxAttr == NULL)
    {
		if(pMeasurementMgr != NULL)
		{
			TRACE0(pMeasurementMgr->hReport, REPORT_SEVERITY_ERROR, ": MLME callback called with NULL object\n");
		}
        return;
    }

    TRACE0(pMeasurementMgr->hReport, REPORT_SEVERITY_INFORMATION, ": MLME callback entered\n");

    /* build the scan frame info object */
    tScanFrameInfo.bssId = bssid;
    tScanFrameInfo.band = (ERadioBand)pRxAttr->band;
    tScanFrameInfo.channel = pRxAttr->channel;
    tScanFrameInfo.parsedIEs = frameInfo;
    tScanFrameInfo.rate = pRxAttr->Rate;
    tScanFrameInfo.rssi = pRxAttr->Rssi;
    tScanFrameInfo.snr = pRxAttr->SNR;
    tScanFrameInfo.staTSF = pRxAttr->TimeStamp;
    tScanFrameInfo.buffer = buffer;
    tScanFrameInfo.bufferLength = bufferLength;

    /* update the driver (SME) result table */
    sme_MeansurementScanResult (pMeasurementMgr->hSme, SCAN_CRS_RECEIVED_FRAME, &tScanFrameInfo);

    TRACE8(pMeasurementMgr->hReport, REPORT_SEVERITY_INFORMATION, ": MLME Frame: Subtype = %d, MAC = %x-%x-%x-%x-%x-%x, RSSI = %d\n", frameInfo->subType, (*bssid)[0], (*bssid)[1], (*bssid)[2], (*bssid)[3], (*bssid)[4], (*bssid)[5], pRxAttr->Rssi);
}
Esempio n. 2
0
/**
 * The callback called by the MLME.
 * 
 * @param hMeasurementMgr A handle to the Measurement Manager module.
 * 
 * @date 01-Jan-2006
 */
void measurementMgr_mlmeResultCB(TI_HANDLE hMeasurementMgr, TMacAddr * bssid, mlmeFrameInfo_t * frameInfo, 
                                 TRxAttr * pRxAttr, TI_UINT8 * buffer, TI_UINT16 bufferLength)
{
    measurementMgr_t * pMeasurementMgr = (measurementMgr_t *) hMeasurementMgr;
    TScanFrameInfo      tScanFrameInfo;

	if (measurementMgrSM_measureInProgress(pMeasurementMgr) == TI_FALSE)
	{
		return;
	}

	
	/* erroneous frames are notifed to the measurmenet manager to update counter 
    (add counter sometimes in the future) Look at: scanCncn_ScanCompleteNotificationCB and
    scanCncn_MlmeResultCB */
    if (NULL == bssid)
    {
        return;
    }

    if (pMeasurementMgr == NULL || pRxAttr == NULL)
    {
        return;
    }

    /* build the scan frame info object */
    tScanFrameInfo.bssId = bssid;
    tScanFrameInfo.band = (ERadioBand)pRxAttr->band;
    tScanFrameInfo.channel = pRxAttr->channel;
    tScanFrameInfo.parsedIEs = frameInfo;
    tScanFrameInfo.rate = pRxAttr->Rate;
    tScanFrameInfo.rssi = pRxAttr->Rssi;
    tScanFrameInfo.snr = pRxAttr->SNR;
    tScanFrameInfo.staTSF = pRxAttr->TimeStamp;
    tScanFrameInfo.buffer = buffer;
    tScanFrameInfo.bufferLength = bufferLength;

    /* update the driver (SME) result table */
    sme_MeansurementScanResult (pMeasurementMgr->hSme, SCAN_CRS_RECEIVED_FRAME, &tScanFrameInfo);

}
/**
 * Called when we finished a measurement request.
 *
 * @date 05-Jan-2006
 */
static TI_STATUS measurementMgrSM_acMeasurementComplete(void * pData)
{
	measurementMgr_t * pMeasurementMgr = (measurementMgr_t *) pData;
	requestHandler_t * pRequestH = (requestHandler_t *) pMeasurementMgr->hRequestH;

	TRACE0(pMeasurementMgr->hReport, REPORT_SEVERITY_INFORMATION, ": Completing measurement operation and resuming normal behavior\n");

	/* advance the activeRequestID variable to get rid of the */
	/* measurement requests we've already executed */
	TRACE2(pMeasurementMgr->hReport, REPORT_SEVERITY_INFORMATION, ": Increasing activeRequestID from %d to %d.\n", pRequestH->activeRequestID, pRequestH->activeRequestID + pMeasurementMgr->currentNumOfRequestsInParallel);

	pRequestH->activeRequestID += pMeasurementMgr->currentNumOfRequestsInParallel;

	setDefaultProbeReqTemplate (pMeasurementMgr->hSiteMgr);

	/* move the driver result table to stable state and clear it */
	sme_MeansurementScanResult (pMeasurementMgr->hSme, SCAN_CRS_SCAN_COMPLETE_OK, NULL);

	/* release the SCR */
	scr_clientComplete(pMeasurementMgr->hScr, SCR_CID_XCC_MEASURE, SCR_RESOURCE_SERVING_CHANNEL);

	/* Process New Frame */
	return measurementMgr_activateNextRequest(pData);
}