Public Member Functions | |
phpSerial () | |
deviceSet ($device) | |
deviceOpen ($mode="r+b") | |
deviceClose () | |
confBaudRate ($rate) | |
confParity ($parity) | |
confCharacterLength ($int) | |
confStopBits ($length) | |
confFlowControl ($mode) | |
setSetserialFlag ($param, $arg="") | |
sendMessage ($str, $waitForReply=0.1) | |
readPort ($count=0) | |
serialflush () | |
_ckOpened () | |
_ckClosed () | |
_exec ($cmd, &$out=null) | |
Data Fields | |
$_device = null | |
$_windevice = null | |
$_dHandle = null | |
$_dState = SERIAL_DEVICE_NOTSET | |
$_buffer = "" | |
$_os = "" | |
$autoflush = true | |
Serial port control class
THIS PROGRAM COMES WITH ABSOLUTELY NO WARANTIES ! USE IT AT YOUR OWN RISKS !
Changes added by Rizwan Kassim rizwa for OSX functionality default serial device for osx devices is /dev/tty.serial for machines with a built in serial device nk@g eekym edia .com
Definition at line 41 of file BayEOSSerialPHP.php.
_ckClosed | ( | ) |
Definition at line 636 of file BayEOSSerialPHP.php.
_ckOpened | ( | ) |
Definition at line 625 of file BayEOSSerialPHP.php.
_exec | ( | $cmd, | |
& | $out = null |
||
) |
Definition at line 647 of file BayEOSSerialPHP.php.
confBaudRate | ( | $rate | ) |
Configure the Baud Rate Possible rates : 110, 150, 300, 600, 1200, 2400, 4800, 9600, 38400, 57600 and 115200. Note there was a paramter added from original class.
int | $rate | the rate to set the port in |
Definition at line 250 of file BayEOSSerialPHP.php.
confCharacterLength | ( | $int | ) |
Sets the length of a character.
int | $int | length of a character (5 <= length <= 8) |
Definition at line 354 of file BayEOSSerialPHP.php.
confFlowControl | ( | $mode | ) |
Configures the flow control
string | $mode | Set the flow control mode. Availible modes : -> "none" : no flow control -> "rts/cts" : use RTS/CTS handshaking -> "xon/xoff" : use XON/XOFF protocol |
Definition at line 440 of file BayEOSSerialPHP.php.
confParity | ( | $parity | ) |
Configure parity. Modes : odd, even, none
string | $parity | one of the modes |
Definition at line 306 of file BayEOSSerialPHP.php.
confStopBits | ( | $length | ) |
Sets the length of stop bits.
float | $length | the length of a stop bit. It must be either 1, 1.5 or 2. 1.5 is not supported under linux and on some computers. |
Definition at line 395 of file BayEOSSerialPHP.php.
deviceClose | ( | ) |
deviceOpen | ( | $mode = "r+b" | ) |
Opens the device for reading and/or writing.
string | $mode | Opening mode : same parameter as fopen() |
Definition at line 177 of file BayEOSSerialPHP.php.
deviceSet | ( | $device | ) |
Device set function : used to set the device name/address. -> linux : use the device address, like /dev/ttyS0 -> osx : use the device address, like /dev/tty.serial -> windows : use the COMxx device name, like COM1 (can also be used with linux)
string | $device | the name of the device to be used |
Definition at line 123 of file BayEOSSerialPHP.php.
phpSerial | ( | ) |
Constructor. Perform some checks about the OS and setserial
Definition at line 62 of file BayEOSSerialPHP.php.
readPort | ( | $count = 0 | ) |
Reads the port until no new datas are availible, then return the content.
int | $count | number of characters to be read (will stop before if less characters are in the buffer) |
Definition at line 540 of file BayEOSSerialPHP.php.
sendMessage | ( | $str, | |
$waitForReply = 0.1 |
|||
) |
Sends a string to the device
string | $str | string to be sent to the device |
float | $waitForReply | time to wait for the reply (in seconds) |
Definition at line 524 of file BayEOSSerialPHP.php.
serialflush | ( | ) |
Flushes the output buffer Renamed from flush for osx compat. issues
Definition at line 600 of file BayEOSSerialPHP.php.
setSetserialFlag | ( | $param, | |
$arg = "" |
|||
) |
Sets a setserial parameter (cf man setserial) NO MORE USEFUL ! -> No longer supported -> Only use it if you need it
string | $param | parameter name |
string | $arg | parameter value |
Definition at line 488 of file BayEOSSerialPHP.php.
$_buffer = "" |
Definition at line 47 of file BayEOSSerialPHP.php.
$_device = null |
Definition at line 43 of file BayEOSSerialPHP.php.
$_dHandle = null |
Definition at line 45 of file BayEOSSerialPHP.php.
$_dState = SERIAL_DEVICE_NOTSET |
Definition at line 46 of file BayEOSSerialPHP.php.
$_os = "" |
Definition at line 48 of file BayEOSSerialPHP.php.
$_windevice = null |
Definition at line 44 of file BayEOSSerialPHP.php.
$autoflush = true |
Definition at line 55 of file BayEOSSerialPHP.php.