RFID_STATUS WINAPI RFID_SetActiveRegionW ( RFID_HANDLE32  readerManagementHandle,
WCHAR *  RegionName,
WCHAR *  CommunicationStandardName 
)

Set particular region as active region.

Parameters:
[in] readerManagementHandle 
Handle returned by RFID_Login.
[in] RegionName 
Name of region which needs to be activated
[in] CommunicationStandardName 
Standard of region out of supported standard by given region
Returns:
If the function succeeds the return value is RFID_API_SUCCESS. If the function fails the return value is one of the following:
  • RFID_API_INVALID_HANDLE Handle provided is invalid
Remarks:
Default settings will be applied for activated region e.g. for ETSI – frequency hopping and all channels gets enabled by default. Re-initialization of LLRP happens after region is committed into reader. So application is required to call reader connect (RFID_Connect) again
See also:
RFID_GetSupportedRegionListW, RFID_GetRegionStandardListW, RFID_SetActiveRegionW, RFID_SetFrequencySetting, RFID_GetActiveRegionInfoW, RFID_GetActiveRegionStandardInfoW
Remarks:
Example:
RFID_HANDLE32   g_RMReaderHandle = NULL;
RFID_HANDLE32   g_ReaderHandle = NULL;
RFID_STATUS LoginToReader()
{
        RFID_STATUS rfidStatus = RFID_API_SUCCESS;
        LOGIN_INFO loginInfo;
        BOOL secureMode=0;
        _tcscpy(loginInfo.userName,TEXT("admin"));
        _tcscpy(loginInfo.password,TEXT("change"));
        _tcscpy(loginInfo.hostName,TEXT("169.254.10.1"));
        loginInfo.forceLogin = true;
        loginInfo.version = RFID_API3_5_5;
        rfidStatus = RFID_Login(&g_RMReaderHandle,  &loginInfo, FX, secureMode, NULL);
        return rfidStatus;
}
void TestRFDIAPI3RegulatorySupport()
{
        RFID_STATUS rfidStatus = RFID_API_SUCCESS;
        LoginToReader();
        if(RFID_API_SUCCESS == rfidStatus)
        {
                REGION_LIST ReaderRegionList = {0};
                rfidStatus = RFID_GetSupportedRegionList( g_RMReaderHandle,&ReaderRegionList);
                if( rfidStatus == RFID_API_SUCCESS )
                {
                        _tprintf(TEXT("Total number of Regions %d\r\n"), ReaderRegionList.numRegions);
                        _tprintf(TEXT("Regions #7 is %s\r\n"), ReaderRegionList.RegionNamesList[7]);
                }
        }
        // Get region supported standards
        STANDARD_INFO_LIST StdInfoList = {0};
        rfidStatus = RFID_GetRegionStandardList( g_RMReaderHandle, TEXT("European Union"),&StdInfoList);
        if( rfidStatus == RFID_API_SUCCESS )
        {
                _tprintf(TEXT("Region %s\r\n"), StdInfoList.StdsList[0].strRegionName);
                _tprintf(TEXT("Number of Standards %d\r\n"), StdInfoList.numStds);
                for(int j=0;j<StdInfoList.numStds;j++)
                {
                        _tprintf(TEXT("StandardName %s\r\n"), StdInfoList.StdsList[j].strStandardName);
                        _tprintf(TEXT("NumChannels %d\r\n"), StdInfoList.StdsList[j].iNumChannels);
                        _tprintf(TEXT("IsHoppingConfigurable            %s\r\n"), StdInfoList.StdsList[j].bIsHoppingConfigurable?TEXT("Yes"):TEXT("No"));
                        if(StdInfoList.StdsList[j].bIsHoppingConfigurable)
                                for(int k=0;k<StdInfoList.StdsList[j].iNumChannels;k++)
                                        _tprintf(TEXT("Channels index %d values %d KHz\r\n"), StdInfoList.StdsList[j].piChannelInfo[k],StdInfoList.StdsList[j].piChannelValueInfo[k]);
                }
        }
        // Set paritcular region as active region
        rfidStatus = RFID_SetActiveRegion(g_RMReaderHandle,TEXT("European Union"),TEXT("EU 302.208"));
        if( rfidStatus == RFID_API_SUCCESS )
        {
                _tprintf(TEXT("SetActiveRegion successful\r\n"));
                PrintRFDIAPI3ReaderCaps();
        }
        //
        STANDARD_REGION_INFO ActvRegStdInfo = {0};
        rfidStatus = RFID_GetActiveRegionStandardInfo(g_RMReaderHandle,&ActvRegStdInfo);
        if( rfidStatus == RFID_API_SUCCESS )
        {
                _tprintf(TEXT("GetActiveRegionStandardInfo %s successful channels %d\r\n"), ActvRegStdInfo.strStandardName,ActvRegStdInfo.iNumChannels);
        }
        //
        CHANNEL_LIST ChnlLst = {0};
        // Allocate memory for number of channels supported by standard
        ChnlLst.ChannelList = new UINT32[ActvRegStdInfo.iNumChannels];
        // Set frequency hopping ON and number of channels limited to three
        ChnlLst.iNumChannels = 2;
        ChnlLst.ChannelList[0] = 2;
        ChnlLst.ChannelList[1] = 3;
        bool hopping = true;
        rfidStatus = RFID_SetFrequencySetting(g_RMReaderHandle,hopping,&ChnlLst);
        // Set in fixed frequency mode i.e hopping OFF and number of channels limited to one
        ChnlLst.iNumChannels = 1;
        hopping = false;
        // Selecting fixed channel # three
        ChnlLst.ChannelList[0] = 3;
        rfidStatus = RFID_SetFrequencySetting(g_RMReaderHandle,hopping,&ChnlLst);
        if( rfidStatus == RFID_API_SUCCESS )
        {
                _tprintf(TEXT("SetFrequencySetting channels:%d hopping:%s channel value %d successful\r\n"), ChnlLst.iNumChannels,hopping?TEXT("ON"):TEXT("OFF")
                        ,ActvRegStdInfo.piChannelValueInfo[2]);
        }
        //
        ACTIVE_REGION_INFO ActiveRegionInfo = {0};
        rfidStatus = RFID_GetActiveRegionInfo(g_RMReaderHandle, &ActiveRegionInfo);
        if( rfidStatus == RFID_API_SUCCESS )
        {
                _tprintf(TEXT("GetActiveRegionInfo %s successful hopping:%s channels %d \r\n"), ActiveRegionInfo.strRegionName
                        ,ActiveRegionInfo.bIsHoppingOn?TEXT("ON"):TEXT("OFF"), ActiveRegionInfo.iNumChannels);
        }
        //
        RFID_Logout(g_RMReaderHandle);
}
void PrintRFDIAPI3ReaderCaps()
{
        CONNECTION_INFO info;
        // Need to reconnect reader because of call to RFID_SetActiveRegion & RFID_SetFrequencySetting reintializes LLRP
        RFID_STATUS rfidStatus = RFID_Connect(&g_ReaderHandle,  TEXT("169.254.10.1"), 5084, 2000, &info);
        READER_CAPS readerCaps;
        rfidStatus = RFID_GetReaderCaps(g_ReaderHandle, &readerCaps);
        _tprintf(TEXT("CommunicationStandard: %d \r\n"), readerCaps.communicationStandard);
        if(!readerCaps.hoppingEnabled)
        {
                _tprintf(TEXT("fixedFreqInfo numFreq: %d\r\n"), readerCaps.fixedFreqInfo.numFreq);
                _tprintf(TEXT("fixedFreqInfo pFreqList: %d\r\n"), readerCaps.fixedFreqInfo.pFreqList[0]);
        }
        _tprintf(TEXT("freqHopInfo numTables: %d\r\n"), readerCaps.freqHopInfo.numTables);
        _tprintf(TEXT("HoppingEnabled : %d\r\n"), readerCaps.hoppingEnabled);
}


Generated on Fri Mar 4 02:25:32 2016 for RFIDAPI3 1.1 C API Documentation by  doxygen 1.5.6