(udp, term)
¶(udp, readterm, writeterm)
¶Set terminator for ASCII string manipulation
udp - udpport object
term - terminal value for both read and write
readterm = terminal value type for read data
writeterm = terminal value for written data
The terminal can be either strings "cr", "lf" (default), "lf/cr" or an integer between 0 to 255.
None
See also: udpport.
data =
flush (dev)
¶data =
flush (dev, "input")
¶data =
flush (dev, "output")
¶Flush the udpport socket buffers
dev - open udpport device
If an additional parameter is provided of "input" or "output", then only the input or output buffer will be flushed
None
See also: udpport.
numbytes =
fprintf (obj, template ...)
¶Writes formatted string template using optional parameters to UDP instrument
obj is a UDPPort object.
template Format template string.
numbytes is the number of bytes written to the device
data =
fread (obj)
¶data =
fread (obj, size)
¶data =
fread (obj, size, precision)
¶[data,count] =
fread (obj, ...)
¶[data,count,errmsg] =
fread (obj, ...)
¶Reads data from UDP instrument
obj is a UDP port object.
size Number of values to read. (Default: 100).
precision precision of data.
data data values.
count number of values read.
errmsg read operation error message.
struct =
get (udpport)
¶field =
get (udpport, property)
¶Get the properties of udpport object.
udpport - instance of octave_udpport class.
property - name of property.
When property was specified, return the value of that property.
otherwise return the values of all properties as a structure.
See also: @octave_udpport/set.
set
(obj, property,value)
¶set
(obj, property,value,…)
¶Set the properties of udpport object.
obj - instance of octave_udpport class.
property - name of property.
If property is a cell so must be value, it sets the values of all matching properties.
The function also accepts property-value pairs.
Set the name for the udpport socket.
Set the user data of the object.
Set the timeout value in seconds. Value of -1 means a blocking call.
None
See also: @octave_udpport/get.
numbytes =
write (obj, data)
¶numbytes =
write (obj, data, destinationAddress, destinationPort))
¶numbytes =
write (obj, data, datatype)
¶numbytes =
write (obj, data, datatype, destinationAddress, destinationPort)
¶Writes data to UDP instrument
obj is a UDPPort object.
data data to write.
datatype datatype of data. If not specified defaults to uint8.
destinationAddress ipaddress to send to. If not specified, use the previously used remote address.
destinationPort port to send to. If not specified, use the remote port.
returns number of bytes written.
(dev, data)
¶(dev, data, destaddr, destport)
¶Write data to a udpport including terminator value
dev - connected device
data - ASCII data to write
destaddr - Destination address
destport - Destination port
Where the address and port is not specified, the previously used address and port is used.
None
See also: flushoutput.
udp =
udpport ()
¶udp =
udpport (propertyname, propertyvalue ...)
¶Open udpport interface.
propertyname, propertyvalue - property name/value pair
Known input properties:
name assigned to the udp object
local port number
local host address
timeout value in seconds used for waiting for data
Boolean if the socket has port sharing enabled (readonly)
The udpport() shall return instance of octave_udp class as the result udp.
The udp object has the following public properties:
name assigned to the udp object
instrument type ’udpport’ (readonly)
local port number (readonly)
local host address (readonly)
status of the object ’open’ or ’closed’ (readonly)
timeout value in seconds used for waiting for data
number of bytes currently available to read (readonly)
multicast group socket is subscribed to (readonly)
Boolean if the socket has any multicast group it is subscribed to (readonly)
Boolean if the socket has port sharing enabled (readonly)
Terminator value used for string data (currently not used)