Skip to main content

Configuration & Features

Examples for reading and writing reader configuration on rf IDEAS devices.

Get/Set Beeper Volume

// After Init()
auto* reader = dynamic_cast<Reader*>(
AbstractReader::GetInstance(handle)
);

// Get current volume
RikProtocol::BeepVolume volume;
reader->GetBeeperVolume(volume);
std::cout << "Volume: " << static_cast<int>(volume) << std::endl;

// Set volume
reader->SetBeeperVolume(RikProtocol::BEEP_VOLUME_HIGH);

Enable/Disable Keystroking

When keystroking is enabled, the reader emulates an HID keyboard and "types" card ID data as keystrokes to the host computer. Disable keystroking when using the SDK to read card data programmatically.

auto* reader = dynamic_cast<Reader*>(
AbstractReader::GetInstance(handle)
);

// Disable keystroking (e.g. for SDK-only mode)
reader->EnableKeystroking(false);

// Re-enable keystroking
reader->EnableKeystroking(true);

Get/Set LED Configuration

auto* reader = dynamic_cast<Reader*>(
AbstractReader::GetInstance(handle)
);

// Read LED config from slot 0
LedConfiguration ledConfig;
reader->GetLedConfiguration(0, ledConfig);

// Modify and write back
reader->SetLedConfiguration(0, ledConfig);

Get/Set Reader Configuration

Read and write the full reader configuration (ReaderConfiguration + ExtendedConfiguration).

auto* reader = dynamic_cast<Reader*>(
AbstractReader::GetInstance(handle)
);

// Read configuration from slot 0
RikCommon::ReaderConfiguration config;
RikProtocol::ExtendedConfiguration extConfig;
reader->GetReaderConfiguration(0, config, extConfig);

// Modify and write back
RikProtocol::HashData hashData;
reader->SetReaderConfiguration(0, config, extConfig, hashData);

Get/Set Module State

Control reader module power (e.g. radio on/off).

auto* reader = dynamic_cast<Reader*>(
AbstractReader::GetInstance(handle)
);

// Get current state of the low-frequency radio
RikProtocol::ReaderModuleState state;
reader->GetModuleState(RikProtocol::ReaderModuleId::LowFrequencyRadio, state);

// Power off the low-frequency radio
reader->SetModuleState(
RikProtocol::ReaderModuleId::LowFrequencyRadio,
RikProtocol::ReaderModuleState::PowerOff
);

// Power it back on
reader->SetModuleState(
RikProtocol::ReaderModuleId::LowFrequencyRadio,
RikProtocol::ReaderModuleState::PowerOnNormal
);

Get/Set LUID

auto* reader = dynamic_cast<Reader*>(
AbstractReader::GetInstance(handle)
);

// Get LUID
RikProtocol::LuidResponseInformation luidInfo;
reader->GetLuid(luidInfo);
std::cout << "LUID: " << luidInfo.Luid << std::endl;

// Set LUID
reader->SetLuid(42);

Get Supported Card Types

auto* reader = dynamic_cast<Reader*>(
AbstractReader::GetInstance(handle)
);

std::vector<RikCommon::CardType> cardTypes;
reader->GetSupportedCardTypes(cardTypes);

for (const auto& ct : cardTypes) {
std::cout << "Card Type: " << ct.Name << std::endl;
}

Read/Write BLE Configuration

auto* reader = dynamic_cast<Reader*>(
AbstractReader::GetInstance(handle)
);

// Read BLE configuration to file
reader->ReadBleConfigurationFromReader(
RikCommon::BleDataType::Data, "ble_backup.hwg+");

// Write BLE configuration from file
reader->WriteBleConfigurationToReader(
RikCommon::BleDataType::Data, "ble_config.hwg+");
note

BLE configuration operations require a reader with Bluetooth capability. Check the reader's capability profile before calling these methods.

Reset to Factory / User Defaults

auto* reader = dynamic_cast<Reader*>(
AbstractReader::GetInstance(handle)
);

// Reset to factory defaults
reader->ResetReaderConfiguration(CheckpointType::FactoryDefaults);

// Or reset to user defaults
reader->ResetReaderConfiguration(CheckpointType::UserDefaults);

// Save current config as user defaults
reader->WriteUserDefaultsToReader();
warning

Resetting to factory defaults erases all custom configuration. Consider backing up the configuration with ReadHwgFileFromReader first.