我尝试使用 php_serial.class.php 将 NV200 智能支付设备连接到我的 php 项目,但出现此错误:
指定的串口在第 145 行的 D:\xampp-7\htdocs\testsocket\php_serial.class.php 中无效
我正在使用 Windows 7 并检查到设备管理器,设备连接到 COM3。这是我的代码:
include "php_serial.class.php";
$serial = new PhpSerial;
$serial->deviceSet("COM3");
$serial->confBaudRate(2400);
$serial->confParity("none");
$serial->confCharacterLength(8);
$serial->confStopBits(1);
$serial->confFlowControl("none");
$serial->deviceOpen();
$serial->sendMessage("Hello !");
出了什么问题?连接串口的正确方法是什么?请帮忙。