fseropen

(FW >= 1.0)

fseropen - Open the serial port

Description

int fseropen(int $baud, int $blocking)

This will open the serial port at the specified baud rate

Parameters

baud

baud rate in bits per second

blocking

If blocking is set to 1, read operations will block until data is available

Return Value

handle of serial port for use with other file operations

Examples

<? 
$fp = fseropen(115200,0);
if (!$fp) {
    print("Serial open failed\n");
} else {
$res = fwrite($fp,"Hello from wattmon");
if ($res) {
print("An error occured while trying to write to the port");
} fclose($fp); } ?>