<?php require("php_serial.class.php"); $serial = new phpSerial; // First we must specify the device. This works on both linux and windows (if // your linux serial device is /dev/ttyS0 for COM1, etc) $serial->deviceSet("COM13"); // We can change the baud rate, parity, length, stop bits, flow control $serial->confBaudRate(9600); $serial->confParity("none"); $serial->confCharacterLength(8); $serial->confStopBits(1); $serial->confFlowControl("none"); // Then we need to open it $serial->deviceOpen(); // To write into $serial->sendMessage("AT+CMGF=1\n\r"); $serial->sendMessage("AT+cmgs=\"+919428784012\"\n\r"); $serial->sendMessage("Hi, This is the sms that I sent to you using PHP script with serial Port communication with my phone as serial device!! GN - VKSALIAN \n\r"); $serial->sendMessage(chr(26)); //wait for modem to send message sleep(7); // Or to read from $read = $serial->readPort(); echo $read; // If you want to change the configuration, the device must be closed $serial->deviceClose(); ?>
Warning: Specified serial port is not valid in C:\Program Files\EasyPHP-DevServer-14.1VC9\data\localweb\laywer-new\php_serial.class.php on line 141 Warning: Unable to set the baud rate : the device is either not set or opened in C:\Program Files\EasyPHP-DevServer-14.1VC9\data\localweb\laywer-new\php_serial.class.php on line 234 Warning: Unable to set parity : the device is either not set or opened in C:\Program Files\EasyPHP-DevServer-14.1VC9\data\localweb\laywer-new\php_serial.class.php on line 288 Warning: Unable to set length of a character : the device is either not set or opened in C:\Program Files\EasyPHP-DevServer-14.1VC9\data\localweb\laywer-new\php_serial.class.php on line 336 Warning: Unable to set the length of a stop bit : the device is either not set or opened in C:\Program Files\EasyPHP-DevServer-14.1VC9\data\localweb\laywer-new\php_serial.class.php on line 377 Warning: Unable to set flow control mode : the device is either not set or opened in C:\Program Files\EasyPHP-DevServer-14.1VC9\data\localweb\laywer-new\php_serial.class.php on line 422 Warning: The device must be set before to be open in C:\Program Files\EasyPHP-DevServer-14.1VC9\data\localweb\laywer-new\php_serial.class.php on line 167 Warning: Device must be opened in C:\Program Files\EasyPHP-DevServer-14.1VC9\data\localweb\laywer-new\php_serial.class.php on line 608 Warning: Device must be opened in C:\Program Files\EasyPHP-DevServer-14.1VC9\data\localweb\laywer-new\php_serial.class.php on line 608 Warning: Device must be opened in C:\Program Files\EasyPHP-DevServer-14.1VC9\data\localweb\laywer-new\php_serial.class.php on line 608 Warning: Device must be opened in C:\Program Files\EasyPHP-DevServer-14.1VC9\data\localweb\laywer-new\php_serial.class.php on line 608 Warning: Device must be opened to read it in C:\Program Files\EasyPHP-DevServer-14.1VC9\data\localweb\laywer-new\php_serial.class.php on line 522
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)