{"id":19535902,"url":"https://github.com/miyako/4d-plugin-scard-v2","last_synced_at":"2026-06-13T08:32:03.391Z","repository":{"id":147172451,"uuid":"270760614","full_name":"miyako/4d-plugin-scard-v2","owner":"miyako","description":"SCARD with LIBUSB, LIBNFC fallback on Mac","archived":false,"fork":false,"pushed_at":"2022-11-22T16:32:56.000Z","size":22152,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-08T17:57:02.069Z","etag":null,"topics":["4d-plugin","nfc","usb"],"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/miyako.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":"2020-06-08T17:25:52.000Z","updated_at":"2024-08-27T04:55:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"9712fb50-ed9e-4b3d-b591-074421aedec1","html_url":"https://github.com/miyako/4d-plugin-scard-v2","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miyako%2F4d-plugin-scard-v2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miyako%2F4d-plugin-scard-v2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miyako%2F4d-plugin-scard-v2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miyako%2F4d-plugin-scard-v2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/miyako","download_url":"https://codeload.github.com/miyako/4d-plugin-scard-v2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240788775,"owners_count":19857699,"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","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":["4d-plugin","nfc","usb"],"created_at":"2024-11-11T02:20:16.814Z","updated_at":"2026-06-13T08:31:58.351Z","avatar_url":"https://github.com/miyako.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"![version](https://img.shields.io/badge/version-19%2B-5682DF)\n![platform](https://img.shields.io/static/v1?label=platform\u0026message=mac-intel%20|%20mac-arm%20|%20win-64\u0026color=blue)\n[![license](https://img.shields.io/github/license/miyako/4d-plugin-scard-v2)](LICENSE)\n![downloads](https://img.shields.io/github/downloads/miyako/4d-plugin-scard-v2/total)\n\n# 4d-plugin-scard-v2\nSCARD with LIBUSB, LIBNFC fallback on Mac.\n\n## libnfc\n\n**Problem**: Some card readers do not have a driver for Mac. \n\n* [SONY \"PaSoRi\" RC-S330](https://www.sony.jp/cat/products/RC-S330/)\n\n**Solution**: Use [libnfc](https://github.com/nfc-tools/libnfc) as a fallback solution.\n\n### SONY chipsets and libnfc\n\nSONY specifications are often hard to find, only published in Japanese, or made available to corporate customers under an NDA. The developer of libnfc try to support the SONY chipset \"RC-S956\" (used by RC-S330, RC-S360, and RC-S370) which is similar to \"PN53x\" but not identical. \n\n* For the SONY chipset \"RC-S956\", the call succeeds once after the reader is connected to a Mac, but only that first time. After that, one must quit the application, disconnect the reader and try again. \n\n* For the SONY chipset \"NFC Port-100\" (used by RC-S380), there is no support as of ``libnfc-1.8.0`` (see below for alternative solution).\n\n* The patch for SONY \"RC-S956\" chipset\n\n  * Added a ``usleep(300000)`` during ``pn53x_init``. So it was a timing issue? Thats ``0.3`` seconds.\n\n  * [pn53x.c](https://github.com/miyako/4d-plugin-scard-v2/blob/master/SCARD-v2/patch/pn53x.c)\n  \n  * Without the fix, \"error\tlibnfc.driver.pn53x_usb\tApplication level error detected\" is thrown on second call\n\n* Example of libnfc call\n\n  * [FeliCa](https://github.com/miyako/4d-plugin-scard-v2/blob/master/SCARD-v2/test/Project/Sources/Methods/TEST_002_NFC_F.4dm)\n  * [Type B](https://github.com/miyako/4d-plugin-scard-v2/blob/master/SCARD-v2/test/Project/Sources/Methods/TEST_002_NFC_B.4dm)\n  * Sorry I have no Type A cards to test...\n  \n* For Windows, most vendors publish a native device driver so I don't see much need for a low-level driver like libnfc. But for research, it might be interesting to explore:\n\n  * [TDM-GCCでビルドするとうまくいった](https://hiro99ma.blogspot.com/2011/11/libnfctdm-gcc.html)\n  * [peacepenguin/libnfc-unofficialbuilds](https://github.com/peacepenguin/libnfc-unofficialbuilds)\n\n* Other opensource options for the SONY chipset:\n\n  * [Web Application Programming Wiki*](https://wikiwiki.jp/webapp/NFC#d78a7e65)\n  \n## libusb\n\n**Problem**: Some card readers do not have a driver for Mac and has no libnfc support.\n\n* [SONY \"PaSoRi\" RC-S380](https://www.sony.co.jp/Products/felica/consumer/products/RC-S380.html)\n\n**Solution**: Use [libusb](https://github.com/libusb/libusb) as a fallback solution.\n\n### SONY chipsets and libusb\n\n* The developers of [nfcpy](https://github.com/nfcpy/nfcpy) have done a good job at supporting these SONY chipsets. We can deduce SONY proprietary protocol from their code.\n\n* This developer credits nfcpy for helping find a way to support RC-S380 via libusb on Mac:\n\n  * [今更ですが、SONY RC-S380 で Suica の IDm を読み込んでみた](https://qiita.com/ysomei/items/32f366b61a7b631c4750)\n  * [getdeviceid.cpp](https://github.com/ysomei/test_getnfcid/blob/master/getdeviceid.cpp)\n\n* Example of libusb call\n\n  * [FeliCa](https://github.com/miyako/4d-plugin-scard-v2/blob/master/SCARD-v2/test/Project/Sources/Methods/TEST_002_USB_F.4dm)\n  * [Type B](https://github.com/miyako/4d-plugin-scard-v2/blob/master/SCARD-v2/test/Project/Sources/Methods/TEST_002_NFC_B.4dm)\n  * Type A requires [SAK anti-collision sequence](https://github.com/nfc-tools/libnfc/blob/master/examples/nfc-anticol.c); not implemented here...\n \n---\n\n### TODO\n\n* [Suica(IDm)で認証するのは危険なのでFelica Lite-Sの内部認証を使う](https://qiita.com/odetarou/items/bcd65dbfd1f68735ac30)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiyako%2F4d-plugin-scard-v2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiyako%2F4d-plugin-scard-v2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiyako%2F4d-plugin-scard-v2/lists"}