This commit is contained in:
2025-11-21 14:55:52 +08:00
parent e3ecd0550f
commit 26ed8df502
36 changed files with 908 additions and 433 deletions

View File

@ -19,7 +19,7 @@ def test_rfid_functions():
测试RFIDHardware的主要功能
"""
# 初始化RFID控制器
rfid = rfid_service(host='192.168.1.190', port=6000)
rfid = rfid_service(host='192.168.250.67', port=6000)
# print("=== RFID硬件测试开始 ===")
@ -41,6 +41,12 @@ def test_rfid_functions():
# rfid.set_working_mode(address=0x00, mode_params={
# 'word_num': 0x1E
# })
# mode_data = rfid.read_working_mode(address=0x00)
# if mode_data:
# print("读取到工作模式参数:")
# for key, value in mode_data.items():
# print(f" {key}: {value:02X} ({value})")
# # 测试读取读写器信息
# print("\n3. 测试读取读写器信息:")
@ -54,7 +60,7 @@ def test_rfid_functions():
# 测试设置功率 (仅演示,实际使用时根据需要调整)
# print("\n3. 测试设置功率 (演示,不实际执行):")
# power_success = rfid.set_power(address=0x00, power_value=6)
# power_success = rfid.set_power(address=0x00, power_value=16)
# print(f"功率设置{'成功' if power_success else '失败'}")
# # 测试设置读卡间隔 (仅演示)
@ -87,7 +93,7 @@ def test_rfid_functions():
# rfid._process_collected_data()
rfid.start_receiver(callback=test_data_callback)
# print("接收线程已启动,等待接收数据...")
# 等待5秒模拟接收过程
# 等待5秒模拟接收过程1111111111111
time.sleep(60*60)
finally:
# 确保停止接收线程