InOut的条形码/RFID接口
inout-scan的Python项目详细描述
输入扫描
从串行端口读取条形码的命令deamon 将它们转发给API。在
Usage: inout_scan [OPTIONS] COMMAND [ARGS]...
Gather bar codes from a scanner connected to the serial port and pass them
to the InOut API. A local cache is maintained to be able to handle
communication problems. Use the flush command to communicate unsubmitted
bar codes.
Options:
--version Show the version and exit.
--help Show this message and exit.
Commands:
flush Flush unsubmitted data to the api
scan Listen for strings from a barcode scanner connected to the...
扫描
^{pr2}$冲洗
Usage: inout_scan flush [OPTIONS]
Flush unsubmitted data to the api
Options:
--api_url TEXT InOut API url. [required]
--api_key TEXT InOut API key.
--help Show this message and exit.
不使用条形码扫描仪进行测试
要在未连接条形码的情况下测试软件,请使用虚拟
条形码扫描仪。这可以通过使用socat
来完成:
$ socat -d -d PTY PTY 2020/05/15 10:44:48 socat[47219] N PTY is /dev/pts/32020/05/15 10:44:48 socat[47219] N PTY is /dev/pts/42020/05/15 10:44:48 socat[47219] N starting data transfer loop with FDs [5,5] and [7,7]
它将输出伪终端名称。让它继续运行。在
在另一个终端中,运行inout_scan
:
$ inout_scan scan --serial_port /dev/pts/4 --api_url 'https://inout.example.com' --scanner fake_scanner
现在,将字符串发送到隧道的另一端/dev/pts/3
,即:
$ seq 11000|whileread nr;doecho"mybadge$nr" > /dev/pts/3; sleep 1;done
历史
0.1.0(2020-05-13)
- PyPI的第一个版本。在
- 项目
标签: