SendMessage php_serial_class:短信以空行开头,第二行以“>”开头符号

时间:2013-03-21 08:22:03

标签: php sms serial-port

我正在使用php_serial_class和php发送短信,其代码如下:

但收到的短信以空行开头,第二行以“>”开头符号,如:

  

     

'> Rel1 lock“

(符号'必须在本网站中删除才能正确理解)

include "php_serial.class.php";

$serial = new phpSerial;
$serial->deviceSet("/dev/ttyS2");
$serial->confBaudRate(9600);

// Then we need to open it
$serial->deviceOpen();

$serial->sendMessage("ATZ\n\r");
// Wait and read from the port
//$read = $serial -> readPort();

$serial->sendMessage("ATE0\n\r");
// Wait and read from the port
//$read = $serial -> readPort();

// To write into
$serial->sendMessage("AT+cmgf=1;+cnmi=2,1,0,1,0\n\r");//
$serial->sendMessage("AT+cmgs=\"+7912_____\"\n\r");
$serial->sendMessage("Rel1 lock\n\r");
$serial->sendMessage(chr(26));

//wait for modem to send message
sleep(7);
$read=$serial->readPort();

$serial->deviceClose();

0 个答案:

没有答案