Serial Framework C++ Edition

◆ OnConnect()

__event void OnConnect ( void *  Sender,
const int  Error 
)

The event fires when a connection to a remote device has been completed (with or without success).

Parameters
SenderThe object that initiated the event.
ErrorThe disconnection code. If the parameter is WCL_E_SUCCESS the connection was closed by the Disconnect call. Otherwise indicates the disconnection reason.

If the Error parameter of the event is not WCL_E_SUCCESS an application may call Connect method again from inside the event handler.