flange_serial_close
This is a function for closing the flange serial transfer port in the robot controller.
Definition
DRFLEx.h within class CDRFLEx, public section (line 877)
bool flange_serial_close(int nPort)
{
return _flange_serial_close(_rbtCtrl, nPort);
};
Parameter
Parameter Name |
Data Type |
Default Value |
Description |
|---|---|---|---|
nPort |
int |
Serial port index |
Return
Value |
Description |
|---|---|
0 |
Error: failed to close serial port. |
1 |
Success: serial port successfully closed. |
Example
Drfl.flange_serial_open(115200, 0);
Drfl.flange_serial_write(0, "test123");
LPFLANGE_SER_RXD_INFO temp = Drfl.flange_serial_read(4, 5);
cout << "Serial read : " << temp->_pRxd << endl;
cout << "Serial cnt : " << (int)temp->_iSize << endl;
Drfl.flange_serial_close(0);
This example first opens the flange serial port, sends test data, reads incoming data using flange_serial_read(), and finally closes the connection using flange_serial_close() to safely release the port resource.