Structures
All structures used across the RIK API. Select a language tab to see the definition and field types for that language.
ReaderDefinition
Configures reader connection parameters.
- C++
- C#
- Python
Namespace: RikCommon
#pragma pack(push, 1)
struct ReaderDefinition
{
DeviceId DeviceId;
ProtocolType ProtocolType = PROTOCOL_TYPE_INVALID;
SerialPortSettings SerialPortSettings;
};
#pragma pack(pop)
| Field | Type | Description |
|---|---|---|
DeviceId | DeviceId | USB device identification (VID/PID/path/serial) |
ProtocolType | ProtocolType (uint8_t) | Communication protocol (default: PROTOCOL_TYPE_INVALID) |
SerialPortSettings | SerialPortSettings | Serial port configuration (only for PROTOCOL_TYPE_SERIAL_BINARY) |
ReaderDefinition readerDef;
readerDef.DeviceId.VendorId = 0x0C27;
readerDef.DeviceId.ProductId = 0x3BFA;
readerDef.ProtocolType = PROTOCOL_TYPE_FEATURE_REPORT;
auto handle = AbstractReader::CreateReaderInstance(readerDef, 3);
Namespace: rfIDEAS.ReaderIntegrationKit.Objects
[StructLayout(LayoutKind.Sequential)]
public struct ReaderDefinition
{
public DeviceId DeviceId;
public ProtocolType ProtocolType;
public SerialPortSettings SerialPortSettings;
}
| Field | Type | Description |
|---|---|---|
DeviceId | DeviceId | USB device identification (VID/PID/path/serial) |
ProtocolType | ProtocolType (byte) | Communication protocol |
SerialPortSettings | SerialPortSettings | Serial port configuration (only for ProtocolType.SERIAL_BINARY) |
var readerDef = new ReaderDefinition
{
DeviceId = new DeviceId { VendorId = 0x0C27, ProductId = 0x3BFA },
ProtocolType = ProtocolType.FeatureReport
};
using var app = new Reader(readerDef);
Module: reader_integration_kit.structures
class ReaderDefinition(Structure):
_fields_ = [
("DeviceId", DeviceId),
("ProtocolType", c_uint8),
("SerialPortSettings", SerialPortSettings),
]
| Field | Type | Description |
|---|---|---|
DeviceId | DeviceId | USB device identification (VID/PID/path/serial) |
ProtocolType | c_uint8 | Communication protocol (use ProtocolType enum values) |
SerialPortSettings | SerialPortSettings | Serial port configuration (only for ProtocolType.SERIAL_BINARY) |
reader_def = ReaderDefinition(
DeviceId=DeviceId(VendorId=0x0C27, ProductId=0x3BFA),
ProtocolType=ProtocolType.FEATURE_REPORT,
SerialPortSettings=SerialPortSettings()
)
DeviceId
USB device identification. Supports three connection strategies: VID/PID, VID/PID + serial number, or USB path.
- C++
- C#
- Python
Namespace: RikCommon
#pragma pack(push, 1)
struct DeviceId
{
uint16_t VendorId;
uint16_t ProductId;
wchar_t* UsbPath;
wchar_t* SerialNumber;
};
#pragma pack(pop)
| Field | Type | Description |
|---|---|---|
VendorId | uint16_t | USB Vendor ID (0x0C27 for rf IDEAS) |
ProductId | uint16_t | USB Product ID |
UsbPath | wchar_t* | Optional. Topological USB path for port-specific connection |
SerialNumber | wchar_t* | Optional. Distinguishes multiple readers with the same VID/PID |
DeviceId id{};
id.VendorId = 0x0C27;
id.ProductId = 0x3BFA;
id.SerialNumber = L"ABC123";
Namespace: rfIDEAS.ReaderIntegrationKit
[StructLayout(LayoutKind.Sequential)]
public struct DeviceId
{
public ushort VendorId;
public ushort ProductId;
public IntPtr UsbPath;
public IntPtr SerialNumber;
}
| Field | Type | Description |
|---|---|---|
VendorId | ushort | USB Vendor ID (0x0C27 for rf IDEAS) |
ProductId | ushort | USB Product ID |
UsbPath | IntPtr | Optional. Wide string pointer, default IntPtr.Zero. Set via Marshal.StringToHGlobalUni(). |
SerialNumber | IntPtr | Optional. Wide string pointer, default IntPtr.Zero. Set via Marshal.StringToHGlobalUni(). |
var id = new DeviceId
{
VendorId = 0x0C27,
ProductId = 0x3BFA,
SerialNumber = Marshal.StringToHGlobalUni("ABC123")
};
Module: reader_integration_kit.structures
class DeviceId(Structure):
_fields_ = [
("VendorId", c_ushort),
("ProductId", c_ushort),
("UsbPath", c_void_p),
("SerialNumber", c_void_p),
]
| Field | Type | Description |
|---|---|---|
VendorId | c_ushort | USB Vendor ID (0x0C27 for rf IDEAS) |
ProductId | c_ushort | USB Product ID |
UsbPath | c_void_p | Optional. Wide string pointer, default None. Set via ctypes.cast(ctypes.c_wchar_p(...), ctypes.c_void_p). |
SerialNumber | c_void_p | Optional. Wide string pointer, default None. Set via ctypes.cast(ctypes.c_wchar_p(...), ctypes.c_void_p). |
import ctypes
id = DeviceId(
VendorId=0x0C27,
ProductId=0x3BFA,
SerialNumber=ctypes.cast(ctypes.c_wchar_p("ABC123"), ctypes.c_void_p)
)
Connection Strategies
RIK selects the connection strategy based on which DeviceId fields are populated:
| Strategy | Fields Set | Behavior |
|---|---|---|
| VID/PID | VendorId + ProductId | Opens the first matching device. Non-deterministic when duplicates exist. |
| VID/PID + Serial | VendorId + ProductId + SerialNumber | Filters by USB serial number. VID/PID narrows the search. On newer rf IDEAS readers, the USB serial number matches the reader's ESN. |
| USB Path | UsbPath (VID/PID ignored) | Opens by physical port location. VID/PID and SerialNumber are completely ignored. Most deterministic. |
When UsbPath is set, it takes full precedence -- the connection is made purely by topological port path and all other DeviceId fields are ignored. The path format is platform-specific:
- Linux:
"B-P"or"B-P.P.P"(e.g.,"1-7","1-7.2") - Windows: Location path (e.g.,
"PCIROOT(0)#PCI(1400)#USBROOT(0)#USB(7)")
See Connection Strategies for full examples in all languages.
SerialPortSettings
Serial port communication configuration.
- C++
- C#
- Python
Namespace: RikCommon
#pragma pack(push, 1)
struct SerialPortSettings
{
SerialPortBaudRate BaudRate;
SerialPortParity Parity;
SerialPortFlowControl FlowControl;
char PortName[256];
uint8_t ByteSize;
SerialPortDataBits DataBits;
SerialPortStopBits StopBits;
};
#pragma pack(pop)
| Field | Type | Description |
|---|---|---|
BaudRate | SerialPortBaudRate (uint32_t) | Communication speed |
Parity | SerialPortParity (uint8_t) | Parity bit configuration |
FlowControl | SerialPortFlowControl (uint8_t) | Flow control mode |
PortName | char[256] | Port name (e.g., "COM3", "/dev/ttyUSB0") |
ByteSize | uint8_t | Byte size |
DataBits | SerialPortDataBits (uint8_t) | Number of data bits |
StopBits | SerialPortStopBits (uint8_t) | Number of stop bits |
readerDef.SerialPortSettings.BaudRate = SERIAL_PORT_BAUD_9600;
readerDef.SerialPortSettings.Parity = SERIAL_PORT_PARITY_NONE;
std::strcpy(readerDef.SerialPortSettings.PortName, "COM3");
Namespace: rfIDEAS.ReaderIntegrationKit.Objects
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
public struct SerialPortSettings
{
public SerialPortBaudRate BaudRate;
public SerialPortParity Parity;
public SerialPortFlowControl FlowControl;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
public string PortName;
public int ByteSize;
public SerialPortDataBits DataBits;
public SerialPortStopBits StopBits;
}
| Field | Type | Description |
|---|---|---|
BaudRate | SerialPortBaudRate (uint) | Communication speed |
Parity | SerialPortParity (byte) | Parity bit configuration |
FlowControl | SerialPortFlowControl (byte) | Flow control mode |
PortName | string | Port name (e.g., "COM3", "/dev/ttyUSB0") |
ByteSize | int | Byte size |
DataBits | SerialPortDataBits (byte) | Number of data bits |
StopBits | SerialPortStopBits (byte) | Number of stop bits |
SerialPortSettings = new SerialPortSettings
{
PortName = "COM3",
BaudRate = SerialPortBaudRate.Baud9600,
Parity = SerialPortParity.None,
DataBits = SerialPortDataBits.Eight,
StopBits = SerialPortStopBits.One
}
Module: reader_integration_kit.structures
class SerialPortSettings(Structure):
_pack_ = 1
_fields_ = [
("BaudRate", c_uint32),
("Parity", c_uint8),
("FlowControl", c_uint8),
("PortName", c_char * 256),
("ByteSize", c_int),
("DataBits", c_uint8),
("StopBits", c_uint8),
]
| Field | Type | Description |
|---|---|---|
BaudRate | c_uint32 | Communication speed (use SerialPortBaudRate enum values) |
Parity | c_uint8 | Parity bit configuration (use SerialPortParity enum values) |
FlowControl | c_uint8 | Flow control mode (use SerialPortFlowControl enum values) |
PortName | c_char * 256 | Port name (e.g., b"COM3", b"/dev/ttyUSB0") |
ByteSize | c_int | Byte size |
DataBits | c_uint8 | Number of data bits (use SerialPortDataBits enum values) |
StopBits | c_uint8 | Number of stop bits (use SerialPortStopBits enum values) |
settings = SerialPortSettings(
PortName=b"COM3",
BaudRate=SerialPortBaudRate.BAUD_9600,
Parity=SerialPortParity.NONE,
DataBits=SerialPortDataBits.DATA_BITS_8,
StopBits=SerialPortStopBits.ONE
)
ReaderMetadataStruct
Reader information retrieved from the device. Each field has a corresponding Has* presence flag.
Always check Has* flags before reading the corresponding field. Fields without their Has* flag set may contain empty or stale data.
- C++
- C#
- Python
Namespace: Rik
#pragma pack(push, 1)
struct ReaderMetadataStruct
{
char Processor[512]; unsigned char HasProcessor;
char HardwarePlatform[512]; unsigned char HasHardwarePlatform;
char Product[512]; unsigned char HasProduct;
char PartNumber[512]; unsigned char HasPartNumber;
char ProductLine[512]; unsigned char HasProductLine;
int ConfigurationCount; unsigned char HasConfigurationCount;
char SerialNumber[512]; unsigned char HasSerialNumber;
char ESN[512]; unsigned char HasESN;
char InstalledHardware[512]; unsigned char HasInstalledHardware;
char SupportedHardware[512]; unsigned char HasSupportedHardware;
// Hardware capability flags
unsigned char HwSupportedSamSe;
unsigned char HwSupportedRfAms;
unsigned char HwSupportedRf125;
unsigned char HwSupportedRfLegic;
unsigned char HwSupportedRfBle;
unsigned char HwSupportedNxp;
unsigned char HwSupportedRfHidBle;
unsigned char HwSupportedFelica;
unsigned char HwSupportedBeeper;
unsigned char HwSupportedNano;
unsigned char HwInstalledSamSe;
unsigned char HwInstalledRfAms;
unsigned char HwInstalledRf125;
unsigned char HwInstalledRfLegic;
unsigned char HwInstalledRfBle;
unsigned char HwInstalledNxp;
unsigned char HwInstalledRfHidBle;
unsigned char HwInstalledFelica;
unsigned char HasInstalledHardwareInfo;
char FirmwareFilename[512]; unsigned char HasFirmwareFilename;
char FirmwareVersion[512]; unsigned char HasFirmwareVersion;
// Controller firmware versions
char ControllerApplicationVersion[512]; unsigned char HasControllerApplicationVersion;
char ControllerBootloaderVersion[512]; unsigned char HasControllerBootloaderVersion;
char ControllerRadioVersion[512]; unsigned char HasControllerRadioVersion;
// Radio firmware versions
char RadioApplicationVersion[512]; unsigned char HasRadioApplicationVersion;
char RadioBootloaderVersion[512]; unsigned char HasRadioBootloaderVersion;
char RadioRadioVersion[512]; unsigned char HasRadioRadioVersion;
// Bluetooth / Security modules
char BluetoothVersion[512]; unsigned char HasBluetoothVersion;
char HidSeSamVersion[512]; unsigned char HasHidSeSamVersion;
char NxpSamVersion[512]; unsigned char HasNxpSamVersion;
char FelicaSamVersion[512]; unsigned char HasFelicaSamVersion;
// Protocol and advanced attributes
unsigned char ProtocolType;
unsigned char ReaderSupportsExtendedMode;
struct {
unsigned char ReverseAllBytesSupported;
unsigned char AsciiExtendedSupported;
unsigned char RoswellModeEnabled;
} AdvancedAttributes;
};
#pragma pack(pop)
| Field | Type | Description |
|---|---|---|
Processor | char[512] | Processor identifier |
PartNumber | char[512] | Reader part number |
SerialNumber | char[512] | Reader serial number |
ESN | char[512] | Electronic Serial Number |
ConfigurationCount | int | Number of configuration slots |
FirmwareVersion | char[512] | Firmware version string |
Has* | unsigned char | Presence flag for string/version fields (1 = present) |
HwSupported* | unsigned char | Hardware capability: whether the reader hardware supports this module |
HwInstalled* | unsigned char | Hardware capability: whether this module is installed |
HasInstalledHardwareInfo | unsigned char | 1 if hardware capability fields are populated |
ProtocolType | unsigned char | Protocol used by this reader connection |
ReaderSupportsExtendedMode | unsigned char | Read-only hardware capability flag |
AdvancedAttributes | nested struct | Read-only hardware capabilities (see below) |
AdvancedAttributes
Read-only hardware capabilities derived from the reader's internal configuration. These fields are populated automatically and cannot be changed via SetReaderConfiguration.
| Field | Type | Description |
|---|---|---|
ReverseAllBytesSupported | unsigned char | Reader hardware supports reverse-all-bytes mode |
AsciiExtendedSupported | unsigned char | Reader hardware supports ASCII extended mode |
RoswellModeEnabled | unsigned char | Roswell mode is enabled on the reader |
auto metadata = app->GetMetadataStruct();
if (metadata.HasPartNumber)
std::cout << "Part: " << metadata.PartNumber << std::endl;
if (metadata.HasFirmwareVersion)
std::cout << "Firmware: " << metadata.FirmwareVersion << std::endl;
// Hardware capabilities
if (metadata.HasInstalledHardwareInfo) {
std::cout << "BLE supported: " << (int)metadata.HwSupportedRfBle << std::endl;
std::cout << "Beeper supported: " << (int)metadata.HwSupportedBeeper << std::endl;
}
// Advanced attributes (read-only)
std::cout << "Reverse all bytes: "
<< (int)metadata.AdvancedAttributes.ReverseAllBytesSupported << std::endl;
Namespace: rfIDEAS.ReaderIntegrationKit.Objects
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct ReaderMetadataStruct
{
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 512)] public string Processor;
[MarshalAs(UnmanagedType.I1)] public bool HasProcessor;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 512)] public string PartNumber;
[MarshalAs(UnmanagedType.I1)] public bool HasPartNumber;
// ... same pattern for string/version fields
// Hardware capability flags (bool)
public bool HwSupportedSamSe;
public bool HwSupportedRfBle;
public bool HwSupportedBeeper;
// ... (see C++ tab for full list)
public bool HasInstalledHardwareInfo;
// Protocol and advanced attributes
public byte ProtocolType;
public bool ReaderSupportsExtendedMode;
public AdvancedAttributes AdvancedAttributes;
}
| Field | Type | Description |
|---|---|---|
Processor | string | Processor identifier |
PartNumber | string | Reader part number |
SerialNumber | string | Reader serial number |
ESN | string | Electronic Serial Number |
FirmwareVersion | string | Firmware version string |
ConfigurationCount | int | Number of configurations |
Has* | bool | Presence flag for string/version fields |
HwSupported* / HwInstalled* | bool | Hardware capability flags |
HasInstalledHardwareInfo | bool | Whether hardware capability fields are populated |
ProtocolType | byte | Protocol type for this connection |
ReaderSupportsExtendedMode | bool | Read-only hardware capability |
AdvancedAttributes | AdvancedAttributes | Read-only hardware capabilities (nested struct) |
AdvancedAttributes (C#)
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct AdvancedAttributes
{
[MarshalAs(UnmanagedType.I1)] public bool ReverseAllBytesSupported;
[MarshalAs(UnmanagedType.I1)] public bool AsciiExtendedSupported;
[MarshalAs(UnmanagedType.I1)] public bool RoswellModeEnabled;
}
var metadata = app.GetMetadata();
if (metadata.HasPartNumber)
Console.WriteLine($"Part: {metadata.PartNumber}");
if (metadata.HasFirmwareVersion)
Console.WriteLine($"Firmware: {metadata.FirmwareVersion}");
// Hardware capabilities
if (metadata.HasInstalledHardwareInfo)
Console.WriteLine($"BLE supported: {metadata.HwSupportedRfBle}");
// Advanced attributes (read-only)
Console.WriteLine($"Reverse all bytes: {metadata.AdvancedAttributes.ReverseAllBytesSupported}");
Module: reader_integration_kit.structures
The raw ReaderMetadataStruct is a ctypes Structure with c_char * 512 fields and c_uint8 presence flags. In practice, get_metadata() returns a dict with only the fields where Has* is true, decoded as strings. Hardware capability fields and AdvancedAttributes are always included.
class ReaderMetadataStruct(Structure):
_pack_ = 1
_fields_ = [
("Processor", c_char * 512), ("HasProcessor", c_uint8),
("PartNumber", c_char * 512), ("HasPartNumber", c_uint8),
# ... same pattern for string/version fields
# Hardware capability flags
("HwSupportedSamSe", c_uint8),
("HwSupportedRfBle", c_uint8),
("HwSupportedBeeper", c_uint8),
# ... (see C++ tab for full list)
("HasInstalledHardwareInfo", c_uint8),
# Protocol and advanced attributes
("ProtocolType", c_uint8),
("ReaderSupportsExtendedMode", c_uint8),
("AdvancedAttributes", _AdvancedAttributes),
]
| Field | Type | Description |
|---|---|---|
Processor | c_char * 512 | Processor identifier |
PartNumber | c_char * 512 | Reader part number |
SerialNumber | c_char * 512 | Reader serial number |
ESN | c_char * 512 | Electronic Serial Number |
FirmwareVersion | c_char * 512 | Firmware version string |
ConfigurationCount | c_int | Number of configurations |
Has* | c_uint8 | Presence flag for string/version fields (1 = present) |
HwSupported* / HwInstalled* | c_uint8 | Hardware capability flags |
HasInstalledHardwareInfo | c_uint8 | Whether hardware capability fields are populated |
ProtocolType | c_uint8 | Protocol type for this connection |
ReaderSupportsExtendedMode | c_uint8 | Read-only hardware capability |
AdvancedAttributes | nested struct | Read-only hardware capabilities |
The AdvancedAttributes nested struct contains:
| Field | Type | Description |
|---|---|---|
ReverseAllBytesSupported | c_uint8 | Reader hardware supports reverse-all-bytes mode |
AsciiExtendedSupported | c_uint8 | Reader hardware supports ASCII extended mode |
RoswellModeEnabled | c_uint8 | Roswell mode is enabled on the reader |
metadata = app.get_metadata() # returns dict with present fields only
print(f"Part: {metadata.get('PartNumber')}")
print(f"Firmware: {metadata.get('FirmwareVersion')}")
# Advanced attributes are always included
advanced = metadata.get('AdvancedAttributes', {})
print(f"Reverse all bytes: {advanced.get('ReverseAllBytesSupported')}")
CardData
Represents credential data read from a card.
- C++
- C#
- Python
Namespace: Rik
class CardData
{
public:
std::vector<uint8_t> Data; // 32 bytes
unsigned int GetBitCount() const;
void SetBitCount(unsigned int bitCount);
bool IsEmpty() const;
std::string AsString();
};
| Member | Type | Description |
|---|---|---|
Data | std::vector<uint8_t> | Raw card data (32 bytes) |
GetBitCount() | unsigned int | Number of valid bits in the data |
SetBitCount() | void | Set the bit count |
IsEmpty() | bool | Returns true if bit count is zero and all data bytes are zero |
AsString() | std::string | Hex string representation of the data |
Namespace: rfIDEAS.ReaderIntegrationKit.Objects
public class CardData
{
public byte[] Data { get; }
public uint BitCount { get; }
public bool IsEmpty();
public string AsString();
public string AsHexString();
}
| Member | Type | Description |
|---|---|---|
Data | byte[] | Raw card data (32 bytes, cloned on access) |
BitCount | uint | Number of valid bits in the data |
IsEmpty() | bool | Returns true if bit count is zero and all data bytes are zero |
AsString() | string | UTF-8 decoded string representation |
AsHexString() | string | Hex string representation ("XX XX XX" format) |
Module: reader_integration_kit.structures
class CardData:
data: List[int] # 32-element list
bit_count: int # property (get/set)
def is_empty(self) -> bool: ...
def as_bytes(self) -> bytes: ...
def as_list(self) -> List[int]: ...
def as_hex_string(self) -> str: ...
| Member | Type | Description |
|---|---|---|
data | List[int] | Raw card data (32 elements) |
bit_count | int | Number of valid bits in the data (property) |
is_empty() | bool | Returns True if bit count is zero and all data bytes are zero |
as_bytes() | bytes | Raw bytes representation |
as_list() | List[int] | List of byte values |
as_hex_string() | str | Hex string representation |
Use IsEmpty() (C++/C#) or is_empty() (Python) to check whether card data was read. The method returns true when bit count is zero and all data bytes are zero, indicating no card is present.
LibraryInfo
ABI-safe struct containing library build and version metadata.
- C++
- C#
- Python
Namespace: Rik
struct LibraryInfo
{
char Name[256];
char InternalName[256];
char Comments[512];
char CompanyName[256];
char CompanyCopyright[512];
char LicenseText[1024];
char FileDescription[1024];
char SemVer[256];
char BuildVer[256];
char VersionString[256];
char BuildDate[256];
char BuildPlatform[256];
char BuildToolchain[256];
// ... additional build metadata fields (28 total)
};
| Key Fields | Type | Description |
|---|---|---|
Name | char[256] | Library name |
SemVer | char[256] | Semantic version string |
VersionString | char[256] | Full version string |
BuildDate | char[256] | Build date |
BuildPlatform | char[256] | Target platform |
BuildToolchain | char[256] | Compiler/toolchain used |
LibraryInfo info;
auto result = AbstractReader::GetLibraryInfo(info);
if (!result.HasException) {
std::cout << "Version: " << info.SemVer << std::endl;
}
Namespace: rfIDEAS.ReaderIntegrationKit.Objects
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct LibraryInfo
{
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string Name;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string InternalName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 512)] public string Comments;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string CompanyName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 512)] public string CompanyCopyright;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)] public string LicenseText;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)] public string FileDescription;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string SemVer;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string BuildVer;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string VersionString;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string BuildDate;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string BuildPlatform;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string BuildToolchain;
// ... additional build metadata fields (28 total)
}
| Key Fields | Type | Description |
|---|---|---|
Name | string | Library name |
SemVer | string | Semantic version string |
VersionString | string | Full version string |
BuildDate | string | Build date |
BuildPlatform | string | Target platform |
BuildToolchain | string | Compiler/toolchain used |
var info = AbstractReader.GetLibraryInfo();
Console.WriteLine($"Version: {info.SemVer}");
Module: reader_integration_kit.structures
class LibraryInfo(Structure):
_fields_ = [
("Name", c_char * 256),
("InternalName", c_char * 256),
("Comments", c_char * 512),
("CompanyName", c_char * 256),
("CompanyCopyright", c_char * 512),
("LicenseText", c_char * 1024),
("FileDescription", c_char * 1024),
("SemVer", c_char * 256),
("BuildVer", c_char * 256),
("VersionString", c_char * 256),
("BuildDate", c_char * 256),
("BuildPlatform", c_char * 256),
("BuildToolchain", c_char * 256),
# ... additional build metadata fields (28 total)
]
| Key Fields | Type | Description |
|---|---|---|
Name | c_char * 256 | Library name |
SemVer | c_char * 256 | Semantic version string |
VersionString | c_char * 256 | Full version string |
BuildDate | c_char * 256 | Build date |
BuildPlatform | c_char * 256 | Target platform |
BuildToolchain | c_char * 256 | Compiler/toolchain used |
to_dict() decodes all fields as UTF-8 strings.
info = rik.AbstractReader.get_library_info()
print(f"Version: {info['SemVer']}")
LedConfiguration
LED state configuration.
- C++
- C#
- Python
Namespace: Rik
#pragma pack(push, 1)
struct LedConfiguration
{
LedColor Color;
bool SoftwareControlEnabled;
};
#pragma pack(pop)
| Field | Type | Description |
|---|---|---|
Color | LedColor (unsigned char) | Current LED color |
SoftwareControlEnabled | bool | Whether software LED control is active |
Namespace: rfIDEAS.ReaderIntegrationKit.Objects
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct LedConfiguration
{
public LedColor Color;
[MarshalAs(UnmanagedType.I1)]
public bool SoftwareControlEnabled;
}
| Field | Type | Description |
|---|---|---|
Color | LedColor (byte) | Current LED color |
SoftwareControlEnabled | bool | Whether software LED control is active |
Module: reader_integration_kit.structures
class LedConfiguration(Structure):
_pack_ = 1
_fields_ = [
("color", c_uint8),
("software_control_enabled", c_bool),
]
| Field | Type | Description |
|---|---|---|
color | c_uint8 | Current LED color (use LedColor enum values) |
software_control_enabled | c_bool | Whether software LED control is active |
Python uses snake_case field names (color, software_control_enabled) for this struct.
RikResult
C API error result struct. Returned by C API functions to communicate success or failure across the ABI boundary.
- C++
- C#
- Python
Namespace: Rik
#pragma pack(push, 1)
struct RikResult
{
bool HasException;
char ExceptionType[256];
char Message[2048];
char FileName[2048];
int LineNumber;
char FunctionName[256];
bool HasProtocolException;
char ProtocolExceptionType[256];
char ProtocolMessage[2048];
char ProtocolFileName[2048];
int ProtocolLineNumber;
char ProtocolFunctionName[256];
};
#pragma pack(pop)
| Field | Type | Description |
|---|---|---|
HasException | bool | true if an error occurred |
ExceptionType | char[256] | Exception class name |
Message | char[2048] | Error description |
FileName | char[2048] | Source file where the error originated |
LineNumber | int | Source line number |
FunctionName | char[256] | Function name |
HasProtocolException | bool | true if a protocol-level error is also present |
Protocol* fields | (same types) | Protocol-level error details (same layout) |
RikResult result = Rik_Init(handle);
if (result.HasException) {
std::cerr << "Error: " << result.Message << std::endl;
if (result.HasProtocolException) {
std::cerr << "Protocol: " << result.ProtocolMessage << std::endl;
}
}
Namespace: rfIDEAS.ReaderIntegrationKit.Objects
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct RikResult
{
[MarshalAs(UnmanagedType.I1)] public bool HasException;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string ExceptionType;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 2048)] public string Message;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 2048)] public string FileName;
public int LineNumber;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string FunctionName;
[MarshalAs(UnmanagedType.I1)] public bool HasProtocolException;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string ProtocolExceptionType;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 2048)] public string ProtocolMessage;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 2048)] public string ProtocolFileName;
public int ProtocolLineNumber;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string ProtocolFunctionName;
}
| Field | Type | Description |
|---|---|---|
HasException | bool | true if an error occurred |
ExceptionType | string | Exception class name |
Message | string | Error description |
FileName | string | Source file where the error originated |
LineNumber | int | Source line number |
FunctionName | string | Function name |
HasProtocolException | bool | true if a protocol-level error is also present |
Protocol* fields | (same types) | Protocol-level error details (same layout) |
Module: reader_integration_kit.structures
class RikResult(Structure):
_fields_ = [
("HasException", c_bool),
("ExceptionType", c_char * 256),
("Message", c_char * 2048),
("FileName", c_char * 2048),
("LineNumber", c_int),
("FunctionName", c_char * 256),
("HasProtocolException", c_bool),
("ProtocolExceptionType", c_char * 256),
("ProtocolMessage", c_char * 2048),
("ProtocolFileName", c_char * 2048),
("ProtocolLineNumber", c_int),
("ProtocolFunctionName", c_char * 256),
]
| Field | Type | Property Accessor | Description |
|---|---|---|---|
HasException | c_bool | has_exception | True if an error occurred |
ExceptionType | c_char * 256 | exception_type | Exception class name |
Message | c_char * 2048 | message | Error description |
FileName | c_char * 2048 | file_name | Source file where the error originated |
LineNumber | c_int | line_number | Source line number |
FunctionName | c_char * 256 | function_name | Function name |
HasProtocolException | c_bool | has_protocol_exception | True if a protocol-level error is present |
Protocol* fields | (same types) | protocol_* | Protocol-level error details (same layout) |
Snake_case property accessors decode the raw c_char buffers to UTF-8 strings.
LuidResponseInformation
Response data from a LUID query.
- C++
- C#
- Python
Namespace: Rik
struct LuidResponseInformation
{
uint16_t Luid;
uint16_t ApplicationVersionPackedBcd;
uint32_t BootloaderVersionUnpackedBcd;
};
| Field | Type | Description |
|---|---|---|
Luid | uint16_t | Logical Unit ID |
ApplicationVersionPackedBcd | uint16_t | Application version in packed BCD |
BootloaderVersionUnpackedBcd | uint32_t | Bootloader version in unpacked BCD |
Namespace: rfIDEAS.ReaderIntegrationKit.Objects
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct LuidResponseInformation
{
public ushort Luid;
public ushort ApplicationVersionPackedBcd;
public uint BootloaderVersionUnpackedBcd;
}
| Field | Type | Description |
|---|---|---|
Luid | ushort | Logical Unit ID |
ApplicationVersionPackedBcd | ushort | Application version in packed BCD |
BootloaderVersionUnpackedBcd | uint | Bootloader version in unpacked BCD |
Module: reader_integration_kit.structures
class LuidResponseInformation(Structure):
_pack_ = 1
_fields_ = [
("Luid", c_uint16),
("ApplicationVersionPackedBcd", c_uint16),
("BootloaderVersionUnpackedBcd", c_uint32),
]
| Field | Type | Description |
|---|---|---|
Luid | c_uint16 | Logical Unit ID |
ApplicationVersionPackedBcd | c_uint16 | Application version in packed BCD |
BootloaderVersionUnpackedBcd | c_uint32 | Bootloader version in unpacked BCD |
SupportedCardTypesResult
Result of querying supported card types from a reader.
- C++
- C#
- Python
Namespace: Rik
struct SupportedCardTypesResult
{
uint32_t Count;
CardTypeInfo CardTypes[256];
};
| Field | Type | Description |
|---|---|---|
Count | uint32_t | Number of valid entries in CardTypes |
CardTypes | CardTypeInfo[256] | Fixed-size array; only the first Count entries are valid |
Namespace: rfIDEAS.ReaderIntegrationKit.Objects
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct SupportedCardTypesResult
{
public uint Count;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)]
public CardTypeInfo[] CardTypes;
}
| Field | Type | Description |
|---|---|---|
Count | uint | Number of valid entries in CardTypes |
CardTypes | CardTypeInfo[] | Fixed-size array (256); only the first Count entries are valid |
Module: reader_integration_kit.structures
class SupportedCardTypesResult(Structure):
_pack_ = 1
_fields_ = [
("Count", c_uint32),
("CardTypes", CardTypeInfo * 256),
]
| Field | Type | Description |
|---|---|---|
Count | c_uint32 | Number of valid entries in CardTypes |
CardTypes | CardTypeInfo * 256 | Fixed-size array; only the first Count entries are valid |
CardTypeInfo
Describes a single card type supported by a reader.
- C++
- C#
- Python
Namespace: Rik
struct CardTypeInfo
{
uint16_t Value;
char Name[128];
char EnumName[64];
};
| Field | Type | Description |
|---|---|---|
Value | uint16_t | Numeric card type identifier |
Name | char[128] | Human-readable card type name |
EnumName | char[64] | Enumeration constant name |
Namespace: rfIDEAS.ReaderIntegrationKit.Objects
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct CardTypeInfo
{
public ushort Value;
public string Name { get; } // extracted from byte[128]
public string EnumName { get; } // extracted from byte[64]
}
| Field | Type | Description |
|---|---|---|
Value | ushort | Numeric card type identifier |
Name | string | Human-readable card type name (read-only property) |
EnumName | string | Enumeration constant name (read-only property) |
Module: reader_integration_kit.structures
class CardTypeInfo(Structure):
_pack_ = 1
_fields_ = [
("Value", c_uint16),
("Name", c_char * 128),
("EnumName", c_char * 64),
]
| Field | Type | Description |
|---|---|---|
Value | c_uint16 | Numeric card type identifier |
Name | c_char * 128 | Human-readable card type name |
EnumName | c_char * 64 | Enumeration constant name |