Region Configuration Tutorial

RFID SDK for Android 2.0.3.148

Applicable Devices : FX7500 and FX9600.

Overview

This Tutorial provides a walk-through of the steps to perform region configuration operations using RFID3 API

Create The Project

  • Start by creating a new project in Android Studio. For help, see the Android Studio tutorial.
  • Refer Hello RFID to prepare basic setup to work with RFID Reader and then follow this guide

Details

Region Configuration tutorial is for to get the standard region list, supported region list and setting the active region.

Setting it up

The following are the steps to provide the information of region configuration operations.

  • Create Reader Management Object
  • Create a LoginInfo object and Login to the Reader.
  • Get Standard Region List Operations.
  • Perform standard List, get Supported list, set active Region operations.

Creating a ReaderManagement object.


// create and initialize the Reader Management object.
    ReaderManagement readerManagement = new ReaderManagement(); 
                                                                                                      
                                                

Creating a LoginInfo object and perform login operation.


//Creating a LoginInfo object and perform login operation.
    LoginInfo loginInfo = new LoginInfo("hostName", "userName", "password", SECURE_MODE.HTTP, false);
    try {
            readerManagement.login(loginInfo,READER_TYPE.FX);
        } catch (InvalidUsageException e) {
            e.printStackTrace();
        } catch (OperationFailureException e) {
           e.printStackTrace();
        }

Performing operation

Get Supported Region List


//  Get Supported Region List.  

    String[] regionList = readerManagement.getSupportedRegionList();
    System.out.println("\n Total number of Regions " + regionList.length);
    int index2 = 0;
    for (String regionName : regionList) {
        System.out.println("Region " + (++index2) + " " + regionName);                
    }

Get Region Standard List


//  Get Region Standard List

    String[] regionList = readerManagement.getSupportedRegionList();
    int index2 = 0;
    
    for (String regionName : regionList) {
        System.out.println("Region " + (++index2) + " " + regionName);    
        
        CommunicationStandardInfo[] standardInfoList1 = readerManagement.getRegionStandardList(regionName);
        
        for (CommunicationStandardInfo standard : standardInfoList1) {
            System.out.println("---------------------------------------------------------");
            System.out.println(" Standard name " + standard.getStandardName());                  

            if (standard.getIsHoppingConfigurable()) {
                int numberOfChannels = standard.getChannelIndexList().length;
                System.out.println("Number of channels  " + numberOfChannels);
                for (int i = 0; i < numberOfChannels; i++) {
                    System.out.println("Channel index " + standard.getChannelIndexList()[i] + " value "
                            + standard.getChannelFrequencyValueList()[i]);
                
                }
            }
        }
    }

Set Active Region.


//  Set Active Region

    try{
        String[] regionList = readerManagement.getSupportedRegionList();
        System.out.println("\n Total number of Regions " + regionList.length);
        int index2 = 0;
        for (String regionName : regionList) {
            System.out.println("Region " + (++index2) + " " + regionName);                
            CommunicationStandardInfo[] standardInfoList1 = readerManagement.getRegionStandardList(regionName);
            for (CommunicationStandardInfo standard : standardInfoList1) {
                System.out.println("---------------------------------------------------------");
                System.out.println(" Standard name " + standard.getStandardName());

                readerManagement.setActiveRegion(regionName,standard.getStandardName());                    
                System.out.println(" Is Hopping Configurable  " + standard.getIsHoppingConfigurable());                   

                if (standard.getIsHoppingConfigurable()) {
                    int numberOfChannels = standard.getChannelIndexList().length;
                    System.out.println("Number of channels  " + numberOfChannels);
                    for (int i = 0; i < numberOfChannels; i++) {
                        System.out.println("Channel index " + standard.getChannelIndexList()[i] + " value "
                                + standard.getChannelFrequencyValueList()[i]);

                    }
                }
            }
        }
    }

    }catch(OperationFailureException e){                
        System.out.println("Exception: " + e.getVendorMessage());
    }

Closer look

  • Use getSupportedRegionList to get the list of regions supported.
  • Use getRegionStandardList to get the regions supported along with the channels supported.
  • Use setActiveRegion to change the region.