/**
 * 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);

}