You're reading the documentation for an older, but still supported version (GL013300).
For information on the latest version, please have a look at GL013301.

set_on_disconnected

This is a function for registering the callback function that automatically checks if the connection with the robot controller has been terminated by external force or user. It is useful when functions that should be executed automatically are made.

Definition
DRFLEx.h within class CDRFLEx, public section (line 655)

void set_on_disconnected(TOnDisconnectedCB pCallbackFunc) {
    _set_on_disconnected(_rbtCtrl, pCallbackFunc);
};

Parameter

Parameter Name

Data Type

Default Value

Description

pCallbackFunc

TOnDisconnectedCB

Refer to definition of callback function

Return
None

Example

void OnDisconnectedCB()
{
    // Needs the reconnection of the robot controller and error handling
}

int main()
{
    drfl.set_on_disconnected(OnDisconnectedCB);
}

When registered, this callback function executes automatically when the connection between the robot controller and the client is lost. It allows the user to implement reconnection logic or error recovery procedures for stable operation in external environments.