Examples
Runnable code examples for using RIK across all supported languages.
By Topic
| Page | Description |
|---|---|
| Basic Usage | Connect, read metadata, beep, close (C++, C#, Python) |
| Configuration & Features | Beeper, LED, LUID, keystroking, card types, BLE, reset |
| Credential Callbacks | Event-driven card detection: single, multiple, multi-reader, dynamic subscribe/unsubscribe |
| Multi-Reader | Managing multiple readers simultaneously |
| Discovering USB Paths | Find topological USB paths for port-specific connections |
| C API | C-compatible interface with RikResult error handling |
Common Pattern
All languages follow the same lifecycle:
- Define Reader -- Specify VID/PID or serial port
- Create Instance -- Get application handle
- Initialize -- Connect to reader
- Use API -- Perform operations
- Clean Up -- Close and destroy
Quick Comparison
| Feature | C++ | C API | C# | Python |
|---|---|---|---|---|
| Instance Creation | CreateReaderInstance() | RikReader_Open() | new Reader() | Reader() |
| Cleanup | DestroyInstance() | Rik_Close() | Dispose() / using | del / with |
| Error Handling | Exceptions | RikResult struct | Exceptions | Exceptions |
| Thread Safety | Automatic | Automatic | Automatic | Automatic |