Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ev3-toolbox-matlab
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Container registry
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mindstorms
ev3-toolbox-matlab
Commits
879220a1
Commit
879220a1
authored
8 years ago
by
Tim Stadtmann
Browse files
Options
Downloads
Patches
Plain Diff
Fix issue #48
parent
c392fc8d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
source/EV3.m
+12
-3
12 additions, 3 deletions
source/EV3.m
with
12 additions
and
3 deletions
source/EV3.m
+
12
−
3
View file @
879220a1
...
@@ -170,7 +170,8 @@ classdef EV3 < MaskedHandle
...
@@ -170,7 +170,8 @@ classdef EV3 < MaskedHandle
if
ev3
.
isConnected
if
ev3
.
isConnected
if
isCommInterfaceValid
(
ev3
.
commInterface
)
if
isCommInterfaceValid
(
ev3
.
commInterface
)
error
(
'EV3::connect: Already connected.'
);
warning
(
'EV3::connect: Already connected. Resetting connection now...'
);
ev3
.
disconnect
();
else
else
warning
([
'EV3::connect: EV3.isConnected is set to
''
True
''
, but '
,
...
warning
([
'EV3::connect: EV3.isConnected is set to
''
True
''
, but '
,
...
'comm handle is invalid. Deleting invalid handle and '
,
...
'comm handle is invalid. Deleting invalid handle and '
,
...
...
@@ -241,8 +242,16 @@ classdef EV3 < MaskedHandle
...
@@ -241,8 +242,16 @@ classdef EV3 < MaskedHandle
% b.connect('bt', 'serPort', '/dev/rfcomm0'); % |br|
% b.connect('bt', 'serPort', '/dev/rfcomm0'); % |br|
% % do stuff |br|
% % do stuff |br|
% b.disconnect(); % |br|
% b.disconnect(); % |br|
ev3
.
resetPhysicalBrick
();
% 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
% Disconnect motors and sensors
% -> set references to comm handle to 0
% -> set references to comm handle to 0
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment