Skip to content
Snippets Groups Projects
Commit 879220a1 authored by Tim Stadtmann's avatar Tim Stadtmann
Browse files

Fix issue #48

parent c392fc8d
No related branches found
No related tags found
No related merge requests found
......@@ -170,7 +170,8 @@ classdef EV3 < MaskedHandle
if ev3.isConnected
if isCommInterfaceValid(ev3.commInterface)
error('EV3::connect: Already connected.');
warning('EV3::connect: Already connected. Resetting connection now...');
ev3.disconnect();
else
warning(['EV3::connect: EV3.isConnected is set to ''True'', but ',...
'comm handle is invalid. Deleting invalid handle and ' ,...
......@@ -242,7 +243,15 @@ classdef EV3 < MaskedHandle
% % do stuff |br|
% b.disconnect(); % |br|
% Resetting needs a working connection in order to send reset-commands
% to the Brick. If the connection has been aborted (e.g. by pulling the
% USB-cord), the reset-methods would fail -> catch this error and for
% now do nothing.
try
ev3.resetPhysicalBrick();
catch ME
% For now: ignore
end
% Disconnect motors and sensors
% -> set references to comm handle to 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment