public Connect ( string portName ) : bool | ||
portName | string | Serial port name to use for communication, for example COM1. |
return | bool |
public bool Connect( string portName )
{
lock ( sync )
{
if ( communicationInterface != null )
return true;
// create communication interface,
communicationInterface = new SerialCommunication( portName );
// connect and check if NXT is alive
if ( ( communicationInterface.Connect( ) ) && ( IsAlive( ) ) )
return true;
Disconnect( );
}
return false;
}