The C# facade wraps the RIK native library in idiomatic .NET classes with IDisposable support and managed exceptions.
Installation
dotnet add package rfIDEAS.ReaderIntegrationKit
The NuGet package includes pre-built native libraries for Windows x64 and Linux x64. No additional native library setup is needed.
Namespace
using rfIDEAS.ReaderIntegrationKit;
using rfIDEAS.ReaderIntegrationKit.Objects;
using rfIDEAS.ReaderIntegrationKit.Enum;
AbstractReader (abstract)
Base class for all reader applications. Implements IDisposable.
Methods
| Method | Returns | Description |
|---|
Init() | void | Initialize connection to the reader |
RefreshMetadata() | void | Force a metadata refresh from the device |
GetMetadata(bool forceRefresh = false) | ReaderMetadataStruct | Get reader metadata (cached unless forceRefresh is true) |
GetLibraryInfo() | LibraryInfo | Static. Get library version info (no instance required) |
Dispose() | void | Release native resources |
Reader : AbstractReader
Application class for rf IDEAS readers.
Constructor
new Reader(ReaderDefinition readerDefinition, int retryCount = 3)
| Parameter | Type | Description |
|---|
readerDefinition | ReaderDefinition | Reader connection parameters |
retryCount | int | Connection retry attempts (default: 3) |
Methods
Beeper
| Method | Returns | Description |
|---|
Beep(int beepCount, BeepDuration duration) | void | Sound the beeper |
GetBeeperVolume() | BeepVolume | Get current volume |
SetBeeperVolume(BeepVolume volume) | void | Set volume |
Card Data
| Method | Returns | Description |
|---|
GetCardData(out CardData cardData) | void | Read card data from the reader |
Credential Callbacks
| Method | Returns | Description |
|---|
OnCredentialPresented(CredentialCallback callback) | uint | Subscribe to credential events. Returns a subscription ID. |
UnsubscribeCredentialCallback(uint subscriptionId) | void | Unsubscribe a previously registered callback |
The CredentialCallback delegate is defined as:
public delegate void CredentialCallback(CardData cardData);
When a card is presented to the reader, the callback fires on a background thread with the card data. Multiple callbacks can be registered simultaneously.
Configuration
| Method | Returns | Description |
|---|
GetReaderConfiguration(int configurationNumber) | (ReaderConfigurationStruct, ExtendedConfiguration) | Read configuration slot |
SetReaderConfiguration(int configurationNumber, ReaderConfigurationStruct config, ExtendedConfiguration extendedConfig, HashData hashData) | void | Write configuration slot |
LED
| Method | Returns | Description |
|---|
GetLedConfiguration(int configurationNumber) | LedConfiguration | Read LED configuration |
SetLedConfiguration(int configurationNumber, LedConfiguration ledConfig) | void | Write LED configuration |
LUID
| Method | Returns | Description |
|---|
GetLuid() | LuidResponseInformation | Get Logical Unit ID |
SetLuid(int luid) | void | Set Logical Unit ID |
Module Control
| Method | Returns | Description |
|---|
GetModuleState(ReaderModuleId moduleId) | ReaderModuleState | Get module power state |
SetModuleState(ReaderModuleId moduleId, ReaderModuleState state) | void | Set module power state |
Modes
| Method | Returns | Description |
|---|
EnableKeystroking(bool enable) | void | Enable or disable keystroking |
Card Types
| Method | Returns | Description |
|---|
GetSupportedCardTypes() | IEnumerable<CardTypeInfo> | List supported card types |
BLE Configuration
| Method | Returns | Description |
|---|
ReadBleConfigurationFromReader(BleDataType dataType, string fileName) | void | Read BLE config to file |
WriteBleConfigurationToReader(BleDataType dataType, string fileName) | void | Write BLE config from file |
HWG Configuration
| Method | Returns | Description |
|---|
WriteHwgFileToReader(string fileName) | void | Write an HWG configuration file to the reader |
ReadHwgFileFromReader(string fileName, bool secureHwgFormat = true) | void | Read configuration from the reader and save to an HWG file |
Smart Card Configuration
| Method | Returns | Description |
|---|
WriteSmartCardConfigurationToReader(string filePath) | void | Write smart card configuration from an INI file to the reader |
ReadSmartCardConfigurationFromReader(ref SmartCardConfigurationStruct configStruct) | void | Read smart card configuration from the reader |
Key Types
Defined in rfIDEAS.ReaderIntegrationKit.Objects.
ReaderDefinition
| Property | Type | Description |
|---|
DeviceId | DeviceId | Vendor and product identifiers |
ProtocolType | ProtocolType | Communication protocol |
SerialPortSettings | SerialPortSettings | Serial port configuration (serial connections only) |
DeviceId
| Property | Type | Description |
|---|
VendorId | ushort | USB vendor ID |
ProductId | ushort | USB product ID |
UsbPath | IntPtr | USB device path (optional; use to target a specific USB port) |
SerialNumber | IntPtr | USB serial number string (optional; use to target a specific reader) |
SerialPortSettings
| Property | Type |
|---|
BaudRate | SerialPortBaudRate |
Parity | SerialPortParity |
FlowControl | SerialPortFlowControl |
PortName | string |
ByteSize | int |
DataBits | SerialPortDataBits |
StopBits | SerialPortStopBits |
Contains string fields (part number, serial number, model name, etc.), firmware version structs, hardware capability flags, Has* boolean flags indicating which fields were populated, and an AdvancedAttributes struct with read-only hardware capabilities. See Structures for full details.
CardData
| Property | Type | Description |
|---|
Data | byte[] | Raw card data bytes |
BitCount | int | Number of valid bits |
IsEmpty() | bool | Returns true if bit count is zero and all data bytes are zero |
AsHexString() | string | Hex representation of the data |
LibraryInfo
Contains 27+ string fields with library version and build metadata (version string, build date, compiler, platform, etc.).
LedConfiguration
| Property | Type | Description |
|---|
Color | LedColor | LED color |
SoftwareControlEnabled | bool | Whether software LED control is active |
ReaderException
Thrown on any native library error.
| Property | Type | Description |
|---|
Message | string | Error description |
FileName | string | Source file |
LineNumber | int | Source line |
FunctionName | string | Source function |
HasProtocolException | bool | Whether protocol-level details are available |
ProtocolMessage | string | Protocol error description |
Enums
Defined in rfIDEAS.ReaderIntegrationKit.Enum.
ProtocolType
| Value | Description |
|---|
Invalid | Not set |
FeatureReport | USB HID feature report |
SerialBinary | Serial binary protocol |
Unknown | Unrecognized |
BeepDuration
| Value | Description |
|---|
BeepDurationShort | Short beep |
BeepDurationLong | Long beep |
BeepVolume
| Value | Description |
|---|
Off | Muted |
Low | Low volume |
Medium | Medium volume |
High | High volume |
Unknown | Unknown / unset |
LedColor
| Value | Description |
|---|
Invalid | Not set |
Off | LED off |
Red | Red |
Green | Green |
Amber | Amber |
Unknown | Unknown / unset |
ReaderModuleId
| Value | Description |
|---|
Invalid | Not set |
LowFrequencyRadio | 125 kHz radio |
HighFrequencyRadio | 13.56 MHz radio |
BleRadio | Bluetooth Low Energy radio |
ReaderModuleState
| Value | Hex | Description |
|---|
Invalid | 0x00 | Not set |
PowerOff | 0x80 | Module powered off |
PowerOnNormal | 0x81 | Module powered on, normal operation |
BleDataType
| Value | Int | Description |
|---|
Data | 1 | BLE data payload |
Key | 2 | Encrypted key |
UnencryptedKey | 3 | Unencrypted key |
Examples
Basic Connection
using rfIDEAS.ReaderIntegrationKit;
using rfIDEAS.ReaderIntegrationKit.Objects;
using rfIDEAS.ReaderIntegrationKit.Enum;
var readerDef = new ReaderDefinition
{
DeviceId = new DeviceId { VendorId = 0x0C27, ProductId = 0x3BFA },
ProtocolType = ProtocolType.FeatureReport
};
using var app = new Reader(readerDef);
app.Init();
var metadata = app.GetMetadata();
Console.WriteLine($"Part: {metadata.PartNumber}");
Console.WriteLine($"Serial: {metadata.ESN}");
Beep
using var app = new Reader(readerDef);
app.Init();
app.Beep(2, BeepDuration.Short);
app.SetBeeperVolume(BeepVolume.High);
Read Card Data
using var app = new Reader(readerDef);
app.Init();
var card = app.GetCardData();
if (!card.IsEmpty())
{
Console.WriteLine($"Bits: {card.BitCount}");
Console.WriteLine($"Hex: {card.AsHexString()}");
}
Library Info (No Reader Required)
var info = AbstractReader.GetLibraryInfo();
Console.WriteLine($"Version: {info.VersionString}");
Thread Safety
All methods are thread-safe. Internal locking ensures safe concurrent access.
See Also