{"id":22126531,"url":"https://github.com/amarok79/inlaytester.drivers.feigreader","last_synced_at":"2025-08-08T02:18:20.226Z","repository":{"id":144172297,"uuid":"134413690","full_name":"Amarok79/InlayTester.Drivers.FeigReader","owner":"Amarok79","description":"A library with a serial driver for communication with RFID readers/modules from FEIG Electronic. Part of Inlay Tester software application.","archived":false,"fork":false,"pushed_at":"2024-12-06T18:08:32.000Z","size":4442,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-01T04:54:43.126Z","etag":null,"topics":["dotnet","feig","rfid"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Amarok79.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-22T12:44:45.000Z","updated_at":"2024-11-28T19:06:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"3c716dbd-4a91-4ba9-b086-b71ace051ef3","html_url":"https://github.com/Amarok79/InlayTester.Drivers.FeigReader","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/Amarok79/InlayTester.Drivers.FeigReader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Amarok79%2FInlayTester.Drivers.FeigReader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Amarok79%2FInlayTester.Drivers.FeigReader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Amarok79%2FInlayTester.Drivers.FeigReader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Amarok79%2FInlayTester.Drivers.FeigReader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Amarok79","download_url":"https://codeload.github.com/Amarok79/InlayTester.Drivers.FeigReader/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Amarok79%2FInlayTester.Drivers.FeigReader/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269351973,"owners_count":24402693,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-08T02:00:09.200Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dotnet","feig","rfid"],"created_at":"2024-12-01T16:58:47.998Z","updated_at":"2025-08-08T02:18:20.199Z","avatar_url":"https://github.com/Amarok79.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"![CI](https://github.com/Amarok79/InlayTester.Drivers.FeigReader/workflows/CI/badge.svg)\n[![NuGet](https://img.shields.io/nuget/v/InlayTester.Drivers.FeigReader.svg?logo=)](https://www.nuget.org/packages/InlayTester.Drivers.FeigReader/)\n\n# Introduction\n\nThis library is available as NuGet package:\n[InlayTester.Drivers.FeigReader](https://www.nuget.org/packages/InlayTester.Drivers.FeigReader/)\n\nThe package provides strong-named binaries for .NET Standard 2.0, .NET 6.0, and .NET 7.0. Tests are performed with .NET\nFramework 4.8, .NET 6.0, .NET 7.0, and .NET 8.0.\n\nFor development, you need *Visual Studio 2022*. For running the tests, you need to\ninstall [com0com](https://sourceforge.net/projects/com0com/) and set up a serial port pair with names \"COMA\" and \"COMB\".\nThis virtual serial port pair is used throughout unit tests.\n\nThe library uses [Amarok79/InlayTester.Shared.Transports](https://github.com/Amarok79/InlayTester.Shared.Transports)\nunder the hood, which again depends on the excellent [jcurl/SerialPortStream](https://github.com/jcurl/SerialPortStream)\nfor serial communication.\n\n# Supported Feig RFID Reader/Modules\n\nIn general, all Feig RFID reader/modules are supported that run Feig `s standard or advanced protocol.\n\nSpecifically, following readers/modules have been extensively tested:\n\n- CPR40.xx\n- CPR74.xx\n- ISC.M02\n\n# Supported RFID Transponders\n\nThe provided `Inventory()` API supports following transponders:\n\n- ISO14443A\n- ISO14443B\n- ISO15693\n- ISO18000-3M3\n- Jewel\n- I-Code1\n- I-CodeEPC\n- I-CodeUID\n- SR176\n- SRIxx\n- EPC Class1 Gen2\n- Innovatron\n- FeliCa\n\n# Documentation\n\n### Create, Open, Close\n\nTo communicate with a Feig RFID reader/module connected via RS232, you first have to instantiate a **IFeigReader**. This\nis done via factory method **FeigReader.Create(..)**, which requires an instance of **FeigReaderSettings**.\n\n````cs\n    var settings = new FeigReaderSettings {\n        TransportSettings = new SerialTransportSettings {\n                PortName = \"COM4\",\n                Baud = 38400,\n                DataBits = 8,\n                Parity = Parity.Even,\n                StopBits = StopBits.One,\n                Handshake = Handshake.None,\n        },\n        Address = 255,\n        Protocol = FeigProtocol.Advanced,\n        Timeout = TimeSpan.FromMilliseconds(500),\n    };\n\n    using (IFeigReader reader = FeigReader.Create(settings))\n    {\n        // ...\n    }\n````\n\nThe settings are used to provide configuration about serial communication (**SerialTransportSettings**) to the reader,\nbut also to provide Feig-specific global settings like **Address**, **Protocol** and **Timeout**.\n\nSo far, we only configured and created an instance of our reader in code. The specified serial port hasn't been opened\nyet. To open communication you have to call **Open()** on the reader. If necessary, you can **Close()** and re-open the\ncommunication transport multiple times on the same **IFeigReader** instance.\n\n````cs\n    using (IFeigReader reader = FeigReader.Create(settings))\n    {\n        reader.Open();      // now serial port is open\n        reader.Close();     // serial port is closed again\n        reader.Open();      // it's possible to open/close it multiple times\n    }\n````\n\nDon't forget to dispose the **IFeigReader** at the end.\n\n### Transfer\n\nNow, to communicate with the reader/module, we perform a transfer operation, which sends a request to the reader and\nthen waits for a response.\n\n````cs\n    var request = new FeigRequest {\n        Address = 0xFF,\n        Command = FeigCommand.CPUReset,\n        Data = BufferSpan.Empty,\n    };\n\n    FeigTransferResult result = await reader.Transfer(request)\n        .ConfigureAwait(false);\n````\n\nHere we first instantiate a **FeigRequest** and then call the async **Transfer(..)**. The method overload uses\n*protocol* and *timeout* from global settings supplied earlier during reader construction. To override global settings\nfor this single transfer operation only, you can provide them as additional arguments. You can even provide a\ncancellation token to cancel the transfer operation at any time.\n\n````cs\n    FeigTransferResult result = await reader.Transfer(\n            request, FeigProtocol.Standard, TimeSpan.FromMilliseconds(1000), cancellationToken)\n        .ConfigureAwait(false);\n````\n\nNow, **Transfer(..)** never throws exceptions for timeout, cancellation or errors. Instead, it returns a specific result\nobject that contains detailed information about the transfer operation. You can use it to determine whether the transfer\noperation succeeded as shown in the following code snippet.\n\n````cs\n    if (result.Status == FeigTransferStatus.Canceled)\n    {\n        // canceled; someone signals the cancellation token\n    }\n    else\n    if (result.Status == FeigTransferStatus.Timeout)\n    {\n        // timeout, no response received\n    }\n    else\n    if (result.Status == FeigTransferStatus.ChecksumError)\n    {\n        // corrupted response received; communication error\n    }\n    else\n    if (result.Status == FeigTransferStatus.Success)\n    {\n        if (result.Response.Status != FeigStatus.OK)\n        {\n            // received response, but reader returned error\n        }\n        else\n        {\n            // received response; interpret data\n            Console.WriteLine(result.Response.Data);\n        }\n    }\n````\n\nError handling seems a bit tedious. But, you won't need to do it yourself. **Transfer(..)** represents a low-level\nmethod that gives you full control over transfer operations. In general, you will use other high-level methods better\nsuited for most cases. It's just that you know you can do it that way.\n\n### Execute\n\n**Execute(..)** is one of those higher-level methods that does this result-code checking for you, and that throws\nappropriate exceptions in certain error situations. On success, the method returns the received response.\n\n````cs\n    var request = new FeigRequest {\n        Address = 0xFF,\n        Command = FeigCommand.CPUReset,\n        Data = BufferSpan.Empty,\n    };\n\n    var response = await reader.Execute(request)\n        .ConfigureAwait(false);\n\n    var data = response.Data;\n````\n\nIn case of timeout, a **TimeoutException** is thrown. In case of cancellation an **OperationCanceledException**.\nOtherwise, if a communication error occurred or the reader/module returned an error code, an exception of type *\n*FeigException** is thrown. In all other cases, the received **FeigResponse** is returned.\n\nRegarding the previous code snippet. There exists another overload that allows you to write this in a much shorter way.\n\n````cs\n    var response = await reader.Execute(FeigCommand.CPUReset)\n        .ConfigureAwait(false);\n````\n\nThis overload constructs the necessary **FeigRequest** internally.\n\n### Common Commands\n\nMost Feig RFID reader/modules support a set of common commands. These commands are already implemented and exposed as\nmethods on the **IFeigReader** interface.\n\nFollowing commands are supported out-of-the-box:\n\n| Feig Command                     | Method on IFeigReader                         |\n|----------------------------------|-----------------------------------------------|\n| 0x52  Baud Rate Detection        | TestCommunication()                           |\n| 0x63  CPU Reset                  | ResetCPU()                                    |\n| 0x65  Get Software Version       | GetSoftwareInfo()                             |\n| 0x69  RF Reset                   | ResetRF()                                     |\n| 0x80  Read Configuration         | ReadConfiguration(..)                         |\n| 0x81  Write Configuration        | WriteConfiguration(..)                        |\n| 0x82  Save Configuration         | SaveConfigurations(), SaveConfiguration(..)   |\n| 0x83  Set Default Configuration  | ResetConfigurations(), ResetConfiguration(..) |\n| 0x0B 0x01 Inventory ISO Standard | Inventory()                                   |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famarok79%2Finlaytester.drivers.feigreader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famarok79%2Finlaytester.drivers.feigreader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famarok79%2Finlaytester.drivers.feigreader/lists"}