CSL RFID Reader Library for .NET — supporting Bluetooth LE and TCP/IP communication with CSL RFID readers.
| Reader | Connection |
|---|---|
| CS108 | Bluetooth LE |
| CS468 | Bluetooth LE |
| CS710S | Bluetooth LE |
| CS203XL | Bluetooth LE / TCP/IP |
| CS463 | TCP/IP (Intel low level API, port 1515) |
| CS203X | TCP/IP (Intel low level API, port 1515) |
| CS468 / CS468INT / CS468X / CS468XJ | TCP/IP (Intel low level API, port 1515) |
The reader type that is shown for a reader that has been found by the search is
resolved by CSLibrary.Tools.RFIDReaderTypeMap. Every application of the reader
family uses that map, so a reader is named the same way in every application.
Keep this matrix in sync with the
## Build & distribution matrixsection inAGENTS.md.
| Target framework | UI framework | Supported OS | Interfaces |
|---|---|---|---|
netstandard2.0 |
Xamarin | Windows UWP 10~11 / Android / iOS (no TLS 1.3) | BLE / TCP |
netstandard2.1 |
Xamarin | Android / iOS (TLS 1.3) | BLE / TCP |
net10.0 |
MAUI | Windows 10~11 / Android / iOS | BLE / TCP |
| Target framework | UI framework | Supported OS | Interfaces |
|---|---|---|---|
net48 |
WinForms | Windows 7~11 desktop (WinCE/WinXP may be possible) | BLE / TCP; USB / Serial Port in design |
| Target framework | UI framework | Supported OS | Interfaces |
|---|---|---|---|
net10.0 (WinForms, net10.0-windows10.0.19041.0) |
WinForms | Windows 10~11 desktop | BLE / TCP; Serial Port in design |
Notes
- Published NuGet package (Plugin.BLE flavour only):
lib/netstandard2.0,lib/netstandard2.1,lib/net10.0,lib/net10.0-android36.0,lib/net10.0-ios26.0,lib/net10.0-windows10.0.19041(seenuget/README.md). Mac Catalyst is not a target. - HAL selection / build option (current mechanism):
net48selectsSource/HAL/btframework(WCL) automatically for that TFM inCSLibrary2026.csproj; the WinRT flavour for a WinForms build usesSource/HAL/WinFormsBLE(Windows Runtime GATT, no third-party dependency) but currently requires manually editingCSLibrary2026.csprojItemGroups (see BLE HAL selection / Building the WinForms flavours from source). A command-line build option/switch is not implemented yet. BLE HALs are mutually exclusive (each provides the sameHighLevelInterfacepartial members andCSLibrary.DeviceFinderAPI). - Not published to NuGet: the
net48(btframework) flavour setsIncludeBuildOutput=false/SuppressDependenciesWhenPacking=true; theWinFormsBLEflavour is not compiled into the default project/package and would require a separate package id to ship (MAUI Windows and WinForms on .NET 10 both resolvenet10.0-windows*). - USB / Serial Port: in design, not implemented yet. The embedded legacy engine stubs these transports (
Source/Legacy/CSLibrary.Comm/CodeFileCommUnsupported.cs); Windows-only reference implementation is inS:\Projects\GitHub\CSLibrary\CSLibrary. - Connect API signatures differ by HAL: e.g. Plugin.BLE
ConnectAsync(IAdapter, IDevice, READERPROTOCOL), btframeworkConnectAsync(object macAdd, READERPROTOCOL), WinFormsBLEConnectAsync(BluetoothLEDevice, READERPROTOCOL)—applications must follow the selected HAL/API. - Platform intent: prefer a single
CSLibrary2026.csprojto keep behavior consistent across existing UI/app variants; evaluate multi-targeting/conditions first and split project files only if required while sharingSource/where possible. ARM Linux support is planned (no Linux TFM inCSLibrary2026.csprojyet).
- Bluetooth LE (BLE) communication via Plugin.BLE
- TCP/IP connectivity for fixed readers (Windows desktop)
- Multi-reader support across CSL RFID readers
- Rich RFID operations: inventory, read/write, lock/kill, filtering
- Barcode scanning integration
- Battery & notification management
dotnet add package CSLibrary2026Or add to your .csproj:
<PackageReference Include="CSLibrary2026" Version="1.0.0-beta.1" />The unified search finds the readers of every requested interface and reports them in
the same shape. The protocol of the reader (NET_CSLEx10, NET_DIRECTRx000,
BT_CSLRx000, BT_CSLEx10) decides how the reader is connected.
using CSLibrary.NetFinder;
RFIDReaderFinder.OnReaderFound += (sender, e) =>
{
RFIDReaderInfo reader = e.Reader;
Console.WriteLine($"{reader.Protocol} {reader.DeviceName} {reader.IPAddress}");
};
// Every interface, or a selection:
// RFIDReaderFinder.SearchDevice(READERINTERFACE.NETWORK, READERINTERFACE.BLUETOOTH);
RFIDReaderFinder.SearchDevice();using CSLibrary;
using CSLibrary.NetFinder;
// Create the reader instance
var reader = new HighLevelInterface();
// Hand the BLE adapter of the platform over to the library
CSLibrary.DeviceFinder.Initialize(adapter, bluetoothLe);
// Discover BLE devices
CSLibrary.DeviceFinder.OnDeviceFound += (sender, device) =>
{
Console.WriteLine($"Found: {device.Name}");
};
CSLibrary.DeviceFinder.StartDeviceSearch();
// Connect to a BLE reader
await reader.ConnectAsync(adapter, device, READERPROTOCOL.BT_CSLRx000);using CSLibrary;
using CSLibrary.NetFinder;
// Create the reader instance
var reader = new HighLevelInterface();
// Connect via TCP/IP (CS203XL Network API)
await reader.ConnectAsync("192.168.1.100", READERPROTOCOL.NET_CSLEx10);// RFID tag inventory callback
reader.rfid.OnAsyncCallback += (sender, e) =>
{
if (e.type == Constants.CallbackType.TAG_RANGING)
{
Console.WriteLine($"EPC: {e.info.epc}");
}
};
// Reader state change callback
reader.OnReaderStateChanged += (sender, e) =>
{
Console.WriteLine($"State: {e.state}");
};// Set power level (0–3000 = 0–30.00 dBm)
reader.rfid.SetPowerLevel(3000);
// Start inventory
reader.rfid.StartOperation(RFIDReader.Operation.TAG_RANGING);
// Stop after some time
reader.rfid.StopOperation();| Method | Description |
|---|---|
ConnectAsync(IAdapter, IDevice, READERPROTOCOL) |
Connect to a BLE reader |
ConnectAsync(string ipAddress, READERPROTOCOL) |
Connect to a TCP/IP reader |
DisconnectAsync() |
Disconnect from the reader (BLE or TCP, decided internally) |
Migrating from the previous
CSLibrary/CSLibrary2026: this package is the unified API, so a few signatures differ from the older per-HAL implementations. The most common one isDisconnectAsync(), which used to beasync Task<bool>and is nowvoid(the transport is selected internally). Drop the discard when updating an existing app:-_ = reader.DisconnectAsync(); // previous CSLibrary2026 (Task<bool>) +reader.DisconnectAsync(); // CSLibrary2026 (unified API)Applications are expected to follow the library; if an app fails to compile, adjust the app rather than the library signature.
Start operations:
reader.rfid.StartOperation(Operation.TAG_RANGING); // Inventory
reader.rfid.StartOperation(Operation.TAG_READ); // Read tags
reader.rfid.StartOperation(Operation.TAG_READ_TID); // Read TID bank
reader.rfid.StartOperation(Operation.TAG_READ_USER); // Read USER bank
reader.rfid.StartOperation(Operation.TAG_WRITE); // Write tags
reader.rfid.StartOperation(Operation.TAG_LOCK); // Lock tag
reader.rfid.StartOperation(Operation.TAG_KILL); // Kill tag
reader.rfid.StopOperation(); // Stop continuous operationPower & Frequency:
reader.rfid.SetPowerLevel(uint pwrlevel); // Set power (0–3000)
reader.rfid.GetActiveMaxPowerLevel(); // Get max power
reader.rfid.SetCurrentLinkProfile(uint profile); // Set link profile
reader.rfid.SetCountry(string countryName); // Set country frequency
reader.rfid.SetCountry(string countryName, int ch);// Set country + fixed channelSingulation Algorithms:
reader.rfid.SetCurrentSingulationAlgorithm(SingulationAlgorithm.FIXEDQ);
reader.rfid.SetFixedQParms(FixedQParms parms);
reader.rfid.SetDynamicQParms(DynamicQParms parms);
reader.rfid.SetTagGroup(TagGroup tagGroup);
reader.rfid.SetPostMatchCriteria(SingulationCriterion[] criteria);Callback Events:
reader.rfid.OnAsyncCallback— Inventory / tag data (CallbackType.TAG_RANGING,TAG_SEARCHING)reader.rfid.OnAccessCompleted— Read/write/lock resultreader.OnReaderStateChanged— RFID reader state
reader.GetCurrentBatteryLevel(); // Get battery level
reader.ClearEventHandler(); // Clear all callback events
reader.notification.OnVoltageEvent += ... // Battery level changes
reader.notification.OnKeyEvent += ... // Hotkey pressesreader.barcode.OnCapturedNotify += (sender, e) => Console.WriteLine($"Barcode: {e.Barcode}");
reader.barcode.Start();
reader.barcode.Stop();Events:
OnCapturedNotify— Captured barcode dataOnStateChanged— Scanner state
The unified API splits the readers into protocol branches; StartOperation and the rest
of the API dispatch to the branch that matches the connected reader model:
| Branch | Readers | Protocol |
|---|---|---|
| RX000 | CS108, CS468 | CSL command set over Bluetooth LE (Source/RFIDReader/Comm_Protocol/RX000Commands/) |
| Ex10 | CS710S, CS203XL | CSL command set over Bluetooth LE / TCP/IP (Source/RFIDReader/Comm_Protocol/Ex10Commands/) |
| Legacy | CS463, CS203X, CS468, CS468INT, CS468X, CS468XJ | Impinj R1000/R2000 MAC register protocol over the Intel low level API (TCP port 1515) |
The Legacy branch is the original CSL reader library (the CSLibrary repository),
embedded in this assembly under Source/Legacy/ and reachable through the top level
CSLegacy.* namespaces (deliberately not CSLibrary.Legacy, so the unified types of the
same name are not shadowed). It is used as the protocol engine of the branch; the
unified API stays the only public surface and converts every type on the way in and out
(Source/RFIDReader/CSLUnifiedAPI/Legacy_API/).
Those readers do not speak the CSL command set, so they need their own socket: the legacy engine implements the Intel low level API itself. Connect to them with the protocol aware overload:
await reader.ConnectAsync("192.168.25.194", CSLibrary.NetFinder.READERPROTOCOL.NET_DIRECTRx000);The protocol selects the protocol implementation: NET_DIRECTRx000 drives the legacy
engine, which detects the reader model from its OEM information, and NET_CSLEx10
drives the CSL command set on the port 1525. The reader model is available through
reader.rfid.GetModel() once the reader has answered.
The readers of this family answer the discovery broadcast on UDP port 3040, while the
CS203XL answers on UDP port 3050. The unified reader search
(CSLibrary.NetFinder.RFIDReaderFinder) listens on both, so an app does not have to
know the broadcast of the reader family:
using CSLibrary.NetFinder;
RFIDReaderFinder.OnReaderFound += (sender, e) =>
{
RFIDReaderInfo reader = e.Reader;
Console.WriteLine($"{reader.Protocol} {reader.DeviceName} {reader.IPAddress}");
};
RFIDReaderFinder.SearchDevice(READERINTERFACE.NETWORK);See Documents/READER_DISCOVERY.md for the whole
search API.
Two helpers are available for the R1000/R2000 family (CS463 / CS203X / CS468):
RFIDReader.InventoryTest(uint milliseconds, out uint tagCount)- starts an inventory, waits for the given time and stops it again, and reports how many tags the reader returned. It is the quickest way to tell a reader problem apart from a library problem.CSLegacy.Diagnostics.LegacyTrace- an opt-in trace of every MAC register the legacy engine reads from or writes to the reader. The output goes toSystem.Diagnostics.Debug, so it appears in the "Output" window of Visual Studio while a debugger is attached (Debug > Windows > Output, source "Debug"). It is switched on automatically when a debugger is attached, or by the environment variableCSL_LEGACY_TRACE=1, or byCSLegacy.Diagnostics.LegacyTrace.Enabled = true. The other reader models do not use the MAC register protocol and are not traced.
While the reader is connected, the legacy engine also runs a short inventory test at each
step of the connect sequence and writes the result to the trace
([CSLegacy] INVTEST <step> -> result=OK tags=129). Those tests are meant to locate the
step that stops the reader from inventorying; they are off by default (they would add
about twelve seconds to every connect) and are switched on with
CSLegacy.HighLevelInterface.ConnectInventoryTestDuration = 1000;.
The application programming interface is documented in
Documents/API_Manual/. The manual is a static
site: open Documents/API_Manual/index.html in a browser, no web server is needed,
and the search works offline.
pwsh -File Documents/API_Manual/build-docs.ps1The script regenerates the API reference pages from the compiled library and its XML documentation, and rebuilds the search index. The guides are written by hand and are not touched by the build.
CSLibrary2026/
├── Source/
│ ├── CSLibrary.cs # Main library entry point
│ ├── Transport/ # Transport layer abstraction (ITransport, BLE/TCP)
│ ├── BluetoothProtocol/ # BLE protocol (send/receive/connect)
│ ├── HAL/
│ │ ├── Plugin.BLE/ # BLE backend (Plugin.BLE)
│ │ └── TCPIP/ # TCP/IP backend
│ ├── Legacy/ # Legacy CSL reader engine (CS463 / CS203X / CS468 branch)
│ ├── RFIDReader/
│ │ ├── Comm_Protocol/ # Low-level command protocols (Ex10Commands, RX000Commands)
│ │ └── CSLUnifiedAPI/ # Unified API and reader-specific implementations
│ │ └── Legacy_API/ # Bridge to the legacy engine (CS463 / CS203X / CS468)
│ │ └── Basic_API/
│ │ ├── CS108/ # CS108 / CS468 (Rx-family) implementation
│ │ └── CS710S/ # CS710S / CS203XL (Ex10-family) implementation
│ ├── BarcodeReader/ # Barcode scanning
│ ├── Battery/ # Battery management
│ ├── BluetoothIC/ # Bluetooth IC control
│ ├── Notification/ # System notifications
│ ├── SiliconLabIC/ # Silicon Lab IC support
│ ├── SystemInformation/ # Device/country/frequency information
│ └── Tools/ # Utilities
└── Documents/ # Hardware/protocol specs and internal notes
CSLibrary2026 uses a transport abstraction layer (ITransport) to support both Bluetooth LE and TCP/IP connections:
HighLevelInterface
├── rfid — RFID operations (inventory, read/write, lock/kill)
├── barcode — Barcode scanning
├── notification — Battery, key events
└── _transport — ITransport (BLETransport or TCPTransport)
ITransport
├── ConnectAsync() — Connect via BLE or TCP
├── SendAsync() — Send command data
├── Disconnect() — Close connection
└── SetReceiveCallback() — Handle incoming data
Reader discovery is unified: CSLibrary.NetFinder.RFIDReaderFinder searches the
selected interfaces (TCP/IP, Bluetooth LE, and later Serial and USB) and reports every
reader in the same shape, with the protocol of the reader
(CSLibrary.NetFinder.READERPROTOCOL). See
Documents/READER_DISCOVERY.md.
See Build flavours for the flavour/HAL matrix and notes. The BLE HALs are interchangeable but mutually exclusive: only one is compiled into a given binary because they define the same HighLevelInterface partial members and the same CSLibrary.DeviceFinder API. A command-line build option/switch is not implemented yet (see Building the WinForms flavours from source for the required CSLibrary2026.csproj ItemGroup changes).
Packaging facts: the published NuGet package contains the Plugin.BLE flavours only (lib/netstandard2.0, lib/netstandard2.1, lib/net10.0, lib/net10.0-android36.0, lib/net10.0-ios26.0, lib/net10.0-windows10.0.19041 for the Windows head of a MAUI app; see nuget/README.md). The net48 flavour is excluded from the package (IncludeBuildOutput=false and SuppressDependenciesWhenPacking=true for that target framework), so the package contains no lib/net48 folder and no .NETFramework4.8 dependency group. The WinFormsBLE flavour is not compiled into the default project/package.
The publishing assets live in nuget/:
# Build the package only
pwsh -File nuget/scripts/Publish-NuGet.ps1 -Version 2.0.0-beta.3 -SkipPush
# Build and push to NuGet.org
pwsh -File nuget/scripts/Publish-NuGet.ps1 -Version 2.0.0-beta.3 -ApiKey $env:NUGET_API_KEY./nuget/scripts/publish-nuget.sh 2.0.0-beta.3The GitHub Actions workflow .github/workflows/publish-nuget.yml
publishes automatically on a GitHub release: it packs the Linux and macOS target
frameworks in two jobs (Apple targets only build on macOS), merges them into one
package and pushes it to NuGet.org. It needs a NUGET_API_KEY repository secret.
Both WinForms flavours are used by downloading the source and switching the HAL in
CSLibrary2026.csproj, then rebuilding:
WinForms on .NET Framework 4.8 — btframework (already the default for net48):
<ItemGroup Condition=" '$(TargetFramework)' == 'net48' ">
<Compile Remove="Source/HAL/Plugin.BLE/**" />
<Compile Include="Source/HAL/btframework/**/*.cs" />
<Compile Remove="Source/Transport/BLETransport.cs" />
<!-- WCL references: Source\HAL\btframework\wclBluetoothFramework.dll, wclCommon.dll,
wclCommunication.dll -->
</ItemGroup>WinForms on .NET 10 — WinFormsBLE (Windows Runtime GATT, no third party dependency):
<ItemGroup Condition=" '$(TargetFramework)' == 'net10.0-windows10.0.19041.0' ">
<Compile Remove="Source/HAL/Plugin.BLE/**" />
<Compile Include="Source/HAL/WinFormsBLE/**/*.cs" />
<Compile Remove="Source/Transport/BLETransport.cs" />
</ItemGroup>Note that a MAUI application and a WinForms application on .NET 10 resolve to the same
net10.0-windows* target framework, so a single NuGet package cannot serve the
WinFormsBLE HAL to WinForms while serving Plugin.BLE to MAUI. WinForms on .NET 10
therefore builds the library from source.
MIT License. See LICENSE for details.
- GitHub Repository: https://github.com/cslrfid/CSLibrary2026
- NuGet Package: https://www.nuget.org/packages/CSLibrary2026