User Tools

Site Tools


uphp:functions:f485open

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
uphp:functions:f485open [2017/04/04 13:10]
jeff
uphp:functions:f485open [2021/09/13 05:57] (current)
Line 7: Line 7:
 ====Description==== ====Description====
  
-<well size="sm"><html><span style="font-size:125%;color:green">int +<well size="sm"><html> 
-<span style="color:black"></html>[[f485open]] +<span style="font-size:125%;color:green">int 
-<html>(+<span style="color:black">f485open (
 <span style="color:green">int <span style="color:green">int
 <span style="color:blue">$baud<span style="color:black">, <span style="color:blue">$baud<span style="color:black">,
Line 27: Line 27:
 <html><b><span style="color:blue">$parity<span style="color:black"></b></html>:  0 (even parity) or 1 (odd parity) <html><b><span style="color:blue">$parity<span style="color:black"></b></html>:  0 (even parity) or 1 (odd parity)
  
-====Return Value====+====Return Values====
  
-Upon success it returns a file handle which may be used together with the other file functions that require a handle such as [[fgets()]][[fwrite()]], [[fclose()]] and [[feof()]] +<html><b><span style="color:green">Integer<span style="color:black"></b></html>:  File handle, or 0 if the attempt to open the RS-485 port fails
- +
-If the attempt to open the RS-485 port fails it will return 0+
  
 +The file handle may be used together with the other file functions that require a handle such as [[fgets()]], [[fwrite()]], [[fclose()]] and [[feof()]]
  
 ====Example==== ====Example====
  
-**Open the 485 port at 115200 baud with even parity:**+===Open the 485 port at 115200 baud with even parity===
  
 <code php> <code php>
Line 56: Line 55:
  
 [[how_tos:Serial Port Programming]] - Some information on connecting and using the serial ports [[how_tos:Serial Port Programming]] - Some information on connecting and using the serial ports
 +
 +[[fopen()]] - Open a file for reading or writing
  
 [[fseropen()]] - Open the serial port at the specified baud rate with optional parameters [[fseropen()]] - Open the serial port at the specified baud rate with optional parameters
Line 61: Line 62:
 [[fsockopen()]] - Open an internet socket connection with optional timeout [[fsockopen()]] - Open an internet socket connection with optional timeout
  
-[[fopen()]] - Open a file for reading or writing+[[fread()]] - Read bytes from a file, stream or socket
  
-[[fclose()]] - Close a file, stream or socket+[[fgets()]] - Return a single line from a file, stream or socket, with optional size limit
  
-[[feof()]] - Test if no more data is available in a file or stream+[[fwrite()]] - Write data to a filestream or socket
  
-[[fgets()]] - Return a single line from a file or stream, with optional size limit+[[feof()]] - Test if no more data is available in a file, stream or socket
  
-[[fread()]] - Return bytes from a file or stream+[[filesize()]] - Return the size of a fileor the number of unread bytes in a stream or socket
  
-[[fwrite()]] - Write data to a file or stream+[[fseek()]] - Position the file pointer in an open file 
 + 
 +[[ftell()]] - Return the current position of a file read/write pointer 
 + 
 +[[fclose()]] - Close a file, stream or socket
  
uphp/functions/f485open.1491311452.txt.gz · Last modified: 2021/09/13 05:56 (external edit)