开发者

Open com port in php

开发者 https://www.devze.com 2023-03-04 13:23 出处:网络
I have 开发者_JAVA百科a usb 3G modem Huawei E1550 and Windows XP. I want to send sms with this modem trhow php.

I have 开发者_JAVA百科a usb 3G modem Huawei E1550 and Windows XP. I want to send sms with this modem trhow php.

I use this function to open a modem com port:

$fp = fopen ("COM3:", "wb+");
if (!$fp) {
    echo "Not open";
} else {
    echo "Open";
}

And every time I get a error:

Warning: fopen(COM3:) [function.fopen]: failed to open stream: Invalid argument in D:\Apache\htdocs\z91.ru\audio\test.php on line 3


You can also try removing the colon next to the COMn for this to work

exec("mode COM3 BAUD=9600 PARITY=N data=8 stop=1 xon=off");

$fp = fopen ("COM3", "w");
if (!$fp) {
   echo "Not open";
} else {
   echo "Open";
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号