Edit on GitHub

API Reference

Matlab

Matlab PortHandler

   
portHandle Initializes parameters for serial port control
openPort Opens a serial port
closePort Closes a serial port
clearPort Refreshes a serial port
setPortName Sets a device name
getPortName Gets a device name
setBaudrate Sets a baudrate
getBaudrate Gets a baudrate
getBytesAvailable Checks how many bytes can be read in port buffer
readPort Reads bytes from port buffer
writePort Writes bytes to port buffer
setPacketTimeout Sets timeout
isPacketTimeout Checks whether communication has been succeeded in timeout

Method References


portHandler
   
port_name Port name
openPort
   
port_num Port number
closePort
   
port_num Port number
clearPort
   
port_num Port number
setPortName
   
port_num Port number
port_name Port name
getPortName
   
port_num Port number
setBaudrate
bool setBaudrate(int port_num, int baudrate)
   
port_num Port number
baudrate Target baudrate
getBaudrate
int getBaudrate(int port_num)
   
port_num Port number
getBytesAvailable
int getBytesAvailable(int port_num)
   
port_num Port number
readPort
int readPort(int port_num, int[] packet, int length)
   
port_num Port number
packet The number of data bytes read previously
length Byte length for read
writePort
int writePort(int port_num, int[] packet, int length)
   
port_num Port number
packet The number of data bytes to write
length Byte length for write
setPacketTimeout
void setPacketTimeout (int port_num, uint16_t packet_length)
   
port_num Port number
Packet_length Target byte length for write
setPacketTimeoutMSec
void setPacketTimeoutMSec (int port_num, double msec)
   
port_num Port number
msec Miliseconds
isPacketTimeout
bool isPacketTimeout(int port_num)
   
port_num Port number