Antenna Configurations Tutorial

RFID SDK for Android 2.0.5.238

Applicable Devices : ALL

Overview

This Tutorial provides a walk-through of the steps to perform Antenna configuration 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

The config class contains the Antennas object. The AntennaProperties is used to set the antenna configuration to individual antenna or all the antennas. The antenna configuration (SetAntennaConfig function) is comprised of Antenna ID, Transmit Power Index. These indexes are refers to the Transmit Power table, Tari Frequency Hop table, or Fixed Frequency table respectively. These tables are available in Reader capabilities.getAntennaConfig function gets the antenna configuration for the given antenna ID.

Setting it up

Declarations and API calls to setup configuration

  • RF Configuration
  • The function setAntennaRfConfig is added to configure antenna RF configuration to individual antenna. This function is similar to setAntennaConfig but includes additional parameters specific pertaining to antenna. The configuration includes, Transmit Power Index, tari and RF Mode Table Index. These indexes are refers to the Transmit Power table, Tari and RF Mode table respectively. These tables are available in Reader capabilities. The function getAntennaRfConfig gets the antenna RF configuration for the given antenna ID.


try {
    // get the configuration                                                
    Antennas.AntennaRfConfig antennaRfConfig = reader.Config.Antennas.getAntennaRfConfig(1); 
    antennaRfConfig.setrfModeTableIndex(38); //M4 640K profile with pie value 1500 with index 38
    antennaRfConfig.setTari(6250); 
    antennaRfConfig.setTransmitPowerIndex(270); 
    // set the configuration
    reader.Config.Antennas.setAntennaRfConfig(1,antennaRfConfig);
} catch (OperationFailureException ex) {
    Log.d(TAG, (" Antenna configuration failed " + ex.getVendorMessage()));
}

Closer look

  • Get the reader supported power levels for particular regulatory using reader.ReaderCapabilities.getTransmitPowerLevelValues()
  • SetrfModeTableIndex sets particular link profile as provided by RFModeTable rfModeTable = reader.ReaderCapabilities.RFModes.getRFModeTableInfo(0) and supported for specific regulatory. In general default link profile is always referred to index 0

Populated rfModeTable will have entries like shown below. The following two entries are illustrative examples; actual indices and values depend on the device and regulatory settings.

  • Profile: M4 640K | Index 38 | Modulation: MV_4 | BDR: 160000 | MaxTari: 10400 | MinTari: 6250 | PieValue: 1500 | SpectralMaskIndicator: SMI_DI | StepTariValue: 4150 | ForwardLinkModulationType: FORWARD_LINK_MODULATION_PR_ASK | DivideRatio: DR_8 | isEpcHAGTCConformance false
  • Profile: M4 640K | Index 39 | Modulation: MV_4 | BDR: 160000 | MaxTari: 10400 | MinTari: 6250 | PieValue: 2000 | SpectralMaskIndicator: SMI_DI | StepTariValue: 4150 | ForwardLinkModulationType: FORWARD_LINK_MODULATION_PR_ASK | DivideRatio: DR_8 | isEpcHAGTCConformance false

Below code snippet can be used to populate the above rfModeTable.


public void populateLinkProfiles() {
    RFModeTableEntry rfModeTableEntry = null;
    String profile;
    
    RFModeTable rfModeTable = reader.ReaderCapabilities.RFModes.getRFModeTableInfo(0);
    
    for (int i = 0; i < rfModeTable.length(); i++) {
        rfModeTableEntry = rfModeTable.getRFModeTableEntryInfo(i);

        int bdr = rfModeTableEntry.getBdrValue();
        int miller = 1;
        switch (rfModeTableEntry.getModulation().getValue()) {
            case 1:
                miller = 2;
                break;
            case 2:
                miller = 4;
                break;
            case 3:
                miller = 8;
                break;
        }
        if (miller == 1) {
            if (rfModeTableEntry.getMaxTariValue() == 668)
                profile = "AUTOMAC" + " " + "668";
            else
                profile = "FM0" + " " + bdr * miller / 1000 + "K";
        } else
            profile = "M" + miller + " " + bdr * miller / 1000 + "K";

        Log.d(TAG, "Profile: " + profile +
                " | Index " + rfModeTableEntry.getModeIdentifer() +
                " | Modulation: " + rfModeTableEntry.getModulation().toString() +
                " | BDR: " + rfModeTableEntry.getBdrValue() +
                " | MaxTari: " + rfModeTableEntry.getMaxTariValue() +
                " | MinTari: " + rfModeTableEntry.getMinTariValue() +
                " | PieValue: " + rfModeTableEntry.getPieValue() +
                " | SpectralMaskIndicator: " + rfModeTableEntry.getSpectralMaskIndicator() +
                " | StepTariValue: " + rfModeTableEntry.getStepTariValue()
            +     " | ForwardLinkModulationType: " + rfModeTableEntry.getForwardLinkModulationType() +
                " | DivideRatio: " + rfModeTableEntry.getDivideRatio() +
                " | isEpcHAGTCConformance " + rfModeTableEntry.isEpcHAGTCConformance()
        );
    }
}
                                                         

What's Next

  • Change setTransmitPowerIndex values to move between different power levels
  • Use setrfModeTableIndex to use different link profiles suited for use case.