diff --git a/docs/_build/doctrees/EV3.doctree b/docs/_build/doctrees/EV3.doctree
index 2e39e1100a61f0dfe0400888f762b21a8b510302..81b85669f84f7c552d0c9d5036666af357bfad90 100644
Binary files a/docs/_build/doctrees/EV3.doctree and b/docs/_build/doctrees/EV3.doctree differ
diff --git a/docs/_build/doctrees/Motor.doctree b/docs/_build/doctrees/Motor.doctree
index 3aa7d5f18da7da47d12b05e78564d07c4bb9eaf8..99bd358f2448805b5bbb924e554bf55b2d155f4f 100644
Binary files a/docs/_build/doctrees/Motor.doctree and b/docs/_build/doctrees/Motor.doctree differ
diff --git a/docs/_build/doctrees/Sensor.doctree b/docs/_build/doctrees/Sensor.doctree
index 53b1b15cfb8aecfaa610a796a1733f558e82466a..0ce62acba0af1478fbe7f507ef62fd2752a3ad6b 100644
Binary files a/docs/_build/doctrees/Sensor.doctree and b/docs/_build/doctrees/Sensor.doctree differ
diff --git a/docs/_build/doctrees/asd.doctree b/docs/_build/doctrees/asd.doctree
new file mode 100644
index 0000000000000000000000000000000000000000..53aa4497320979052b586b7bee1da5be2f77c15e
Binary files /dev/null and b/docs/_build/doctrees/asd.doctree differ
diff --git a/docs/_build/doctrees/btBrickIO.doctree b/docs/_build/doctrees/btBrickIO.doctree
new file mode 100644
index 0000000000000000000000000000000000000000..41720b5e50a9481d2562533c6c3dc1e3be9b113b
Binary files /dev/null and b/docs/_build/doctrees/btBrickIO.doctree differ
diff --git a/docs/_build/doctrees/environment.pickle b/docs/_build/doctrees/environment.pickle
index 8a48fa465dce05674c054dd6d48c9b077a32c5c8..babc07e1c05bb1c7ec352c896b201c5816ca6184 100644
Binary files a/docs/_build/doctrees/environment.pickle and b/docs/_build/doctrees/environment.pickle differ
diff --git a/docs/_build/doctrees/hid.doctree b/docs/_build/doctrees/hid.doctree
new file mode 100644
index 0000000000000000000000000000000000000000..a836cbb5790318295ad88da50ea6ea89f8570986
Binary files /dev/null and b/docs/_build/doctrees/hid.doctree differ
diff --git a/docs/_build/doctrees/index.doctree b/docs/_build/doctrees/index.doctree
index f8184d261e3623d707fdaf3f8a432b79760f9af6..71c3da6d49bc8b22ff1d549cbeb05bb425aa5b02 100644
Binary files a/docs/_build/doctrees/index.doctree and b/docs/_build/doctrees/index.doctree differ
diff --git a/docs/_build/doctrees/source.doctree b/docs/_build/doctrees/source.doctree
index 394c9ec6b794d2351e4b5aae9af01b69ff1a133e..17d8e0196cbf8f7d8a2b0657997cbe30915fabc0 100644
Binary files a/docs/_build/doctrees/source.doctree and b/docs/_build/doctrees/source.doctree differ
diff --git a/docs/_build/doctrees/test.doctree b/docs/_build/doctrees/test.doctree
new file mode 100644
index 0000000000000000000000000000000000000000..9f4d998babc5a66a3eea5e256010b5c666632ba6
Binary files /dev/null and b/docs/_build/doctrees/test.doctree differ
diff --git a/docs/_build/doctrees/usbBrickIO.doctree b/docs/_build/doctrees/usbBrickIO.doctree
new file mode 100644
index 0000000000000000000000000000000000000000..8c63e70472f80bd11bfe7873c0485d7a52c2ac41
Binary files /dev/null and b/docs/_build/doctrees/usbBrickIO.doctree differ
diff --git a/docs/_build/html/CommandLayer.html b/docs/_build/html/CommandLayer.html
index bf7d3ed0ba69fc1ea81015933ea322d4faffe29f..b955febd72e324f0af4ed08999a2a6168f6a68b8 100644
--- a/docs/_build/html/CommandLayer.html
+++ b/docs/_build/html/CommandLayer.html
@@ -31,8 +31,6 @@
     <link rel="index" title="Index" href="genindex.html" />
     <link rel="search" title="Search" href="search.html" />
     <link rel="top" title="Mindstorms EV3 Toolbox v0.4-rc.10 documentation" href="index.html" />
-    <link rel="next" title="CommunicationLayer" href="CommunicationLayer.html" />
-    <link rel="prev" title="Sensor" href="Sensor.html" />
 <meta charset='utf-8'>
 <meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
 <meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
@@ -76,9 +74,10 @@
 <li class="toctree-l1"><a class="reference internal" href="Motor.html">Motor</a></li>
 <li class="toctree-l1"><a class="reference internal" href="Sensor.html">Sensor</a></li>
 </ul>
-<ul class="current">
-<li class="toctree-l1 current"><a class="current reference internal" href="#">CommandLayer</a></li>
-<li class="toctree-l1"><a class="reference internal" href="CommunicationLayer.html">CommunicationLayer</a></li>
+<ul>
+<li class="toctree-l1"><a class="reference internal" href="hid.html">hidapi</a></li>
+<li class="toctree-l1"><a class="reference internal" href="usbBrickIO.html">usbBrickIO</a></li>
+<li class="toctree-l1"><a class="reference internal" href="btBrickIO.html">btBrickIO</a></li>
 </ul>
 </ul>
 </li>
@@ -105,14 +104,6 @@
             
               
                 
-  <li>
-    <a href="Sensor.html" title="Previous Chapter: Sensor"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">&laquo; Sensor</span>
-    </a>
-  </li>
-  <li>
-    <a href="CommunicationLayer.html" title="Next Chapter: CommunicationLayer"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">Communication... &raquo;</span>
-    </a>
-  </li>
               
             
             
diff --git a/docs/_build/html/CommunicationLayer.html b/docs/_build/html/CommunicationLayer.html
index be22b64c95243c213bcd89b2f7795559fcd32d4e..72af7372394b377e3420219dbaac9c6ec0cad119 100644
--- a/docs/_build/html/CommunicationLayer.html
+++ b/docs/_build/html/CommunicationLayer.html
@@ -31,7 +31,6 @@
     <link rel="index" title="Index" href="genindex.html" />
     <link rel="search" title="Search" href="search.html" />
     <link rel="top" title="Mindstorms EV3 Toolbox v0.4-rc.10 documentation" href="index.html" />
-    <link rel="prev" title="CommandLayer" href="CommandLayer.html" />
 <meta charset='utf-8'>
 <meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
 <meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
@@ -75,9 +74,10 @@
 <li class="toctree-l1"><a class="reference internal" href="Motor.html">Motor</a></li>
 <li class="toctree-l1"><a class="reference internal" href="Sensor.html">Sensor</a></li>
 </ul>
-<ul class="current">
-<li class="toctree-l1"><a class="reference internal" href="CommandLayer.html">CommandLayer</a></li>
-<li class="toctree-l1 current"><a class="current reference internal" href="#">CommunicationLayer</a></li>
+<ul>
+<li class="toctree-l1"><a class="reference internal" href="hid.html">hidapi</a></li>
+<li class="toctree-l1"><a class="reference internal" href="usbBrickIO.html">usbBrickIO</a></li>
+<li class="toctree-l1"><a class="reference internal" href="btBrickIO.html">btBrickIO</a></li>
 </ul>
 </ul>
 </li>
@@ -104,10 +104,6 @@
             
               
                 
-  <li>
-    <a href="CommandLayer.html" title="Previous Chapter: CommandLayer"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">&laquo; CommandLayer</span>
-    </a>
-  </li>
               
             
             
diff --git a/docs/_build/html/EV3.html b/docs/_build/html/EV3.html
index 7f30eca689a28b2a910b53e71062e018a8f89f4e..8dffa0e5745305e731aac6cf092421d7a9359f0e 100644
--- a/docs/_build/html/EV3.html
+++ b/docs/_build/html/EV3.html
@@ -77,8 +77,9 @@
 <li class="toctree-l1"><a class="reference internal" href="Sensor.html">Sensor</a></li>
 </ul>
 <ul>
-<li class="toctree-l1"><a class="reference internal" href="CommandLayer.html">CommandLayer</a></li>
-<li class="toctree-l1"><a class="reference internal" href="CommunicationLayer.html">CommunicationLayer</a></li>
+<li class="toctree-l1"><a class="reference internal" href="hid.html">hidapi</a></li>
+<li class="toctree-l1"><a class="reference internal" href="usbBrickIO.html">usbBrickIO</a></li>
+<li class="toctree-l1"><a class="reference internal" href="btBrickIO.html">btBrickIO</a></li>
 </ul>
 </ul>
 </li>
@@ -145,7 +146,21 @@
 <dl class="class">
 <dt id="source.EV3">
 <em class="property">class </em><code class="descname">EV3</code><span class="sig-paren">(</span><em>varargin</em><span class="sig-paren">)</span><a class="headerlink" href="#source.EV3" title="Permalink to this definition">¶</a></dt>
-<dd><p>High-level class to work with physical bricks.</p>
+<dd><dl class="docutils">
+<dt><em>List of methods</em>:</dt>
+<dd><ul class="first last simple">
+<li><a class="reference internal" href="#source.EV3.connect" title="source.EV3.connect"><code class="xref mat mat-meth docutils literal"><span class="pre">connect()</span></code></a></li>
+<li><a class="reference internal" href="#source.EV3.disconnect" title="source.EV3.disconnect"><code class="xref mat mat-meth docutils literal"><span class="pre">disconnect()</span></code></a></li>
+<li><a class="reference internal" href="#source.EV3.stopAllMotors" title="source.EV3.stopAllMotors"><code class="xref mat mat-meth docutils literal"><span class="pre">stopAllMotors()</span></code></a></li>
+<li><a class="reference internal" href="#source.EV3.beep" title="source.EV3.beep"><code class="xref mat mat-meth docutils literal"><span class="pre">beep()</span></code></a></li>
+<li><a class="reference internal" href="#source.EV3.playTone" title="source.EV3.playTone"><code class="xref mat mat-meth docutils literal"><span class="pre">playTone()</span></code></a></li>
+<li><a class="reference internal" href="#source.EV3.stopTone" title="source.EV3.stopTone"><code class="xref mat mat-meth docutils literal"><span class="pre">stopTone()</span></code></a></li>
+<li><a class="reference internal" href="#source.EV3.tonePlayed" title="source.EV3.tonePlayed"><code class="xref mat mat-meth docutils literal"><span class="pre">tonePlayed()</span></code></a></li>
+<li><a class="reference internal" href="#source.EV3.setProperties" title="source.EV3.setProperties"><code class="xref mat mat-meth docutils literal"><span class="pre">setProperties()</span></code></a></li>
+</ul>
+</dd>
+</dl>
+<p>High-level class to work with physical bricks.</p>
 <p>This is the 'central' class (from user's view) when working with this toolbox. It
 delivers a convenient interface for creating a connection to the brick and sending
 commands to it. An EV3-object creates 4 Motor- and 4 Sensor-objects, one for each port.</p>
@@ -220,13 +235,13 @@ follows: <em>brickObject.motorA.setProperties('power', 50);</em></li>
 <dl class="attribute">
 <dt id="source.EV3.batteryMode">
 <code class="descname">batteryMode</code><a class="headerlink" href="#source.EV3.batteryMode" title="Permalink to this definition">¶</a></dt>
-<dd><p><em>string in {'Percentage', 'Voltage'}</em> &#8211; Mode for reading battery charge. See also <a class="reference internal" href="source.html#source.EV3.batteryValue" title="source.EV3.batteryValue"><code class="xref mat mat-attr docutils literal"><span class="pre">batteryValue</span></code></a>. <em>[WRITABLE]</em></p>
+<dd><p><em>string in {'Percentage', 'Voltage'}</em> &#8211; Mode for reading battery charge. See also <a class="reference internal" href="#source.EV3.batteryValue" title="source.EV3.batteryValue"><code class="xref mat mat-attr docutils literal"><span class="pre">batteryValue</span></code></a>. <em>[WRITABLE]</em></p>
 </dd></dl>
 
 <dl class="attribute">
 <dt id="source.EV3.batteryValue">
 <code class="descname">batteryValue</code><a class="headerlink" href="#source.EV3.batteryValue" title="Permalink to this definition">¶</a></dt>
-<dd><p><em>numeric</em> &#8211; Current battery charge. Depending on batteryMode, the reading is either in percentage or voltage. See also <a class="reference internal" href="source.html#source.EV3.batteryMode" title="source.EV3.batteryMode"><code class="xref mat mat-attr docutils literal"><span class="pre">batteryMode</span></code></a>. <em>[READ-ONLY]</em></p>
+<dd><p><em>numeric</em> &#8211; Current battery charge. Depending on batteryMode, the reading is either in percentage or voltage. See also <a class="reference internal" href="#source.EV3.batteryMode" title="source.EV3.batteryMode"><code class="xref mat mat-attr docutils literal"><span class="pre">batteryMode</span></code></a>. <em>[READ-ONLY]</em></p>
 </dd></dl>
 
 <dl class="attribute">
@@ -286,7 +301,7 @@ b.connect('bt', 'serPort', '/dev/rfcomm0'); % <br />
 % Setup usb connection, beep when connection has been established
 b = EV3(); % <br />
 b.connect('usb', 'beep', 'on', ); % <br /></p>
-<p>See also ISCONNECTED / <a class="reference internal" href="source.html#source.EV3.isConnected" title="source.EV3.isConnected"><code class="xref mat mat-attr docutils literal"><span class="pre">isConnected</span></code></a></p>
+<p>See also ISCONNECTED / <a class="reference internal" href="#source.EV3.isConnected" title="source.EV3.isConnected"><code class="xref mat mat-attr docutils literal"><span class="pre">isConnected</span></code></a></p>
 </dd></dl>
 
 <dl class="method">
@@ -315,7 +330,7 @@ b.disconnect(); % <br /></p>
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
 <li><strong>volume</strong> (<em>numeric in [0, 100]</em>) &#8211; in percent</li>
 <li><strong>frequency</strong> (<em>numeric in [250, 10000]</em>) &#8211; in Hertz</li>
-<li><strong>duration</strong> (<em>numeric &gt;0</em>) &#8211; in milliseconds</li>
+<li><strong>duration</strong> (<em>numeric &gt; 0</em>) &#8211; in milliseconds</li>
 </ul>
 </td>
 </tr>
@@ -349,7 +364,7 @@ second. <br /></p>
 b.connect('bt', 'serPort', '/dev/rfcomm0'); % <br />
 b.setProperties('debug', 'on', 'batteryMode', 'Voltage'); % <br />
 % Instead of: b.debug = 'on'; b.batteryMode = 'Voltage'; % <br /></p>
-<p>See also EV3.DEBUG, EV3.BATTERYMODE / <a class="reference internal" href="source.html#source.EV3.debug" title="source.EV3.debug"><code class="xref mat mat-attr docutils literal"><span class="pre">debug</span></code></a>, <a class="reference internal" href="source.html#source.EV3.batteryMode" title="source.EV3.batteryMode"><code class="xref mat mat-attr docutils literal"><span class="pre">batteryMode</span></code></a></p>
+<p>See also EV3.DEBUG, EV3.BATTERYMODE / <a class="reference internal" href="#source.EV3.debug" title="source.EV3.debug"><code class="xref mat mat-attr docutils literal"><span class="pre">debug</span></code></a>, <a class="reference internal" href="#source.EV3.batteryMode" title="source.EV3.batteryMode"><code class="xref mat mat-attr docutils literal"><span class="pre">batteryMode</span></code></a></p>
 </dd></dl>
 
 <dl class="method">
diff --git a/docs/_build/html/Motor.html b/docs/_build/html/Motor.html
index 32b86f1ff907d8583ba74172acb8fe38122417c3..ca7b2994609aeb46a61e498ebfbc6195f5b1314a 100644
--- a/docs/_build/html/Motor.html
+++ b/docs/_build/html/Motor.html
@@ -77,8 +77,9 @@
 <li class="toctree-l1"><a class="reference internal" href="Sensor.html">Sensor</a></li>
 </ul>
 <ul>
-<li class="toctree-l1"><a class="reference internal" href="CommandLayer.html">CommandLayer</a></li>
-<li class="toctree-l1"><a class="reference internal" href="CommunicationLayer.html">CommunicationLayer</a></li>
+<li class="toctree-l1"><a class="reference internal" href="hid.html">hidapi</a></li>
+<li class="toctree-l1"><a class="reference internal" href="usbBrickIO.html">usbBrickIO</a></li>
+<li class="toctree-l1"><a class="reference internal" href="btBrickIO.html">btBrickIO</a></li>
 </ul>
 </ul>
 </li>
@@ -145,7 +146,22 @@
 <dl class="class">
 <dt id="source.Motor">
 <em class="property">class </em><code class="descname">Motor</code><span class="sig-paren">(</span><em>varargin</em><span class="sig-paren">)</span><a class="headerlink" href="#source.Motor" title="Permalink to this definition">¶</a></dt>
-<dd><p>High-level class to work with motors.</p>
+<dd><dl class="docutils">
+<dt><em>List of methods</em>:</dt>
+<dd><ul class="first last simple">
+<li><a class="reference internal" href="#source.Motor.start" title="source.Motor.start"><code class="xref mat mat-meth docutils literal"><span class="pre">start()</span></code></a></li>
+<li><a class="reference internal" href="#source.Motor.stop" title="source.Motor.stop"><code class="xref mat mat-meth docutils literal"><span class="pre">stop()</span></code></a></li>
+<li><a class="reference internal" href="#source.Motor.syncedStart" title="source.Motor.syncedStart"><code class="xref mat mat-meth docutils literal"><span class="pre">syncedStart()</span></code></a></li>
+<li><a class="reference internal" href="#source.Motor.syncedStop" title="source.Motor.syncedStop"><code class="xref mat mat-meth docutils literal"><span class="pre">syncedStop()</span></code></a></li>
+<li><a class="reference internal" href="#source.Motor.waitFor" title="source.Motor.waitFor"><code class="xref mat mat-meth docutils literal"><span class="pre">waitFor()</span></code></a></li>
+<li><a class="reference internal" href="#source.Motor.internalReset" title="source.Motor.internalReset"><code class="xref mat mat-meth docutils literal"><span class="pre">internalReset()</span></code></a></li>
+<li><a class="reference internal" href="#source.Motor.resetTachoCount" title="source.Motor.resetTachoCount"><code class="xref mat mat-meth docutils literal"><span class="pre">resetTachoCount()</span></code></a></li>
+<li><a class="reference internal" href="#source.Motor.setBrake" title="source.Motor.setBrake"><code class="xref mat mat-meth docutils literal"><span class="pre">setBrake()</span></code></a></li>
+<li><a class="reference internal" href="#source.Motor.setProperties" title="source.Motor.setProperties"><code class="xref mat mat-meth docutils literal"><span class="pre">setProperties()</span></code></a></li>
+</ul>
+</dd>
+</dl>
+<p>High-level class to work with motors.</p>
 <p>This class is supposed to ease the use of the brick's motors. It is possible to set all
 kinds of parameters, request the current status of the motor ports and of course send
 commands to the brick to be executed on the respective port.</p>
diff --git a/docs/_build/html/Sensor.html b/docs/_build/html/Sensor.html
index a22da31f2abfb12d57fd357ce576b87e896155c6..8dc47aee99d8b881f41a6de704e3bb3b05cbfb6d 100644
--- a/docs/_build/html/Sensor.html
+++ b/docs/_build/html/Sensor.html
@@ -31,7 +31,7 @@
     <link rel="index" title="Index" href="genindex.html" />
     <link rel="search" title="Search" href="search.html" />
     <link rel="top" title="Mindstorms EV3 Toolbox v0.4-rc.10 documentation" href="index.html" />
-    <link rel="next" title="CommandLayer" href="CommandLayer.html" />
+    <link rel="next" title="hidapi" href="hid.html" />
     <link rel="prev" title="Motor" href="Motor.html" />
 <meta charset='utf-8'>
 <meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
@@ -77,8 +77,9 @@
 <li class="toctree-l1 current"><a class="current reference internal" href="#">Sensor</a></li>
 </ul>
 <ul>
-<li class="toctree-l1"><a class="reference internal" href="CommandLayer.html">CommandLayer</a></li>
-<li class="toctree-l1"><a class="reference internal" href="CommunicationLayer.html">CommunicationLayer</a></li>
+<li class="toctree-l1"><a class="reference internal" href="hid.html">hidapi</a></li>
+<li class="toctree-l1"><a class="reference internal" href="usbBrickIO.html">usbBrickIO</a></li>
+<li class="toctree-l1"><a class="reference internal" href="btBrickIO.html">btBrickIO</a></li>
 </ul>
 </ul>
 </li>
@@ -106,7 +107,7 @@
     </a>
   </li>
   <li>
-    <a href="CommandLayer.html" title="Next Chapter: CommandLayer"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">CommandLayer &raquo;</span>
+    <a href="hid.html" title="Next Chapter: hidapi"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">hidapi &raquo;</span>
     </a>
   </li>
               
@@ -145,7 +146,15 @@
 <dl class="class">
 <dt id="source.Sensor">
 <em class="property">class </em><code class="descname">Sensor</code><span class="sig-paren">(</span><em>varargin</em><span class="sig-paren">)</span><a class="headerlink" href="#source.Sensor" title="Permalink to this definition">¶</a></dt>
-<dd><p>High-level class to work with sensors.</p>
+<dd><dl class="docutils">
+<dt><em>List of methods</em>:</dt>
+<dd><ul class="first last simple">
+<li><a class="reference internal" href="#source.Sensor.reset" title="source.Sensor.reset"><code class="xref mat mat-meth docutils literal"><span class="pre">reset()</span></code></a></li>
+<li><a class="reference internal" href="#source.Sensor.setProperties" title="source.Sensor.setProperties"><code class="xref mat mat-meth docutils literal"><span class="pre">setProperties()</span></code></a></li>
+</ul>
+</dd>
+</dl>
+<p>High-level class to work with sensors.</p>
 <p>The Sensor-class facilitates the communication with sensors. This mainly consists of
 reading the sensor's type and current value in a specified mode.</p>
 <p class="rubric">Notes</p>
diff --git a/docs/_build/html/_sources/asd.txt b/docs/_build/html/_sources/asd.txt
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/docs/_build/html/_sources/btBrickIO.txt b/docs/_build/html/_sources/btBrickIO.txt
new file mode 100644
index 0000000000000000000000000000000000000000..5e076d50dc1c141aef7ed955e216f4b3a438723c
--- /dev/null
+++ b/docs/_build/html/_sources/btBrickIO.txt
@@ -0,0 +1,10 @@
+.. automodule:: source
+
+.. |br| raw:: html
+   
+   <br />
+btBrickIO
+=========
+
+.. autoclass:: btBrickIO
+   :members: open, close, read, write, setProperties
diff --git a/docs/_build/html/_sources/hid.txt b/docs/_build/html/_sources/hid.txt
new file mode 100644
index 0000000000000000000000000000000000000000..a81e179691da5a39122479c305bd02a5f82a5619
--- /dev/null
+++ b/docs/_build/html/_sources/hid.txt
@@ -0,0 +1,10 @@
+.. automodule:: source
+
+.. |br| raw:: html
+   
+   <br />
+hidapi
+======
+
+.. autoclass:: hidapi
+   :members: open, close, read, read_timeout, write, getHIDInfoString, setNonBlocking, init, exit, error, enumerate, getManufacturersString, getProductString, getSerialNumberString
diff --git a/docs/_build/html/_sources/index.txt b/docs/_build/html/_sources/index.txt
index a75f04ace42e9750f8f5f8213320a304c343fd57..157a890c15b3b897ca5e3259d9f5fbe22c3fe0fe 100644
--- a/docs/_build/html/_sources/index.txt
+++ b/docs/_build/html/_sources/index.txt
@@ -45,8 +45,9 @@ Toolbox documentation
 Advanced
 
 .. toctree::
-   :maxdepth: 2
-
-   CommandLayer.rst
-   CommunicationLayer.rst
-
+   :maxdepth: 3
+   
+   hid
+   usbBrickIO
+   btBrickIO
+   
diff --git a/docs/_build/html/_sources/test.txt b/docs/_build/html/_sources/test.txt
new file mode 100644
index 0000000000000000000000000000000000000000..a81e179691da5a39122479c305bd02a5f82a5619
--- /dev/null
+++ b/docs/_build/html/_sources/test.txt
@@ -0,0 +1,10 @@
+.. automodule:: source
+
+.. |br| raw:: html
+   
+   <br />
+hidapi
+======
+
+.. autoclass:: hidapi
+   :members: open, close, read, read_timeout, write, getHIDInfoString, setNonBlocking, init, exit, error, enumerate, getManufacturersString, getProductString, getSerialNumberString
diff --git a/docs/_build/html/_sources/usbBrickIO.txt b/docs/_build/html/_sources/usbBrickIO.txt
new file mode 100644
index 0000000000000000000000000000000000000000..785bdc9777327560b7982902df1a9df17ffb2cc9
--- /dev/null
+++ b/docs/_build/html/_sources/usbBrickIO.txt
@@ -0,0 +1,10 @@
+.. automodule:: source
+
+.. |br| raw:: html
+   
+   <br />
+usbBrickIO
+==========
+
+.. autoclass:: usbBrickIO
+   :members: open, close, read, write, setProperties
diff --git a/docs/_build/html/asd.html b/docs/_build/html/asd.html
new file mode 100644
index 0000000000000000000000000000000000000000..d0a257d4778fb87d4c0845ed7f956761a1cf8da5
--- /dev/null
+++ b/docs/_build/html/asd.html
@@ -0,0 +1,151 @@
+<!DOCTYPE html>
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>&lt;no title&gt; &#8212; Mindstorms EV3 Toolbox v0.4-rc.10 documentation</title>
+    
+    <link rel="stylesheet" href="_static/basic.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <link rel="stylesheet" href="_static/bootswatch-3.3.6/readable/bootstrap.min.css" type="text/css" />
+    <link rel="stylesheet" href="_static/bootstrap-sphinx.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    './',
+        VERSION:     'v0.4-rc.10',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="_static/js/jquery-1.11.0.min.js"></script>
+    <script type="text/javascript" src="_static/js/jquery-fix.js"></script>
+    <script type="text/javascript" src="_static/bootstrap-3.3.6/js/bootstrap.min.js"></script>
+    <script type="text/javascript" src="_static/bootstrap-sphinx.js"></script>
+    <link rel="index" title="Index" href="genindex.html" />
+    <link rel="search" title="Search" href="search.html" />
+    <link rel="top" title="Mindstorms EV3 Toolbox v0.4-rc.10 documentation" href="index.html" />
+<meta charset='utf-8'>
+<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
+<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
+<meta name="apple-mobile-web-app-capable" content="yes">
+
+  </head>
+  <body role="document">
+
+  <div id="navbar" class="navbar navbar-default navbar-fixed-top">
+    <div class="container">
+      <div class="navbar-header">
+        <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
+        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+        </button>
+        <a class="navbar-brand" href="index.html">
+          Mindstorms EV3 Toolbox</a>
+        <span class="navbar-text navbar-version pull-left"><b>v0.4</b></span>
+      </div>
+
+        <div class="collapse navbar-collapse nav-collapse">
+          <ul class="nav navbar-nav">
+            
+            
+              <li class="dropdown globaltoc-container">
+  <a role="button"
+     id="dLabelGlobalToc"
+     data-toggle="dropdown"
+     data-target="#"
+     href="index.html">Site <b class="caret"></b></a>
+  <ul class="dropdown-menu globaltoc"
+      role="menu"
+      aria-labelledby="dLabelGlobalToc"><ul>
+<li class="toctree-l1"><a class="reference internal" href="readme.html">General</a></li>
+<li class="toctree-l1"><a class="reference internal" href="examples.html">Examples</a></li>
+</ul>
+<ul>
+<li class="toctree-l1"><a class="reference internal" href="EV3.html">EV3</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Motor.html">Motor</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Sensor.html">Sensor</a></li>
+</ul>
+<ul>
+<li class="toctree-l1"><a class="reference internal" href="usbBrickIO.html">usbBrickIO</a></li>
+<li class="toctree-l1"><a class="reference internal" href="btBrickIO.html">btBrickIO</a></li>
+</ul>
+</ul>
+</li>
+              
+                <li class="dropdown">
+  <a role="button"
+     id="dLabelLocalToc"
+     data-toggle="dropdown"
+     data-target="#"
+     href="#">Page <b class="caret"></b></a>
+  <ul class="dropdown-menu localtoc"
+      role="menu"
+      aria-labelledby="dLabelLocalToc"><ul class="simple">
+</ul>
+</ul>
+</li>
+              
+            
+            
+              
+                
+              
+            
+            
+            
+            
+              <li class="hidden-sm">
+<div id="sourcelink">
+  <a href="_sources/asd.txt"
+     rel="nofollow">Source</a>
+</div></li>
+            
+          </ul>
+
+          
+            
+<form class="navbar-form navbar-right" action="search.html" method="get">
+ <div class="form-group">
+  <input type="text" name="q" class="form-control" placeholder="Search" />
+ </div>
+  <input type="hidden" name="check_keywords" value="yes" />
+  <input type="hidden" name="area" value="default" />
+</form>
+          
+        </div>
+    </div>
+  </div>
+
+<div class="container">
+  <div class="row">
+    <div class="col-md-12 content">
+      
+  
+
+    </div>
+      
+  </div>
+</div>
+<footer class="footer">
+  <div class="container">
+    <p class="pull-right">
+      <a href="#">Back to top</a>
+      
+    </p>
+    <p>
+        &copy; Copyright 2016, LfB - RWTH Aachen.<br/>
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.8.<br/>
+    </p>
+  </div>
+</footer>
+  </body>
+</html>
\ No newline at end of file
diff --git a/docs/_build/html/btBrickIO.html b/docs/_build/html/btBrickIO.html
new file mode 100644
index 0000000000000000000000000000000000000000..9ac6d3b9f9506fc264345c97c32d72d3bedc9fb3
--- /dev/null
+++ b/docs/_build/html/btBrickIO.html
@@ -0,0 +1,290 @@
+<!DOCTYPE html>
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>btBrickIO &#8212; Mindstorms EV3 Toolbox v0.4-rc.10 documentation</title>
+    
+    <link rel="stylesheet" href="_static/basic.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <link rel="stylesheet" href="_static/bootswatch-3.3.6/readable/bootstrap.min.css" type="text/css" />
+    <link rel="stylesheet" href="_static/bootstrap-sphinx.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    './',
+        VERSION:     'v0.4-rc.10',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="_static/js/jquery-1.11.0.min.js"></script>
+    <script type="text/javascript" src="_static/js/jquery-fix.js"></script>
+    <script type="text/javascript" src="_static/bootstrap-3.3.6/js/bootstrap.min.js"></script>
+    <script type="text/javascript" src="_static/bootstrap-sphinx.js"></script>
+    <link rel="index" title="Index" href="genindex.html" />
+    <link rel="search" title="Search" href="search.html" />
+    <link rel="top" title="Mindstorms EV3 Toolbox v0.4-rc.10 documentation" href="index.html" />
+    <link rel="prev" title="usbBrickIO" href="usbBrickIO.html" />
+<meta charset='utf-8'>
+<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
+<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
+<meta name="apple-mobile-web-app-capable" content="yes">
+
+  </head>
+  <body role="document">
+
+  <div id="navbar" class="navbar navbar-default navbar-fixed-top">
+    <div class="container">
+      <div class="navbar-header">
+        <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
+        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+        </button>
+        <a class="navbar-brand" href="index.html">
+          Mindstorms EV3 Toolbox</a>
+        <span class="navbar-text navbar-version pull-left"><b>v0.4</b></span>
+      </div>
+
+        <div class="collapse navbar-collapse nav-collapse">
+          <ul class="nav navbar-nav">
+            
+            
+              <li class="dropdown globaltoc-container">
+  <a role="button"
+     id="dLabelGlobalToc"
+     data-toggle="dropdown"
+     data-target="#"
+     href="index.html">Site <b class="caret"></b></a>
+  <ul class="dropdown-menu globaltoc"
+      role="menu"
+      aria-labelledby="dLabelGlobalToc"><ul>
+<li class="toctree-l1"><a class="reference internal" href="readme.html">General</a></li>
+<li class="toctree-l1"><a class="reference internal" href="examples.html">Examples</a></li>
+</ul>
+<ul>
+<li class="toctree-l1"><a class="reference internal" href="EV3.html">EV3</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Motor.html">Motor</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Sensor.html">Sensor</a></li>
+</ul>
+<ul class="current">
+<li class="toctree-l1"><a class="reference internal" href="hid.html">hidapi</a></li>
+<li class="toctree-l1"><a class="reference internal" href="usbBrickIO.html">usbBrickIO</a></li>
+<li class="toctree-l1 current"><a class="current reference internal" href="#">btBrickIO</a></li>
+</ul>
+</ul>
+</li>
+              
+                <li class="dropdown">
+  <a role="button"
+     id="dLabelLocalToc"
+     data-toggle="dropdown"
+     data-target="#"
+     href="#">Page <b class="caret"></b></a>
+  <ul class="dropdown-menu localtoc"
+      role="menu"
+      aria-labelledby="dLabelLocalToc"><ul>
+<li><a class="reference internal" href="#">btBrickIO</a></li>
+</ul>
+</ul>
+</li>
+              
+            
+            
+              
+                
+  <li>
+    <a href="usbBrickIO.html" title="Previous Chapter: usbBrickIO"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">&laquo; usbBrickIO</span>
+    </a>
+  </li>
+              
+            
+            
+            
+            
+              <li class="hidden-sm">
+<div id="sourcelink">
+  <a href="_sources/btBrickIO.txt"
+     rel="nofollow">Source</a>
+</div></li>
+            
+          </ul>
+
+          
+            
+<form class="navbar-form navbar-right" action="search.html" method="get">
+ <div class="form-group">
+  <input type="text" name="q" class="form-control" placeholder="Search" />
+ </div>
+  <input type="hidden" name="check_keywords" value="yes" />
+  <input type="hidden" name="area" value="default" />
+</form>
+          
+        </div>
+    </div>
+  </div>
+
+<div class="container">
+  <div class="row">
+    <div class="col-md-12 content">
+      
+  <span class="target" id="module-source"></span><div class="section" id="btbrickio">
+<h1>btBrickIO<a class="headerlink" href="#btbrickio" title="Permalink to this headline">¶</a></h1>
+<dl class="class">
+<dt id="source.btBrickIO">
+<em class="property">class </em><code class="descname">btBrickIO</code><span class="sig-paren">(</span><em>varargin</em><span class="sig-paren">)</span><a class="headerlink" href="#source.btBrickIO" title="Permalink to this definition">¶</a></dt>
+<dd><dl class="docutils">
+<dt><em>List of methods</em>:</dt>
+<dd><ul class="first last simple">
+<li><a class="reference internal" href="#source.btBrickIO.open" title="source.btBrickIO.open"><code class="xref mat mat-meth docutils literal"><span class="pre">open()</span></code></a></li>
+<li><a class="reference internal" href="#source.btBrickIO.close" title="source.btBrickIO.close"><code class="xref mat mat-meth docutils literal"><span class="pre">close()</span></code></a></li>
+<li><a class="reference internal" href="#source.btBrickIO.read" title="source.btBrickIO.read"><code class="xref mat mat-meth docutils literal"><span class="pre">read()</span></code></a></li>
+<li><a class="reference internal" href="#source.btBrickIO.write" title="source.btBrickIO.write"><code class="xref mat mat-meth docutils literal"><span class="pre">write()</span></code></a></li>
+<li><a class="reference internal" href="#source.btBrickIO.setProperties" title="source.btBrickIO.setProperties"><code class="xref mat mat-meth docutils literal"><span class="pre">setProperties()</span></code></a></li>
+</ul>
+</dd>
+</dl>
+<p>Bluetooth interface between MATLAB and the brick</p>
+<p class="rubric">Notes</p>
+<ul>
+<li><p class="first">Connects to the bluetooth module on the host through a serial
+connection. Hence be sure that a serial connection to the bluetooth
+module can be made. Also be sure that the bluetooth module has been paired
+to the brick before trying to connect.</p>
+</li>
+<li><dl class="first docutils">
+<dt>Usage is OS-dependent:</dt>
+<dd><ul class="first last simple">
+<li>Windows: the deviceName- &amp; channel-properties are needed for connection. The implementation is based on the Instrument Control toolbox.</li>
+<li>Linux (and potentially Mac): serialPort-property is needed for connection. The implementation is based on MATLAB's serial port implementation.</li>
+</ul>
+</dd>
+</dl>
+</li>
+<li><p class="first">For general information, see also <code class="xref mat mat-class docutils literal"><span class="pre">BrickIO</span></code>.</p>
+</li>
+</ul>
+<dl class="attribute">
+<dt id="source.btBrickIO.debug">
+<code class="descname">debug</code><a class="headerlink" href="#source.btBrickIO.debug" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>bool</em> &#8211; If true, each open/close/read/write-call will be shown in the console.
+Defaults to false.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.btBrickIO.serialPort">
+<code class="descname">serialPort</code><a class="headerlink" href="#source.btBrickIO.serialPort" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>string</em> &#8211; Path to the serial-port object. Only needed when using MATLAB's
+serial class (i.e. on linux/mac). Defaults to '/dev/rfcomm0'.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.btBrickIO.deviceName">
+<code class="descname">deviceName</code><a class="headerlink" href="#source.btBrickIO.deviceName" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>string</em> &#8211; Name of the BT-device = the brick. Only needed when using the
+Instrument Control toolbox (i.e. on windows). Defaults to 'EV3'.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.btBrickIO.channel">
+<code class="descname">channel</code><a class="headerlink" href="#source.btBrickIO.channel" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>numeric &gt; 0</em> &#8211; BT-channel of the connected BT-device. Only needed when using
+the Instrument Control toolbox (i.e. on windows). Defaults to 1.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.btBrickIO.timeOut">
+<code class="descname">timeOut</code><a class="headerlink" href="#source.btBrickIO.timeOut" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>numeric &gt;= 0</em> &#8211; seconds after which a timeout-error occurs if no packet could be
+read. Defaults to 10.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.btBrickIO.backend">
+<code class="descname">backend</code><a class="headerlink" href="#source.btBrickIO.backend" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>'serial'|'instrumentControl'</em> &#8211; Backend this implementation is based on. Is
+automatically chosen depending on the OS. Defaults to 'serial' on linux/mac
+systems, and to 'instrumentControl' on windows systems.</p>
+</dd></dl>
+
+<p class="rubric">Examples</p>
+<p>% Connecting on windows <br />
+commHandle = btBrickIO('deviceName', 'MyEV3', 'channel', 1); % <br />
+% Connecting on windows using MATLABs default serial port implementation for testing <br />
+commHandle = btBrickIO('deviceName', 'MyEV3', 'channel', 1, 'backend', 'serial'); % <br />
+% Connecting on mac/linux <br />
+commHandle = btBrickIO('serPort', '/dev/rfcomm0'); % <br /></p>
+<dl class="method">
+<dt id="source.btBrickIO.close">
+<code class="descname">close</code><span class="sig-paren">(</span><em>brickIO</em><span class="sig-paren">)</span><a class="headerlink" href="#source.btBrickIO.close" title="Permalink to this definition">¶</a></dt>
+<dd><p>Closes the bluetooth connection the brick using fclose.</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.btBrickIO.open">
+<code class="descname">open</code><span class="sig-paren">(</span><em>brickIO</em><span class="sig-paren">)</span><a class="headerlink" href="#source.btBrickIO.open" title="Permalink to this definition">¶</a></dt>
+<dd><p>Opens the bluetooth connection to the brick using fopen.</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.btBrickIO.read">
+<code class="descname">read</code><span class="sig-paren">(</span><em>brickIO</em><span class="sig-paren">)</span><a class="headerlink" href="#source.btBrickIO.read" title="Permalink to this definition">¶</a></dt>
+<dd><p>Reads data from the brick through bluetooth via fread and returns the data in uint8 format.</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.btBrickIO.setProperties">
+<code class="descname">setProperties</code><span class="sig-paren">(</span><em>brickIO</em>, <em>varargin</em><span class="sig-paren">)</span><a class="headerlink" href="#source.btBrickIO.setProperties" title="Permalink to this definition">¶</a></dt>
+<dd><p>Sets multiple btBrickIO properties at once using MATLAB's inputParser.</p>
+<p>The syntax is as follows: commHandle.setProperties('propertyName1',
+propertyValue1, 'propertyName2', propertyValue2, ...). Valid, optional properties
+are: debug, serPort, deviceName, channel, timeout.</p>
+<p>See also BTBRICKIO.DEBUG, BTBRICKIO.SERIALPORT, BTBRICKIO.DEVICENAME,
+BTBRICKIO.CHANNEL, BTBRICKIO.TIMEOUT</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.btBrickIO.write">
+<code class="descname">write</code><span class="sig-paren">(</span><em>brickIO</em>, <em>wmsg</em><span class="sig-paren">)</span><a class="headerlink" href="#source.btBrickIO.write" title="Permalink to this definition">¶</a></dt>
+<dd><p>Writes data to the brick through bluetooth via fwrite.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>wmsg</strong> (<em>uint8 array</em>) &#8211; Data to be written to the brick via bluetooth</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+</dd></dl>
+
+</div>
+
+
+    </div>
+      
+  </div>
+</div>
+<footer class="footer">
+  <div class="container">
+    <p class="pull-right">
+      <a href="#">Back to top</a>
+      
+    </p>
+    <p>
+        &copy; Copyright 2016, LfB - RWTH Aachen.<br/>
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.8.<br/>
+    </p>
+  </div>
+</footer>
+  </body>
+</html>
\ No newline at end of file
diff --git a/docs/_build/html/examples.html b/docs/_build/html/examples.html
index b12382444dbc5e559f2b636110bcd7445f787e69..96fe6575db57fee9ba3982487e39e1304ccf4e8a 100644
--- a/docs/_build/html/examples.html
+++ b/docs/_build/html/examples.html
@@ -77,8 +77,9 @@
 <li class="toctree-l1"><a class="reference internal" href="Sensor.html">Sensor</a></li>
 </ul>
 <ul>
-<li class="toctree-l1"><a class="reference internal" href="CommandLayer.html">CommandLayer</a></li>
-<li class="toctree-l1"><a class="reference internal" href="CommunicationLayer.html">CommunicationLayer</a></li>
+<li class="toctree-l1"><a class="reference internal" href="hid.html">hidapi</a></li>
+<li class="toctree-l1"><a class="reference internal" href="usbBrickIO.html">usbBrickIO</a></li>
+<li class="toctree-l1"><a class="reference internal" href="btBrickIO.html">btBrickIO</a></li>
 </ul>
 </ul>
 </li>
diff --git a/docs/_build/html/genindex.html b/docs/_build/html/genindex.html
index f905277e3d9ad00cc2b6f9e9c489b60dc4347ac4..823964d32ed6f43943cf41957c512931dade0dbf 100644
--- a/docs/_build/html/genindex.html
+++ b/docs/_build/html/genindex.html
@@ -76,8 +76,9 @@
 <li class="toctree-l1"><a class="reference internal" href="Sensor.html">Sensor</a></li>
 </ul>
 <ul>
-<li class="toctree-l1"><a class="reference internal" href="CommandLayer.html">CommandLayer</a></li>
-<li class="toctree-l1"><a class="reference internal" href="CommunicationLayer.html">CommunicationLayer</a></li>
+<li class="toctree-l1"><a class="reference internal" href="hid.html">hidapi</a></li>
+<li class="toctree-l1"><a class="reference internal" href="usbBrickIO.html">usbBrickIO</a></li>
+<li class="toctree-l1"><a class="reference internal" href="btBrickIO.html">btBrickIO</a></li>
 </ul>
 </ul>
 </li>
@@ -132,13 +133,18 @@
  | <a href="#C"><strong>C</strong></a>
  | <a href="#D"><strong>D</strong></a>
  | <a href="#E"><strong>E</strong></a>
+ | <a href="#G"><strong>G</strong></a>
+ | <a href="#H"><strong>H</strong></a>
  | <a href="#I"><strong>I</strong></a>
  | <a href="#L"><strong>L</strong></a>
  | <a href="#M"><strong>M</strong></a>
+ | <a href="#N"><strong>N</strong></a>
+ | <a href="#O"><strong>O</strong></a>
  | <a href="#P"><strong>P</strong></a>
  | <a href="#R"><strong>R</strong></a>
  | <a href="#S"><strong>S</strong></a>
  | <a href="#T"><strong>T</strong></a>
+ | <a href="#U"><strong>U</strong></a>
  | <a href="#V"><strong>V</strong></a>
  | <a href="#W"><strong>W</strong></a>
  
@@ -147,6 +153,10 @@
 <table style="width: 100%" class="indextable genindextable"><tr>
   <td style="width: 33%" valign="top"><dl>
       
+  <dt><a href="btBrickIO.html#source.btBrickIO.backend">backend (source.btBrickIO attribute)</a>
+  </dt>
+
+      
   <dt><a href="EV3.html#source.EV3.batteryMode">batteryMode (source.EV3 attribute)</a>, <a href="source.html#source.EV3.batteryMode">[1]</a>
   </dt>
 
@@ -164,6 +174,10 @@
   <dt><a href="Motor.html#source.Motor.brakeMode">brakeMode (source.Motor attribute)</a>
   </dt>
 
+      
+  <dt><a href="btBrickIO.html#source.btBrickIO">btBrickIO (class in source)</a>
+  </dt>
+
   </dl></td>
 </tr></table>
 
@@ -171,12 +185,30 @@
 <table style="width: 100%" class="indextable genindextable"><tr>
   <td style="width: 33%" valign="top"><dl>
       
-  <dt><a href="EV3.html#source.EV3.connect">connect() (source.EV3 method)</a>, <a href="source.html#source.EV3.connect">[1]</a>
+  <dt><a href="btBrickIO.html#source.btBrickIO.channel">channel (source.btBrickIO attribute)</a>
   </dt>
 
+      
+  <dt><a href="btBrickIO.html#source.btBrickIO.close">close() (source.btBrickIO method)</a>
+  </dt>
+
+      <dd><dl>
+        
+  <dt><a href="hid.html#source.hidapi.close">(source.hidapi method)</a>
+  </dt>
+
+        
+  <dt><a href="usbBrickIO.html#source.usbBrickIO.close">(source.usbBrickIO method)</a>
+  </dt>
+
+      </dl></dd>
   </dl></td>
   <td style="width: 33%" valign="top"><dl>
       
+  <dt><a href="EV3.html#source.EV3.connect">connect() (source.EV3 method)</a>, <a href="source.html#source.EV3.connect">[1]</a>
+  </dt>
+
+      
   <dt><a href="Motor.html#source.Motor.currentSpeed">currentSpeed (source.Motor attribute)</a>
   </dt>
 
@@ -187,11 +219,15 @@
 <table style="width: 100%" class="indextable genindextable"><tr>
   <td style="width: 33%" valign="top"><dl>
       
-  <dt><a href="EV3.html#source.EV3.debug">debug (source.EV3 attribute)</a>, <a href="source.html#source.EV3.debug">[1]</a>
+  <dt><a href="btBrickIO.html#source.btBrickIO.debug">debug (source.btBrickIO attribute)</a>
   </dt>
 
       <dd><dl>
         
+  <dt><a href="EV3.html#source.EV3.debug">(source.EV3 attribute)</a>, <a href="source.html#source.EV3.debug">[1]</a>
+  </dt>
+
+        
   <dt><a href="Motor.html#source.Motor.debug">(source.Motor attribute)</a>
   </dt>
 
@@ -199,10 +235,18 @@
   <dt><a href="Sensor.html#source.Sensor.debug">(source.Sensor attribute)</a>
   </dt>
 
+        
+  <dt><a href="usbBrickIO.html#source.usbBrickIO.debug">(source.usbBrickIO attribute)</a>
+  </dt>
+
       </dl></dd>
   </dl></td>
   <td style="width: 33%" valign="top"><dl>
       
+  <dt><a href="btBrickIO.html#source.btBrickIO.deviceName">deviceName (source.btBrickIO attribute)</a>
+  </dt>
+
+      
   <dt><a href="EV3.html#source.EV3.disconnect">disconnect() (source.EV3 method)</a>, <a href="source.html#source.EV3.disconnect">[1]</a>
   </dt>
 
@@ -213,9 +257,63 @@
 <table style="width: 100%" class="indextable genindextable"><tr>
   <td style="width: 33%" valign="top"><dl>
       
+  <dt><a href="hid.html#source.hidapi.enumerate">enumerate() (source.hidapi method)</a>
+  </dt>
+
+      
+  <dt><a href="hid.html#source.hidapi.error">error() (source.hidapi method)</a>
+  </dt>
+
+  </dl></td>
+  <td style="width: 33%" valign="top"><dl>
+      
   <dt><a href="EV3.html#source.EV3">EV3 (class in source)</a>, <a href="source.html#source.EV3">[1]</a>
   </dt>
 
+      
+  <dt><a href="hid.html#source.hidapi.exit">exit() (source.hidapi method)</a>
+  </dt>
+
+  </dl></td>
+</tr></table>
+
+<h2 id="G">G</h2>
+<table style="width: 100%" class="indextable genindextable"><tr>
+  <td style="width: 33%" valign="top"><dl>
+      
+  <dt><a href="hid.html#source.hidapi.getHIDInfoString">getHIDInfoString() (source.hidapi method)</a>
+  </dt>
+
+      
+  <dt><a href="hid.html#source.hidapi.getManufacturersString">getManufacturersString() (source.hidapi method)</a>
+  </dt>
+
+  </dl></td>
+  <td style="width: 33%" valign="top"><dl>
+      
+  <dt><a href="hid.html#source.hidapi.getProductString">getProductString() (source.hidapi method)</a>
+  </dt>
+
+      
+  <dt><a href="hid.html#source.hidapi.getSerialNumberString">getSerialNumberString() (source.hidapi method)</a>
+  </dt>
+
+  </dl></td>
+</tr></table>
+
+<h2 id="H">H</h2>
+<table style="width: 100%" class="indextable genindextable"><tr>
+  <td style="width: 33%" valign="top"><dl>
+      
+  <dt><a href="hid.html#source.hidapi.handle">handle (source.hidapi attribute)</a>
+  </dt>
+
+  </dl></td>
+  <td style="width: 33%" valign="top"><dl>
+      
+  <dt><a href="hid.html#source.hidapi">hidapi (class in source)</a>
+  </dt>
+
   </dl></td>
 </tr></table>
 
@@ -223,6 +321,10 @@
 <table style="width: 100%" class="indextable genindextable"><tr>
   <td style="width: 33%" valign="top"><dl>
       
+  <dt><a href="hid.html#source.hidapi.init">init() (source.hidapi method)</a>
+  </dt>
+
+      
   <dt><a href="Motor.html#source.Motor.internalReset">internalReset() (source.Motor method)</a>
   </dt>
 
@@ -287,6 +389,54 @@
   </dl></td>
 </tr></table>
 
+<h2 id="N">N</h2>
+<table style="width: 100%" class="indextable genindextable"><tr>
+  <td style="width: 33%" valign="top"><dl>
+      
+  <dt><a href="hid.html#source.hidapi.nReadBuffer">nReadBuffer (source.hidapi attribute)</a>
+  </dt>
+
+      <dd><dl>
+        
+  <dt><a href="usbBrickIO.html#source.usbBrickIO.nReadBuffer">(source.usbBrickIO attribute)</a>
+  </dt>
+
+      </dl></dd>
+  </dl></td>
+  <td style="width: 33%" valign="top"><dl>
+      
+  <dt><a href="hid.html#source.hidapi.nWriteBuffer">nWriteBuffer (source.hidapi attribute)</a>
+  </dt>
+
+      <dd><dl>
+        
+  <dt><a href="usbBrickIO.html#source.usbBrickIO.nWriteBuffer">(source.usbBrickIO attribute)</a>
+  </dt>
+
+      </dl></dd>
+  </dl></td>
+</tr></table>
+
+<h2 id="O">O</h2>
+<table style="width: 100%" class="indextable genindextable"><tr>
+  <td style="width: 33%" valign="top"><dl>
+      
+  <dt><a href="btBrickIO.html#source.btBrickIO.open">open() (source.btBrickIO method)</a>
+  </dt>
+
+      <dd><dl>
+        
+  <dt><a href="hid.html#source.hidapi.open">(source.hidapi method)</a>
+  </dt>
+
+        
+  <dt><a href="usbBrickIO.html#source.usbBrickIO.open">(source.usbBrickIO method)</a>
+  </dt>
+
+      </dl></dd>
+  </dl></td>
+</tr></table>
+
 <h2 id="P">P</h2>
 <table style="width: 100%" class="indextable genindextable"><tr>
   <td style="width: 33%" valign="top"><dl>
@@ -294,12 +444,22 @@
   <dt><a href="EV3.html#source.EV3.playTone">playTone() (source.EV3 method)</a>, <a href="source.html#source.EV3.playTone">[1]</a>
   </dt>
 
+      
+  <dt><a href="Motor.html#source.Motor.power">power (source.Motor attribute)</a>
+  </dt>
+
   </dl></td>
   <td style="width: 33%" valign="top"><dl>
       
-  <dt><a href="Motor.html#source.Motor.power">power (source.Motor attribute)</a>
+  <dt><a href="hid.html#source.hidapi.productID">productID (source.hidapi attribute)</a>
+  </dt>
+
+      <dd><dl>
+        
+  <dt><a href="usbBrickIO.html#source.usbBrickIO.productID">(source.usbBrickIO attribute)</a>
   </dt>
 
+      </dl></dd>
   </dl></td>
 </tr></table>
 
@@ -307,12 +467,30 @@
 <table style="width: 100%" class="indextable genindextable"><tr>
   <td style="width: 33%" valign="top"><dl>
       
-  <dt><a href="Sensor.html#source.Sensor.reset">reset() (source.Sensor method)</a>
+  <dt><a href="btBrickIO.html#source.btBrickIO.read">read() (source.btBrickIO method)</a>
   </dt>
 
+      <dd><dl>
+        
+  <dt><a href="hid.html#source.hidapi.read">(source.hidapi method)</a>
+  </dt>
+
+        
+  <dt><a href="usbBrickIO.html#source.usbBrickIO.read">(source.usbBrickIO method)</a>
+  </dt>
+
+      </dl></dd>
   </dl></td>
   <td style="width: 33%" valign="top"><dl>
       
+  <dt><a href="hid.html#source.hidapi.read_timeout">read_timeout() (source.hidapi method)</a>
+  </dt>
+
+      
+  <dt><a href="Sensor.html#source.Sensor.reset">reset() (source.Sensor method)</a>
+  </dt>
+
+      
   <dt><a href="Motor.html#source.Motor.resetTachoCount">resetTachoCount() (source.Motor method)</a>
   </dt>
 
@@ -343,15 +521,27 @@
   </dt>
 
       
+  <dt><a href="btBrickIO.html#source.btBrickIO.serialPort">serialPort (source.btBrickIO attribute)</a>
+  </dt>
+
+      
   <dt><a href="Motor.html#source.Motor.setBrake">setBrake() (source.Motor method)</a>
   </dt>
 
       
-  <dt><a href="EV3.html#source.EV3.setProperties">setProperties() (source.EV3 method)</a>, <a href="source.html#source.EV3.setProperties">[1]</a>
+  <dt><a href="hid.html#source.hidapi.setNonBlocking">setNonBlocking() (source.hidapi method)</a>
+  </dt>
+
+      
+  <dt><a href="btBrickIO.html#source.btBrickIO.setProperties">setProperties() (source.btBrickIO method)</a>
   </dt>
 
       <dd><dl>
         
+  <dt><a href="EV3.html#source.EV3.setProperties">(source.EV3 method)</a>, <a href="source.html#source.EV3.setProperties">[1]</a>
+  </dt>
+
+        
   <dt><a href="Motor.html#source.Motor.setProperties">(source.Motor method)</a>
   </dt>
 
@@ -359,10 +549,22 @@
   <dt><a href="Sensor.html#source.Sensor.setProperties">(source.Sensor method)</a>
   </dt>
 
+        
+  <dt><a href="usbBrickIO.html#source.usbBrickIO.setProperties">(source.usbBrickIO method)</a>
+  </dt>
+
       </dl></dd>
   </dl></td>
   <td style="width: 33%" valign="top"><dl>
       
+  <dt><a href="hid.html#source.hidapi.sheader">sheader (source.hidapi attribute)</a>
+  </dt>
+
+      
+  <dt><a href="hid.html#source.hidapi.slib">slib (source.hidapi attribute)</a>
+  </dt>
+
+      
   <dt><a href="Motor.html#source.Motor.smoothStart">smoothStart (source.Motor attribute)</a>
   </dt>
 
@@ -371,7 +573,7 @@
   </dt>
 
       
-  <dt><a href="CommandLayer.html#module-source">source (module)</a>, <a href="CommunicationLayer.html#module-source">[1]</a>, <a href="EV3.html#module-source">[2]</a>, <a href="Motor.html#module-source">[3]</a>, <a href="Sensor.html#module-source">[4]</a>, <a href="source.html#module-source">[5]</a>
+  <dt><a href="CommandLayer.html#module-source">source (module)</a>, <a href="CommunicationLayer.html#module-source">[1]</a>, <a href="EV3.html#module-source">[2]</a>, <a href="Motor.html#module-source">[3]</a>, <a href="Sensor.html#module-source">[4]</a>, <a href="btBrickIO.html#module-source">[5]</a>, <a href="hid.html#module-source">[6]</a>, <a href="source.html#module-source">[7]</a>, <a href="usbBrickIO.html#module-source">[8]</a>
   </dt>
 
       
@@ -413,12 +615,22 @@
   </dt>
 
       
-  <dt><a href="EV3.html#source.EV3.tonePlayed">tonePlayed() (source.EV3 method)</a>, <a href="source.html#source.EV3.tonePlayed">[1]</a>
+  <dt><a href="btBrickIO.html#source.btBrickIO.timeOut">timeOut (source.btBrickIO attribute)</a>
   </dt>
 
+      <dd><dl>
+        
+  <dt><a href="usbBrickIO.html#source.usbBrickIO.timeOut">(source.usbBrickIO attribute)</a>
+  </dt>
+
+      </dl></dd>
   </dl></td>
   <td style="width: 33%" valign="top"><dl>
       
+  <dt><a href="EV3.html#source.EV3.tonePlayed">tonePlayed() (source.EV3 method)</a>, <a href="source.html#source.EV3.tonePlayed">[1]</a>
+  </dt>
+
+      
   <dt><a href="Motor.html#source.Motor.type">type (source.Motor attribute)</a>
   </dt>
 
@@ -431,6 +643,16 @@
   </dl></td>
 </tr></table>
 
+<h2 id="U">U</h2>
+<table style="width: 100%" class="indextable genindextable"><tr>
+  <td style="width: 33%" valign="top"><dl>
+      
+  <dt><a href="usbBrickIO.html#source.usbBrickIO">usbBrickIO (class in source)</a>
+  </dt>
+
+  </dl></td>
+</tr></table>
+
 <h2 id="V">V</h2>
 <table style="width: 100%" class="indextable genindextable"><tr>
   <td style="width: 33%" valign="top"><dl>
@@ -439,6 +661,18 @@
   </dt>
 
   </dl></td>
+  <td style="width: 33%" valign="top"><dl>
+      
+  <dt><a href="hid.html#source.hidapi.vendorID">vendorID (source.hidapi attribute)</a>
+  </dt>
+
+      <dd><dl>
+        
+  <dt><a href="usbBrickIO.html#source.usbBrickIO.vendorID">(source.usbBrickIO attribute)</a>
+  </dt>
+
+      </dl></dd>
+  </dl></td>
 </tr></table>
 
 <h2 id="W">W</h2>
@@ -448,6 +682,20 @@
   <dt><a href="Motor.html#source.Motor.waitFor">waitFor() (source.Motor method)</a>
   </dt>
 
+      
+  <dt><a href="btBrickIO.html#source.btBrickIO.write">write() (source.btBrickIO method)</a>
+  </dt>
+
+      <dd><dl>
+        
+  <dt><a href="hid.html#source.hidapi.write">(source.hidapi method)</a>
+  </dt>
+
+        
+  <dt><a href="usbBrickIO.html#source.usbBrickIO.write">(source.usbBrickIO method)</a>
+  </dt>
+
+      </dl></dd>
   </dl></td>
 </tr></table>
 
diff --git a/docs/_build/html/hid.html b/docs/_build/html/hid.html
new file mode 100644
index 0000000000000000000000000000000000000000..deffa114aab5da46eb95089f36e78019a22f7b89
--- /dev/null
+++ b/docs/_build/html/hid.html
@@ -0,0 +1,465 @@
+<!DOCTYPE html>
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>hidapi &#8212; Mindstorms EV3 Toolbox v0.4-rc.10 documentation</title>
+    
+    <link rel="stylesheet" href="_static/basic.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <link rel="stylesheet" href="_static/bootswatch-3.3.6/readable/bootstrap.min.css" type="text/css" />
+    <link rel="stylesheet" href="_static/bootstrap-sphinx.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    './',
+        VERSION:     'v0.4-rc.10',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="_static/js/jquery-1.11.0.min.js"></script>
+    <script type="text/javascript" src="_static/js/jquery-fix.js"></script>
+    <script type="text/javascript" src="_static/bootstrap-3.3.6/js/bootstrap.min.js"></script>
+    <script type="text/javascript" src="_static/bootstrap-sphinx.js"></script>
+    <link rel="index" title="Index" href="genindex.html" />
+    <link rel="search" title="Search" href="search.html" />
+    <link rel="top" title="Mindstorms EV3 Toolbox v0.4-rc.10 documentation" href="index.html" />
+    <link rel="next" title="usbBrickIO" href="usbBrickIO.html" />
+    <link rel="prev" title="Sensor" href="Sensor.html" />
+<meta charset='utf-8'>
+<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
+<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
+<meta name="apple-mobile-web-app-capable" content="yes">
+
+  </head>
+  <body role="document">
+
+  <div id="navbar" class="navbar navbar-default navbar-fixed-top">
+    <div class="container">
+      <div class="navbar-header">
+        <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
+        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+        </button>
+        <a class="navbar-brand" href="index.html">
+          Mindstorms EV3 Toolbox</a>
+        <span class="navbar-text navbar-version pull-left"><b>v0.4</b></span>
+      </div>
+
+        <div class="collapse navbar-collapse nav-collapse">
+          <ul class="nav navbar-nav">
+            
+            
+              <li class="dropdown globaltoc-container">
+  <a role="button"
+     id="dLabelGlobalToc"
+     data-toggle="dropdown"
+     data-target="#"
+     href="index.html">Site <b class="caret"></b></a>
+  <ul class="dropdown-menu globaltoc"
+      role="menu"
+      aria-labelledby="dLabelGlobalToc"><ul>
+<li class="toctree-l1"><a class="reference internal" href="readme.html">General</a></li>
+<li class="toctree-l1"><a class="reference internal" href="examples.html">Examples</a></li>
+</ul>
+<ul>
+<li class="toctree-l1"><a class="reference internal" href="EV3.html">EV3</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Motor.html">Motor</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Sensor.html">Sensor</a></li>
+</ul>
+<ul class="current">
+<li class="toctree-l1 current"><a class="current reference internal" href="#">hidapi</a></li>
+<li class="toctree-l1"><a class="reference internal" href="usbBrickIO.html">usbBrickIO</a></li>
+<li class="toctree-l1"><a class="reference internal" href="btBrickIO.html">btBrickIO</a></li>
+</ul>
+</ul>
+</li>
+              
+                <li class="dropdown">
+  <a role="button"
+     id="dLabelLocalToc"
+     data-toggle="dropdown"
+     data-target="#"
+     href="#">Page <b class="caret"></b></a>
+  <ul class="dropdown-menu localtoc"
+      role="menu"
+      aria-labelledby="dLabelLocalToc"><ul>
+<li><a class="reference internal" href="#">hidapi</a></li>
+</ul>
+</ul>
+</li>
+              
+            
+            
+              
+                
+  <li>
+    <a href="Sensor.html" title="Previous Chapter: Sensor"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">&laquo; Sensor</span>
+    </a>
+  </li>
+  <li>
+    <a href="usbBrickIO.html" title="Next Chapter: usbBrickIO"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">usbBrickIO &raquo;</span>
+    </a>
+  </li>
+              
+            
+            
+            
+            
+              <li class="hidden-sm">
+<div id="sourcelink">
+  <a href="_sources/hid.txt"
+     rel="nofollow">Source</a>
+</div></li>
+            
+          </ul>
+
+          
+            
+<form class="navbar-form navbar-right" action="search.html" method="get">
+ <div class="form-group">
+  <input type="text" name="q" class="form-control" placeholder="Search" />
+ </div>
+  <input type="hidden" name="check_keywords" value="yes" />
+  <input type="hidden" name="area" value="default" />
+</form>
+          
+        </div>
+    </div>
+  </div>
+
+<div class="container">
+  <div class="row">
+    <div class="col-md-12 content">
+      
+  <span class="target" id="module-source"></span><div class="section" id="hidapi">
+<h1>hidapi<a class="headerlink" href="#hidapi" title="Permalink to this headline">¶</a></h1>
+<dl class="class">
+<dt id="source.hidapi">
+<em class="property">class </em><code class="descclassname">source.</code><code class="descname">hidapi</code><span class="sig-paren">(</span><em>vendorID</em>, <em>productID</em>, <em>nReadBuffer</em>, <em>nWriteBuffer</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi" title="Permalink to this definition">¶</a></dt>
+<dd><dl class="docutils">
+<dt><em>List of methods</em>:</dt>
+<dd><ul class="first last simple">
+<li><a class="reference internal" href="#source.hidapi.open" title="source.hidapi.open"><code class="xref mat mat-meth docutils literal"><span class="pre">open()</span></code></a></li>
+<li><a class="reference internal" href="#source.hidapi.close" title="source.hidapi.close"><code class="xref mat mat-meth docutils literal"><span class="pre">close()</span></code></a></li>
+<li><a class="reference internal" href="#source.hidapi.read" title="source.hidapi.read"><code class="xref mat mat-meth docutils literal"><span class="pre">read()</span></code></a></li>
+<li><a class="reference internal" href="#source.hidapi.read_timeout" title="source.hidapi.read_timeout"><code class="xref mat mat-meth docutils literal"><span class="pre">read_timeout()</span></code></a></li>
+<li><a class="reference internal" href="#source.hidapi.write" title="source.hidapi.write"><code class="xref mat mat-meth docutils literal"><span class="pre">write()</span></code></a></li>
+<li><a class="reference internal" href="#source.hidapi.getHIDInfoString" title="source.hidapi.getHIDInfoString"><code class="xref mat mat-meth docutils literal"><span class="pre">getHIDInfoString()</span></code></a></li>
+<li><a class="reference internal" href="#source.hidapi.setNonBlocking" title="source.hidapi.setNonBlocking"><code class="xref mat mat-meth docutils literal"><span class="pre">setNonBlocking()</span></code></a></li>
+<li><a class="reference internal" href="#source.hidapi.init" title="source.hidapi.init"><code class="xref mat mat-meth docutils literal"><span class="pre">init()</span></code></a></li>
+<li><a class="reference internal" href="#source.hidapi.exit" title="source.hidapi.exit"><code class="xref mat mat-meth docutils literal"><span class="pre">exit()</span></code></a></li>
+<li><a class="reference internal" href="#source.hidapi.error" title="source.hidapi.error"><code class="xref mat mat-meth docutils literal"><span class="pre">error()</span></code></a></li>
+<li><a class="reference internal" href="#source.hidapi.enumerate" title="source.hidapi.enumerate"><code class="xref mat mat-meth docutils literal"><span class="pre">enumerate()</span></code></a></li>
+<li><a class="reference internal" href="#source.hidapi.getManufacturersString" title="source.hidapi.getManufacturersString"><code class="xref mat mat-meth docutils literal"><span class="pre">getManufacturersString()</span></code></a></li>
+<li><a class="reference internal" href="#source.hidapi.getProductString" title="source.hidapi.getProductString"><code class="xref mat mat-meth docutils literal"><span class="pre">getProductString()</span></code></a></li>
+<li><a class="reference internal" href="#source.hidapi.getSerialNumberString" title="source.hidapi.getSerialNumberString"><code class="xref mat mat-meth docutils literal"><span class="pre">getSerialNumberString()</span></code></a></li>
+</ul>
+</dd>
+</dl>
+<p>Interface to the hidapi library</p>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>Developed from the hidapi available at <a class="reference external" href="http://www.signal11.us/oss/hidapi/">http://www.signal11.us/oss/hidapi/</a>.</li>
+<li>Windows: hidapi.dll needed.</li>
+<li>Mac: hidapi.dylib needed. In addition, Xcode has to be installed.</li>
+<li>Linux: hidapi has to be compiled on host-system.</li>
+</ul>
+<dl class="attribute">
+<dt id="source.hidapi.handle">
+<code class="descname">handle</code><a class="headerlink" href="#source.hidapi.handle" title="Permalink to this definition">¶</a></dt>
+<dd></dd></dl>
+
+<dl class="attribute">
+<dt id="source.hidapi.vendorID">
+<code class="descname">vendorID</code><a class="headerlink" href="#source.hidapi.vendorID" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>numeric</em> &#8211; Vendor-ID of the USB device.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.hidapi.productID">
+<code class="descname">productID</code><a class="headerlink" href="#source.hidapi.productID" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>numeric</em> &#8211; Product-ID of the USB device.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.hidapi.nReadBuffer">
+<code class="descname">nReadBuffer</code><a class="headerlink" href="#source.hidapi.nReadBuffer" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>numeric</em> &#8211; Read-buffer size in bytes.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.hidapi.nWriteBuffer">
+<code class="descname">nWriteBuffer</code><a class="headerlink" href="#source.hidapi.nWriteBuffer" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>numeric</em> &#8211; Write-buffer size in bytes. Needs to be 1 Byte bigger than
+actual packet.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.hidapi.slib">
+<code class="descname">slib</code><a class="headerlink" href="#source.hidapi.slib" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>string</em> &#8211; Name of shared library file (without file extension). Defaults to
+&#8216;hidapi&#8217;.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.hidapi.sheader">
+<code class="descname">sheader</code><a class="headerlink" href="#source.hidapi.sheader" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>string</em> &#8211; Name of shared library header. Defaults to &#8216;hidapi.h&#8217;.</p>
+</dd></dl>
+
+<p class="rubric">Example</p>
+<p>hidHandle = hidapi(1684,0005,1024,1025); %|br|</p>
+<dl class="method">
+<dt id="source.hidapi.close">
+<code class="descname">close</code><span class="sig-paren">(</span><em>hid</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.close" title="Permalink to this definition">¶</a></dt>
+<dd><p>Close the connection to a hid device.</p>
+<dl class="docutils">
+<dt>Throws:</dt>
+<dd>InvalidHandle: Handle to USB-device not valid</dd>
+</dl>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>Gets called automatically when deleting the hidapi instance.</li>
+</ul>
+<ol class="upperroman simple" start="2001">
+<li>Check if pointer is (unexpectedly) already invalidated</li>
+</ol>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.enumerate">
+<code class="descname">enumerate</code><span class="sig-paren">(</span><em>hid</em>, <em>vendorID</em>, <em>productID</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.enumerate" title="Permalink to this definition">¶</a></dt>
+<dd><p>Enumerates the info about the hid device with the given vendorID and productID
+and returns a string with the returned hid information.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
+<li><strong>vendorID</strong> (<em>numeric</em>) &#8211; Vendor-ID of the USB device in decimal.</li>
+<li><strong>productID</strong> (<em>numeric</em>) &#8211; Product-ID of the USB device in decimal.</li>
+</ul>
+</td>
+</tr>
+</tbody>
+</table>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>Using a vendorID and productID of (0,0) will enumerate all connected hid
+devices.</li>
+<li>MATLAB does not have the hid_device_infoPtr struct so some of the returned
+information will need to be resized and cast into uint8 or chars.</li>
+</ul>
+<p>Enumerate the hid devices</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.error">
+<code class="descname">error</code><span class="sig-paren">(</span><em>hid</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.error" title="Permalink to this definition">¶</a></dt>
+<dd><p>Return the hid device error string if a function produced an error.</p>
+<dl class="docutils">
+<dt>Throws:</dt>
+<dd>InvalidHandle: Handle to USB-device not valid</dd>
+</dl>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>This function must be called explicitly if you think an error was generated
+from the hid device.</li>
+</ul>
+<ol class="upperroman simple" start="2001">
+<li>Check if pointer is (unexpectedly) already invalidated</li>
+</ol>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.exit">
+<code class="descname">exit</code><span class="sig-paren">(</span><em>hid</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.exit" title="Permalink to this definition">¶</a></dt>
+<dd><p>hidapi.exit Exit hidapi</p>
+<p>hid.exit() exits the hidapi library.</p>
+<dl class="docutils">
+<dt>Throws:</dt>
+<dd>CommError: Error during communication with device</dd>
+</dl>
+<p>Notes::
+- You should not have to call this function directly.</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.getHIDInfoString">
+<code class="descname">getHIDInfoString</code><span class="sig-paren">(</span><em>hid</em>, <em>info</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.getHIDInfoString" title="Permalink to this definition">¶</a></dt>
+<dd><p>Get the corresponding hid info from the hid device.</p>
+<dl class="docutils">
+<dt>Throws:</dt>
+<dd>CommError: Error during communication with device
+InvalidHandle: Handle to USB-device not valid</dd>
+</dl>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>Info is the hid information string.</li>
+</ul>
+<p>See also HIDAPI.GETMANUFACTURERSSTRING, HIDAPI.GETPRODUCTSTRING,
+HIDAPI.GETSERIALNUMBERSTRING.</p>
+<p>Read buffer nReadBuffer length</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.getManufacturersString">
+<code class="descname">getManufacturersString</code><span class="sig-paren">(</span><em>hid</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.getManufacturersString" title="Permalink to this definition">¶</a></dt>
+<dd><p>Get manufacturers string from hid object using getHIDInfoString.</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.getProductString">
+<code class="descname">getProductString</code><span class="sig-paren">(</span><em>hid</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.getProductString" title="Permalink to this definition">¶</a></dt>
+<dd><p>Get product string from hid object using getProductString.</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.getSerialNumberString">
+<code class="descname">getSerialNumberString</code><span class="sig-paren">(</span><em>hid</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.getSerialNumberString" title="Permalink to this definition">¶</a></dt>
+<dd><p>Get serial number from hid object using getSerialNumberString.</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.init">
+<code class="descname">init</code><span class="sig-paren">(</span><em>hid</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.init" title="Permalink to this definition">¶</a></dt>
+<dd><p>Inits the hidapi library.</p>
+<dl class="docutils">
+<dt>Throws:</dt>
+<dd>CommError: Error during communication with device</dd>
+</dl>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>This is called automatically in the library itself with the open function. You
+should not have to call this function directly.</li>
+</ul>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.open">
+<code class="descname">open</code><span class="sig-paren">(</span><em>hid</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.open" title="Permalink to this definition">¶</a></dt>
+<dd><p>Open a connection with a hid device</p>
+<dl class="docutils">
+<dt>Throws:</dt>
+<dd>CommError: Error during communication with device</dd>
+</dl>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>Gets called automatically when creating an hidapi-object.</li>
+<li>The pointer return value from this library call is always null so it is not
+possible to know if the open was successful.</li>
+<li>The final parameter to the open hidapi library call has different types
+depending on OS. On windows it is uint16, on linux/mac int32.</li>
+</ul>
+<p>Create a null pointer for the hid_open function (depends on OS)</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.read">
+<code class="descname">read</code><span class="sig-paren">(</span><em>hid</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.read" title="Permalink to this definition">¶</a></dt>
+<dd><p>Read from a hid device and returns the read bytes.</p>
+<dl class="docutils">
+<dt>Throws:</dt>
+<dd>CommError: Error during communication with device
+InvalidHandle: Handle to USB-device not valid</dd>
+</dl>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>Will print an error if no data was read.</li>
+</ul>
+<p>Read buffer of nReadBuffer length</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.read_timeout">
+<code class="descname">read_timeout</code><span class="sig-paren">(</span><em>hid</em>, <em>timeOut</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.read_timeout" title="Permalink to this definition">¶</a></dt>
+<dd><p>Read from a hid device with a timeout and return the read bytes.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>timeOut</strong> (<em>numeric &gt;= 0</em>) &#8211; Milliseconds after which a timeout-error occurs if no
+packet could be read.</td>
+</tr>
+</tbody>
+</table>
+<dl class="docutils">
+<dt>Throws:</dt>
+<dd>CommError: Error during communication with device
+InvalidHandle: Handle to USB-device not valid</dd>
+</dl>
+<p>Read buffer of nReadBuffer length</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.setNonBlocking">
+<code class="descname">setNonBlocking</code><span class="sig-paren">(</span><em>hid</em>, <em>nonblock</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.setNonBlocking" title="Permalink to this definition">¶</a></dt>
+<dd><p>Set the non blocking flag on the hid device connection.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>nonblock</strong> (<em>numeric in {0,1}</em>) &#8211; 0 disables nonblocking, 1 enables nonblocking</td>
+</tr>
+</tbody>
+</table>
+<dl class="docutils">
+<dt>Throws:</dt>
+<dd>CommError: Error during communication with device
+InvalidHandle: Handle to USB-device not valid</dd>
+</dl>
+<ol class="upperroman simple" start="2001">
+<li>Check if pointer is (unexpectedly) already invalidated</li>
+</ol>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.write">
+<code class="descname">write</code><span class="sig-paren">(</span><em>hid</em>, <em>wmsg</em>, <em>reportID</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.write" title="Permalink to this definition">¶</a></dt>
+<dd><p>Write to a hid device.</p>
+<dl class="docutils">
+<dt>Throws:</dt>
+<dd>CommError: Error during communication with device
+InvalidHandle: Handle to USB-device not valid</dd>
+</dl>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>Will print an error if there is a mismatch between the buffer size and the
+reported number of bytes written.</li>
+</ul>
+<p>Append a 0 at the front for HID report ID</p>
+</dd></dl>
+
+</dd></dl>
+
+</div>
+
+
+    </div>
+      
+  </div>
+</div>
+<footer class="footer">
+  <div class="container">
+    <p class="pull-right">
+      <a href="#">Back to top</a>
+      
+    </p>
+    <p>
+        &copy; Copyright 2016, LfB - RWTH Aachen.<br/>
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.8.<br/>
+    </p>
+  </div>
+</footer>
+  </body>
+</html>
\ No newline at end of file
diff --git a/docs/_build/html/index.html b/docs/_build/html/index.html
index 392a1f7fb1844dc2b44b4ece7648cd8c12d05788..405118001f2b56e232cdd231bc4f4fcfcc6ad12d 100644
--- a/docs/_build/html/index.html
+++ b/docs/_build/html/index.html
@@ -76,8 +76,9 @@
 <li class="toctree-l1"><a class="reference internal" href="Sensor.html">Sensor</a></li>
 </ul>
 <ul>
-<li class="toctree-l1"><a class="reference internal" href="CommandLayer.html">CommandLayer</a></li>
-<li class="toctree-l1"><a class="reference internal" href="CommunicationLayer.html">CommunicationLayer</a></li>
+<li class="toctree-l1"><a class="reference internal" href="hid.html">hidapi</a></li>
+<li class="toctree-l1"><a class="reference internal" href="usbBrickIO.html">usbBrickIO</a></li>
+<li class="toctree-l1"><a class="reference internal" href="btBrickIO.html">btBrickIO</a></li>
 </ul>
 </ul>
 </li>
@@ -176,16 +177,9 @@ these are the classes you will mostly use.</p>
 <p>Advanced</p>
 <div class="toctree-wrapper compound">
 <ul>
-<li class="toctree-l1"><a class="reference internal" href="CommandLayer.html">CommandLayer</a><ul>
-<li class="toctree-l2"><a class="reference internal" href="CommandLayer.html#command">Command</a></li>
-<li class="toctree-l2"><a class="reference internal" href="CommandLayer.html#communicationinterface">CommunicationInterface</a></li>
-</ul>
-</li>
-<li class="toctree-l1"><a class="reference internal" href="CommunicationLayer.html">CommunicationLayer</a><ul>
-<li class="toctree-l2"><a class="reference internal" href="CommunicationLayer.html#usb">USB</a></li>
-<li class="toctree-l2"><a class="reference internal" href="CommunicationLayer.html#bluetooth">Bluetooth</a></li>
-</ul>
-</li>
+<li class="toctree-l1"><a class="reference internal" href="hid.html">hidapi</a></li>
+<li class="toctree-l1"><a class="reference internal" href="usbBrickIO.html">usbBrickIO</a></li>
+<li class="toctree-l1"><a class="reference internal" href="btBrickIO.html">btBrickIO</a></li>
 </ul>
 </div>
 </div>
diff --git a/docs/_build/html/mat-modindex.html b/docs/_build/html/mat-modindex.html
index b38672dbedf8ed662a43038f49129b4474587969..d739141b2137025ab7ef6339693a550b9b040ac9 100644
--- a/docs/_build/html/mat-modindex.html
+++ b/docs/_build/html/mat-modindex.html
@@ -82,8 +82,9 @@
 <li class="toctree-l1"><a class="reference internal" href="Sensor.html">Sensor</a></li>
 </ul>
 <ul>
-<li class="toctree-l1"><a class="reference internal" href="CommandLayer.html">CommandLayer</a></li>
-<li class="toctree-l1"><a class="reference internal" href="CommunicationLayer.html">CommunicationLayer</a></li>
+<li class="toctree-l1"><a class="reference internal" href="hid.html">hidapi</a></li>
+<li class="toctree-l1"><a class="reference internal" href="usbBrickIO.html">usbBrickIO</a></li>
+<li class="toctree-l1"><a class="reference internal" href="btBrickIO.html">btBrickIO</a></li>
 </ul>
 </ul>
 </li>
@@ -144,7 +145,7 @@
      <tr>
        <td></td>
        <td>
-       <a href="source.html#module-source"><code class="xref">source</code></a></td><td>
+       <a href="usbBrickIO.html#module-source"><code class="xref">source</code></a></td><td>
        <em></em></td></tr>
    </table>
 
diff --git a/docs/_build/html/objects.inv b/docs/_build/html/objects.inv
index a3c132e711636a4c8ed891ddfe8a5f13a89ed346..2e46e2abe484e5cc009c63b29e6cbbb90c1a4d8c 100644
Binary files a/docs/_build/html/objects.inv and b/docs/_build/html/objects.inv differ
diff --git a/docs/_build/html/readme.html b/docs/_build/html/readme.html
index 954c61500add5d65144d7234cc4d4db1c280da4e..d1bcc12991bfd1b1d9de908d9a6c60cff3887251 100644
--- a/docs/_build/html/readme.html
+++ b/docs/_build/html/readme.html
@@ -77,8 +77,9 @@
 <li class="toctree-l1"><a class="reference internal" href="Sensor.html">Sensor</a></li>
 </ul>
 <ul>
-<li class="toctree-l1"><a class="reference internal" href="CommandLayer.html">CommandLayer</a></li>
-<li class="toctree-l1"><a class="reference internal" href="CommunicationLayer.html">CommunicationLayer</a></li>
+<li class="toctree-l1"><a class="reference internal" href="hid.html">hidapi</a></li>
+<li class="toctree-l1"><a class="reference internal" href="usbBrickIO.html">usbBrickIO</a></li>
+<li class="toctree-l1"><a class="reference internal" href="btBrickIO.html">btBrickIO</a></li>
 </ul>
 </ul>
 </li>
diff --git a/docs/_build/html/search.html b/docs/_build/html/search.html
index 83cf5d5221404857bcf632782488a125ce1779df..f6c7e9d2014fc221bd5f2c37349eb0640623cee3 100644
--- a/docs/_build/html/search.html
+++ b/docs/_build/html/search.html
@@ -83,8 +83,9 @@
 <li class="toctree-l1"><a class="reference internal" href="Sensor.html">Sensor</a></li>
 </ul>
 <ul>
-<li class="toctree-l1"><a class="reference internal" href="CommandLayer.html">CommandLayer</a></li>
-<li class="toctree-l1"><a class="reference internal" href="CommunicationLayer.html">CommunicationLayer</a></li>
+<li class="toctree-l1"><a class="reference internal" href="hid.html">hidapi</a></li>
+<li class="toctree-l1"><a class="reference internal" href="usbBrickIO.html">usbBrickIO</a></li>
+<li class="toctree-l1"><a class="reference internal" href="btBrickIO.html">btBrickIO</a></li>
 </ul>
 </ul>
 </li>
diff --git a/docs/_build/html/searchindex.js b/docs/_build/html/searchindex.js
index 878cbbcafc4f55bbc943a5ad918e960e9018eae6..0b433017ac10e5201b230ecc7a9af6c53b5aa447 100644
--- a/docs/_build/html/searchindex.js
+++ b/docs/_build/html/searchindex.js
@@ -1 +1 @@
-Search.setIndex({envversion:49,filenames:["CommandLayer","CommunicationLayer","EV3","Motor","Sensor","examples","index","readme","source"],objects:{"":{source:[8,0,1,""]},"source.EV3":{batteryMode:[8,2,1,""],batteryValue:[8,2,1,""],beep:[8,3,1,""],connect:[8,3,1,""],debug:[8,2,1,""],disconnect:[8,3,1,""],isConnected:[8,2,1,""],motorA:[8,2,1,""],motorB:[8,2,1,""],motorC:[8,2,1,""],motorD:[8,2,1,""],playTone:[8,3,1,""],sensor1:[8,2,1,""],sensor2:[8,2,1,""],sensor3:[8,2,1,""],sensor4:[8,2,1,""],setProperties:[8,3,1,""],stopAllMotors:[8,3,1,""],stopTone:[8,3,1,""],tonePlayed:[8,3,1,""]},"source.Motor":{brakeMode:[3,2,1,""],currentSpeed:[3,2,1,""],debug:[3,2,1,""],internalReset:[3,3,1,""],isRunning:[3,2,1,""],limitMode:[3,2,1,""],limitValue:[3,2,1,""],power:[3,2,1,""],resetTachoCount:[3,3,1,""],setBrake:[3,3,1,""],setProperties:[3,3,1,""],smoothStart:[3,2,1,""],smoothStop:[3,2,1,""],speedRegulation:[3,2,1,""],start:[3,3,1,""],stop:[3,3,1,""],syncedStart:[3,3,1,""],syncedStop:[3,3,1,""],tachoCount:[3,2,1,""],type:[3,2,1,""],waitFor:[3,3,1,""]},"source.Sensor":{debug:[4,2,1,""],mode:[4,2,1,""],reset:[4,3,1,""],setProperties:[4,3,1,""],type:[4,2,1,""],value:[4,2,1,""]},source:{EV3:[8,1,1,""],Motor:[3,1,1,""],Sensor:[4,1,1,""]}},objnames:{"0":["mat","module","MATLAB module"],"1":["mat","class","MATLAB class"],"2":["mat","attribute","MATLAB attribute"],"3":["mat","method","MATLAB method"]},objtypes:{"0":"mat:module","1":"mat:class","2":"mat:attribute","3":"mat:method"},terms:{"2nd":[2,3,4,8],"5000hz":[2,8],"abstract":6,"case":3,"catch":3,"class":[2,3,4,6,8],"default":4,"function":3,"long":3,"return":[2,3,8],"true":[2,3,8],"try":3,"while":6,aachen:6,abl:6,about:[2,3,4,8],acceler:[3,4],accelerationallax:4,access:6,accident:[2,8],act:3,action:3,actual:3,advanc:6,affect:3,after:3,afterward:3,again:3,all:[2,3,4,8],allow:4,alreadi:[],also:[2,3,4,8],alternatingli:[],ambient:4,angular:4,ani:3,announc:[2,3,4,8],anoth:3,apply:3,aren:3,argument:[2,3,4,8],around:3,automat:[2,3,4,8],avail:4,batteri:[2,8],batterymod:[2,3,8],batterymode:[2,8],batteryvalu:[2,8],been:[2,3,4,8],beep:[2,5,8],befor:[],behav:3,behaviour:6,better:3,between:3,bit:3,blue:4,bool:[2,3,4,8],both:3,brake:3,brakemod:3,brakemode:3,brick:[2,3,4,6,8],brickobject:[2,3,4,8],buggi:[],bump:4,c_output:3,call:[2,3,4,8],can:[3,4,6],car:3,central:[2,8],chang:3,charg:[2,8],check:3,clear:4,coast:3,code:4,col:4,color:4,com:[2,8],comm:[],comment:3,commun:[3,4,6],connect:[2,3,4,5,8],connectiontyp:[2,8],consist:[3,4],consol:[2,3,4,8],constantli:3,contain:[2,3,4,8],continu:3,contribut:[],control:[],conveni:[2,8],correctli:3,count:3,counter:3,cours:3,creat:[2,3,4,8],current:[2,3,4,8],currentspe:3,dba:4,debug:[2,3,4,8],defin:3,degre:[3,4],delet:[2,5,8],deliv:[2,8],depend:[2,3,4,8],design:6,destroi:[2,8],dev:[2,3,4,8],develop:6,devic:3,devicemod:4,devicetyp:[3,4],differ:[2,8],direct:3,directli:6,disconnect:[2,8],disp:[2,5,8],distcm:4,distin:4,document:6,doe:[2,3,8],doesn:[],don:[3,4],done:3,down:3,durat:[2,8],each:[2,3,4,8],eas:3,easili:6,either:[2,3,8],enabl:[2,8],equal:[2,3,8],error:[3,4],establish:[2,8],even:3,everytim:[3,4],exampl:[],execut:3,expect:[2,5,8],facilit:4,fals:3,far:3,feedback:[2,3,4,8],finish:3,firmwar:[2,3,8],first:[2,3,8],follow:[2,3,4,6,8],forward:3,four:3,frequenc:[2,8],from:[2,3,4,8],fun:[2,5,8],gener:[],germani:6,get:[2,3,6,8],given:[2,3,4,8],glanc:[2,8],goe:3,greater:3,green:4,gyro:4,happen:3,have:[2,3,8],heavi:3,here:3,hertz:[2,8],high:[2,3,4,6,8],highest:3,hold:3,how:3,htacceleromet:4,htcolor:4,htcompass:4,hysic:4,imag:[],immedi:[2,3,8],indic:3,individu:[3,4],infinit:3,infrare:4,input:[2,3,4,8],inputpars:[2,3,4,8],instal:6,installat:[],instanc:[3,4],instantan:[2,8],instead:[2,3,4,8],instruct:6,interfac:[2,8],intern:3,internalreset:3,interpret:3,intuit:6,isconnect:[2,8],isconnected:[2,8],isrun:3,iter:[],itself:[],keep:3,kind:3,lab:6,largemotor:4,last:3,later:[],layer:[3,4,6],lead:[],left:3,less:3,level:[2,3,4,6,8],licens:[],like:3,limit:3,limitmod:3,limitvalu:[2,3,5,8],listen:4,load:3,look:6,loop:3,low:[2,6,8],lower:3,mai:[2,3,4,8],mainli:4,make:3,mark:[2,3,4,8],master:3,matlab:[],mean:3,mediummotor:4,meet:6,messag:3,method:[2,3,4,8],millisecond:[2,3,8],mind:3,mode:[2,3,4,8],mostli:[3,6],motor:[],motora:[2,3,4,5,8],motorb:[2,3,8],motorc:[2,8],motord:[2,8],move:3,multipl:[2,3,4,8],name:[2,3,4,8],necessari:[2,8],need:[2,3,4,8],neg:3,next:3,none:4,note:[2,3,4,8],now:4,numer:[2,3,4,8],nxt:6,nxtcolor:4,nxtlight:4,nxtsound:4,nxttemperatur:4,nxttouch:4,nxtultrason:4,object:[2,3,4,8],off:[2,3,4,8],old:[],onc:[2,3,4,8],once:4,onli:[],only:[2,3,4,8],opcod:3,opposit:3,option:[2,3,4,8],optional:[2,3,4,8],other:[3,4],otherwis:3,output:[2,8],outputreadi:3,outputtest:[],packet:[2,3,8],paramet:[2,3,4,8],part:6,pass:[3,4],path:[2,8],paus:[2,8],percent:[2,3,8],percentag:[2,3,8],physic:[2,3,4,8],plai:[2,8],playton:[2,8],point:3,poll:3,port:[2,3,4,5,8],posit:3,possibl:[3,4],power:[2,3,4,5,8],preced:[2,3,4,8],pretti:3,previous:3,print:[2,8],probabl:3,program:3,properti:[2,3,4,8],prox:4,pull:3,push:4,rais:3,random:[2,5,8],rate:4,ratio:3,raw:4,reach:3,read:[2,3,4,6,8],reason:3,receiv:[2,3,8],red:4,reflect:4,regul:3,regular:3,releas:3,remot:4,repli:3,repres:[3,4],request:3,reset:[3,4],resetposit:3,resettachocount:3,respect:3,respons:3,result:3,rfcomm0:[2,3,4,8],rfcomm1:[2,8],rfcomm2:[2,8],right:[3,4],robot:[3,6],run:3,rwth:6,same:3,second:[2,8],secur:3,see:[2,3,4,8],seek:4,seem:[2,8],send:[2,3,6,8],sensor1:[2,4,5,8],sensor2:[2,8],sensor3:[2,8],sensor4:[2,8],sensor:[],sent:[2,8],serial:[2,8],serport:[2,3,4,8],set:[2,3,4,6,8],setbrak:3,setproperti:[2,3,4,5,8],setup:[2,8],sever:6,should:3,simplifi:6,slave:3,slow:3,slower:3,slowli:3,small:[2,8],smoothli:3,smoothstart:3,smoothstop:3,some:3,sometim:[],somewhat:3,sooner:[],sourc:[2,3,4,8],specifi:[3,4],speed:3,speedregul:3,spin:3,start:[2,3,5,6,8],state:3,statu:[2,3,8],still:3,stop:[2,3,8],stopallmotor:[2,8],stopton:[2,8],straight:3,string:[2,3,4,8],student:6,stuff:[2,3,8],sublay:[3,4],suppos:3,sync:3,syncedstart:3,syncedstop:3,synchron:3,syncmotor:3,syntax:[2,3,4,8],tacho:3,tachocount:3,tacholimit:3,take:[3,6],test:[2,3,8],than:3,them:[2,3,4,8],thi:[2,3,4,5,6,8],thoroughli:[2,8],time:3,timeout:3,tone:[2,8],toneplai:[2,8],too:3,toolbox:[],touch:4,tricki:3,turn:[2,3,4,8],turnratio:3,two:3,type:[2,3,4,8],ultrason:4,und:3,undefin:4,unexpect:[],unknown:4,until:3,use:3,user:[2,8],valu:[2,3,4,5,6,8],varargin:[2,3,4,8],variou:6,via:[2,3,4,6,8],view:[2,8],virtual:[2,8],voltag:[2,3,8],volum:[2,8],wai:6,waitfor:[2,3,5,8],want:6,wast:3,weird:3,what:[2,3,4,8],whatev:3,when:[2,3,4,8],which:[2,3,4,8],white:4,without:3,work:[2,3,4,8],workaround:3,would:[2,3,4,8],wrap:[],writable:[2,3,4,8],wrong:[2,8],yet:[2,8],you:[3,4,6],your:6},titles:["CommandLayer","CommunicationLayer","EV3","Motor","Sensor","Examples","MATLAB Toolbox for controlling Lego Mindstorms EV3","General","EV3"],titleterms:{bluetooth:1,command:0,commandlay:0,communicationinterfac:0,communicationlay:1,content:6,contribut:7,control:6,ev3:[2,6,8],exampl:5,gener:7,installat:7,lego:6,licens:7,matlab:6,mindstorm:6,motor:3,sensor:4,toolbox:6,usb:1}})
\ No newline at end of file
+Search.setIndex({envversion:49,filenames:["CommandLayer","CommunicationLayer","EV3","Motor","Sensor","btBrickIO","examples","hid","index","readme","source","usbBrickIO"],objects:{"":{source:[11,0,1,""]},"source.EV3":{batteryMode:[10,2,1,""],batteryValue:[10,2,1,""],beep:[10,3,1,""],connect:[10,3,1,""],debug:[10,2,1,""],disconnect:[10,3,1,""],isConnected:[10,2,1,""],motorA:[10,2,1,""],motorB:[10,2,1,""],motorC:[10,2,1,""],motorD:[10,2,1,""],playTone:[10,3,1,""],sensor1:[10,2,1,""],sensor2:[10,2,1,""],sensor3:[10,2,1,""],sensor4:[10,2,1,""],setProperties:[10,3,1,""],stopAllMotors:[10,3,1,""],stopTone:[10,3,1,""],tonePlayed:[10,3,1,""]},"source.Motor":{brakeMode:[3,2,1,""],currentSpeed:[3,2,1,""],debug:[3,2,1,""],internalReset:[3,3,1,""],isRunning:[3,2,1,""],limitMode:[3,2,1,""],limitValue:[3,2,1,""],power:[3,2,1,""],resetTachoCount:[3,3,1,""],setBrake:[3,3,1,""],setProperties:[3,3,1,""],smoothStart:[3,2,1,""],smoothStop:[3,2,1,""],speedRegulation:[3,2,1,""],start:[3,3,1,""],stop:[3,3,1,""],syncedStart:[3,3,1,""],syncedStop:[3,3,1,""],tachoCount:[3,2,1,""],type:[3,2,1,""],waitFor:[3,3,1,""]},"source.Sensor":{debug:[4,2,1,""],mode:[4,2,1,""],reset:[4,3,1,""],setProperties:[4,3,1,""],type:[4,2,1,""],value:[4,2,1,""]},"source.btBrickIO":{backend:[5,2,1,""],channel:[5,2,1,""],close:[5,3,1,""],debug:[5,2,1,""],deviceName:[5,2,1,""],open:[5,3,1,""],read:[5,3,1,""],serialPort:[5,2,1,""],setProperties:[5,3,1,""],timeOut:[5,2,1,""],write:[5,3,1,""]},"source.hidapi":{close:[7,3,1,""],enumerate:[7,3,1,""],error:[7,3,1,""],exit:[7,3,1,""],getHIDInfoString:[7,3,1,""],getManufacturersString:[7,3,1,""],getProductString:[7,3,1,""],getSerialNumberString:[7,3,1,""],handle:[7,2,1,""],init:[7,3,1,""],nReadBuffer:[7,2,1,""],nWriteBuffer:[7,2,1,""],open:[7,3,1,""],productID:[7,2,1,""],read:[7,3,1,""],read_timeout:[7,3,1,""],setNonBlocking:[7,3,1,""],sheader:[7,2,1,""],slib:[7,2,1,""],vendorID:[7,2,1,""],write:[7,3,1,""]},"source.usbBrickIO":{close:[11,3,1,""],debug:[11,2,1,""],nReadBuffer:[11,2,1,""],nWriteBuffer:[11,2,1,""],open:[11,3,1,""],productID:[11,2,1,""],read:[11,3,1,""],setProperties:[11,3,1,""],timeOut:[11,2,1,""],vendorID:[11,2,1,""],write:[11,3,1,""]},source:{EV3:[10,1,1,""],Motor:[3,1,1,""],Sensor:[4,1,1,""],btBrickIO:[5,1,1,""],hidapi:[7,1,1,""],usbBrickIO:[11,1,1,""]}},objnames:{"0":["mat","module","MATLAB module"],"1":["mat","class","MATLAB class"],"2":["mat","attribute","MATLAB attribute"],"3":["mat","method","MATLAB method"]},objtypes:{"0":"mat:module","1":"mat:class","2":"mat:attribute","3":"mat:method"},terms:{"0x0005":11,"0x694":11,"2nd":[2,3,4,10],"5000hz":[2,10],"abstract":8,"byte":[7,11],"case":[3,11],"catch":3,"char":7,"class":[2,3,4,5,7,8,10,11],"default":[4,5,7,11],"final":7,"function":[3,7],"long":3,"null":7,"return":[2,3,5,7,10,11],"throw":7,"true":[2,3,5,10,11],"try":[3,5,11],"while":8,aachen:8,abl:8,about:[2,3,4,7,10],acceler:[3,4],accelerationallax:4,access:8,accident:[2,10],act:3,action:3,actual:[3,7,11],addit:7,advanc:8,affect:3,after:[3,5,7,11],afterward:3,again:3,all:[2,3,4,7,10,11],allow:4,alreadi:7,also:[2,3,4,5,7,10,11],alternatingli:[],alwai:[7,11],ambient:4,angular:4,ani:[3,11],announc:[2,3,4,10],anoth:3,append:7,apply:3,aren:3,argument:[2,3,4,10],around:3,arrai:[5,11],automat:[2,3,4,5,7,10],avail:[4,7],backend:5,base:5,batteri:[2,10],batterymod:[2,3,10],batterymode:[2,10],batteryvalu:[2,10],been:[2,3,4,5,10],beep:[2,6,10],befor:5,behav:3,behaviour:8,besid:11,better:3,between:[3,5,7,11],bigger:[7,11],bit:3,block:7,blue:4,bool:[2,3,4,5,10,11],both:3,brake:3,brakemod:3,brakemode:3,brick:[2,3,4,5,8,10,11],brickio:[5,11],brickobject:[2,3,4,10],buffer:[7,11],buggi:[],building:[],bump:4,c_output:3,call:[2,3,4,5,7,10,11],can:[3,4,5,8],car:3,cast:7,central:[2,10],chang:3,channel:5,charg:[2,10],check:[3,7],chosen:5,clear:4,close:[5,7,11],coast:3,code:4,col:4,color:4,com:[2,10],comm:[],comment:3,commerror:7,commhandl:[5,11],commun:[3,4,7,8],compil:7,connect:[2,3,4,5,6,7,10,11],connectiontyp:[2,10],consist:[3,4],consol:[2,3,4,5,10,11],constantli:3,constructor:11,contain:[2,3,4,10],continu:3,contribut:[],control:[],conveni:[2,10],correctli:3,correspond:7,could:[5,7,11],count:3,counter:3,cours:3,creat:[2,3,4,7,10],current:[2,3,4,10],currentspe:3,data:[5,7,11],dba:4,debug:[2,3,4,5,10,11],decim:7,defin:3,degre:[3,4],delet:[2,6,7,10],deliv:[2,10],depend:[2,3,4,5,7,10],design:8,destroi:[2,10],dev:[2,3,4,5,10],develop:[7,8],devic:[3,5,7,11],devicemod:4,devicenam:5,devicename:5,devicetyp:[3,4],differ:[2,7,10],direct:3,directli:[7,8],disabl:7,disconnect:[2,10],disp:[2,6,10],distcm:4,distin:4,dll:7,document:8,documentation:[],doe:[2,3,7,10,11],doesn:[],don:[3,4],done:3,down:3,durat:[2,10],dure:7,dylib:7,each:[2,3,4,5,10,11],eas:3,easili:8,either:[2,3,10],enabl:[2,7,10,11],enumer:7,equal:[2,3,10],error:[3,4,5,7,11],establish:[2,10],even:3,eventu:11,everytim:[3,4],exampl:[],execut:3,exit:7,expect:[2,6,10],explicitli:7,extens:7,facilit:4,fals:[3,5,11],far:3,fclose:5,feedback:[2,3,4,10],file:7,finish:3,firmwar:[2,3,10],first:[2,3,10],flag:7,follow:[2,3,4,5,8,10,11],fopen:5,format:[5,11],forward:3,four:3,fread:5,frequenc:[2,10],from:[2,3,4,5,7,10,11],front:7,fun:[2,6,10],fwrite:5,gener:[],germani:8,get:[2,3,7,8,10],gethidinfostr:7,getmanufacturersstr:7,getmanufacturersstring:7,getproductstr:7,getproductstring:7,getserialnumberstr:7,getserialnumberstring:7,given:[2,3,4,7,10],glanc:[2,10],goe:3,greater:3,green:4,gyro:4,handl:7,happen:3,have:[2,3,7,10],header:7,heavi:3,henc:5,here:3,hertz:[2,10],hid:[7,11],hid_device_infoptr:7,hid_open:7,hidapi:[],hidhandl:7,high:[2,3,4,8,10],highest:3,hold:3,host:[5,7],how:3,htacceleromet:4,htcolor:4,htcompass:4,http:7,hysic:4,imag:[],immedi:[2,3,10],implement:[5,11],indic:3,individu:[3,4],infinit:3,info:7,inform:[5,7],infrare:4,init:7,input:[2,3,4,10],inputpars:[2,3,4,5,10,11],instal:[7,8],installat:[],instanc:[3,4,7],instantan:[2,10],instead:[2,3,4,10],instruct:8,instrument:5,instrumentcontrol:5,int32:7,interfac:[2,5,7,10,11],intern:3,internalreset:3,interpret:3,intuit:8,invalid:7,invalidhandl:7,isconnect:[2,10],isconnected:[2,10],isrun:3,iter:[],itself:7,keep:3,kind:3,know:7,lab:8,largemotor:4,last:3,later:[],layer:[3,4,8],lead:[],left:3,length:7,less:3,level:[2,3,4,8,10],librari:[7,11],licens:[],like:3,limit:3,limitmod:3,limitvalu:[2,3,6,10],linux:[5,7],list:[2,3,4,5,7,10,11],listen:4,load:3,look:8,loop:3,low:[2,8,10],lower:3,mac:[5,7],made:5,mai:[2,3,4,10],mainli:4,make:3,manufactur:7,mark:[2,3,4,10],master:3,matlab:[],maximum:11,mean:3,mediummotor:4,meet:8,messag:3,meth:[],method:[2,3,4,5,7,10,11],millisecond:[2,3,7,10,11],mind:3,mismatch:7,mode:[2,3,4,10],modul:5,mostli:[3,8],motor:[],motora:[2,3,4,6,10],motorb:[2,3,10],motorc:[2,10],motord:[2,10],move:3,multipl:[2,3,4,5,10,11],must:7,myev3:5,name:[2,3,4,5,7,10],nearli:11,necessari:[2,10],need:[2,3,4,5,7,10,11],neg:3,next:3,non:7,nonblock:7,none:4,note:[2,3,4,5,7,10,11],now:4,nreadbuff:[7,11],nreadbuffer:11,number:7,numer:[2,3,4,5,7,10,11],nwritebuff:[7,11],nwritebuffer:11,nxt:8,nxtcolor:4,nxtlight:4,nxtsound:4,nxttemperatur:4,nxttouch:4,nxtultrason:4,object:[2,3,4,5,7,10],occur:[5,7,11],off:[2,3,4,10],old:[],onc:[2,3,4,5,10,11],once:4,onli:[],only:[2,3,4,5,10],opcod:3,open:[5,7,11],opposit:3,option:[2,3,4,5,10,11],optional:[2,3,4,10],oss:7,other:[3,4],otherwis:3,output:[2,10,11],outputreadi:3,outputtest:[],packet:[2,3,5,7,10,11],pair:5,paramet:[2,3,4,5,7,10,11],part:8,pass:[3,4],path:[2,5,10],paus:[2,10],percent:[2,3,10],percentag:[2,3,10],physic:[2,3,4,10],plai:[2,10],playton:[2,10],point:3,pointer:7,poll:3,port:[2,3,4,5,6,10],posit:3,possibl:[3,4,7],potenti:5,power:[2,3,4,6,10],preced:[2,3,4,10],pretti:3,previous:3,print:[2,7,10],probabl:3,produc:7,product:[7,11],productid:[7,11],program:3,properti:[2,3,4,5,10,11],propertyname1:[5,11],propertyname2:[5,11],propertyvalue1:[5,11],propertyvalue2:[5,11],prox:4,pull:3,push:4,rais:3,random:[2,6,10],rate:4,ratio:3,raw:4,reach:3,read:[2,3,4,5,7,8,10,11],read_timeout:7,reason:3,receiv:[2,3,10],red:4,reflect:4,regul:3,regular:3,releas:3,remot:4,repli:3,report:7,reportid:7,repres:[3,4],request:3,reset:[3,4],resetposit:3,resettachocount:3,resiz:7,respect:3,respons:3,result:3,rfcomm0:[2,3,4,5,10],rfcomm1:[2,10],rfcomm2:[2,10],right:[3,4],robot:[3,8],run:3,rwth:8,same:3,second:[2,5,10],secur:3,see:[2,3,4,5,7,10,11],seek:4,seem:[2,10],send:[2,3,8,10],sensor1:[2,4,6,10],sensor2:[2,10],sensor3:[2,10],sensor4:[2,10],sensor:[],sent:[2,10],serial:[2,5,7,10],serialport:5,serport:[2,3,4,5,10],set:[2,3,4,5,7,8,10,11],setbrak:3,setnonblock:7,setproperti:[2,3,4,5,6,10,11],setup:[2,10],sever:8,share:7,sheader:7,should:[3,7,11],shown:5,signal11:7,simplifi:8,size:[7,11],slave:3,slib:7,slow:3,slower:3,slowli:3,small:[2,10],smoothli:3,smoothstart:3,smoothstop:3,some:[3,7],sometim:[],somewhat:3,sooner:[],sourc:[2,3,4,5,7,10,11],specifi:[3,4],speed:3,speedregul:3,spin:3,start:[2,3,6,8,10],state:3,statu:[2,3,10],still:3,stop:[2,3,10],stopallmotor:[2,10],stopton:[2,10],straight:3,string:[2,3,4,5,7,10],struct:7,student:8,stuff:[2,3,10],sublay:[3,4],success:7,suppos:3,sure:5,sync:3,syncedstart:3,syncedstop:3,synchron:3,syncmotor:3,syntax:[2,3,4,5,10,11],system:[5,7],tacho:3,tachocount:3,tacholimit:3,take:[3,8],temp:[],test:[2,3,5,10],than:[3,7,11],them:[2,3,4,10],thi:[2,3,4,5,6,7,8,10],think:7,thoroughli:[2,10],through:[5,11],time:3,timeout:[3,5,7,11],tone:[2,10],toneplai:[2,10],too:3,toolbox:[],touch:4,tricki:3,turn:[2,3,4,10],turnratio:3,two:3,type:[2,3,4,7,10],uint16:7,uint8:[5,7,11],ultrason:4,und:3,undefin:4,unexpect:[],unexpectedli:7,unknown:4,until:3,usage:5,usbbrickio:[],use:[3,11],user:[2,10],using:7,valid:[5,7,11],valu:[2,3,4,6,7,8,10],varargin:[2,3,4,5,10,11],variou:8,vendor:[7,11],vendorid:[7,11],via:[2,3,4,5,8,10,11],view:[2,10],virtual:[2,10],voltag:[2,3,10],volum:[2,10],wai:8,waitfor:[2,3,6,10],want:8,wast:3,weird:3,what:[2,3,4,10],whatev:3,when:[2,3,4,5,7,10,11],which:[2,3,4,5,7,10,11],white:4,window:[5,7],without:[3,7],wmsg:[5,7,11],work:[2,3,4,10,11],workaround:3,would:[2,3,4,10],wrap:[],writable:[2,3,4,10],write:[5,7,11],written:[5,7,11],wrong:[2,10],www:7,xcode:7,yet:[2,10],you:[3,4,7,8,11],your:8},titles:["CommandLayer","CommunicationLayer","EV3","Motor","Sensor","btBrickIO","Examples","hidapi","MATLAB Toolbox for controlling Lego Mindstorms EV3","General","EV3","usbBrickIO"],titleterms:{bluetooth:1,btbrickio:5,command:0,commandlay:0,communicationinterfac:0,communicationlay:1,content:8,contribut:9,control:8,ev3:[2,8,10],exampl:6,gener:9,hidapi:7,installat:9,lego:8,licens:9,matlab:8,mindstorm:8,motor:3,sensor:4,toolbox:8,usb:1,usbbrickio:11}})
\ No newline at end of file
diff --git a/docs/_build/html/source.html b/docs/_build/html/source.html
index 2a43839969e7b7b44e135e3994ee70b8436ae1e3..375b9f9e271c42b12600e7cdd9d5c1e7b9cd9558 100644
--- a/docs/_build/html/source.html
+++ b/docs/_build/html/source.html
@@ -75,8 +75,9 @@
 <li class="toctree-l1"><a class="reference internal" href="Sensor.html">Sensor</a></li>
 </ul>
 <ul>
-<li class="toctree-l1"><a class="reference internal" href="CommandLayer.html">CommandLayer</a></li>
-<li class="toctree-l1"><a class="reference internal" href="CommunicationLayer.html">CommunicationLayer</a></li>
+<li class="toctree-l1"><a class="reference internal" href="hid.html">hidapi</a></li>
+<li class="toctree-l1"><a class="reference internal" href="usbBrickIO.html">usbBrickIO</a></li>
+<li class="toctree-l1"><a class="reference internal" href="btBrickIO.html">btBrickIO</a></li>
 </ul>
 </ul>
 </li>
@@ -135,7 +136,21 @@
 <dl class="class">
 <dt id="source.EV3">
 <em class="property">class </em><code class="descclassname">source.</code><code class="descname">EV3</code><span class="sig-paren">(</span><em>varargin</em><span class="sig-paren">)</span><a class="headerlink" href="#source.EV3" title="Permalink to this definition">¶</a></dt>
-<dd><p>High-level class to work with physical bricks.</p>
+<dd><dl class="docutils">
+<dt><em>List of methods</em>:</dt>
+<dd><ul class="first last simple">
+<li><a class="reference internal" href="#source.EV3.connect" title="source.EV3.connect"><code class="xref mat mat-meth docutils literal"><span class="pre">connect()</span></code></a></li>
+<li><a class="reference internal" href="#source.EV3.disconnect" title="source.EV3.disconnect"><code class="xref mat mat-meth docutils literal"><span class="pre">disconnect()</span></code></a></li>
+<li><a class="reference internal" href="#source.EV3.stopAllMotors" title="source.EV3.stopAllMotors"><code class="xref mat mat-meth docutils literal"><span class="pre">stopAllMotors()</span></code></a></li>
+<li><a class="reference internal" href="#source.EV3.beep" title="source.EV3.beep"><code class="xref mat mat-meth docutils literal"><span class="pre">beep()</span></code></a></li>
+<li><a class="reference internal" href="#source.EV3.playTone" title="source.EV3.playTone"><code class="xref mat mat-meth docutils literal"><span class="pre">playTone()</span></code></a></li>
+<li><a class="reference internal" href="#source.EV3.stopTone" title="source.EV3.stopTone"><code class="xref mat mat-meth docutils literal"><span class="pre">stopTone()</span></code></a></li>
+<li><a class="reference internal" href="#source.EV3.tonePlayed" title="source.EV3.tonePlayed"><code class="xref mat mat-meth docutils literal"><span class="pre">tonePlayed()</span></code></a></li>
+<li><a class="reference internal" href="#source.EV3.setProperties" title="source.EV3.setProperties"><code class="xref mat mat-meth docutils literal"><span class="pre">setProperties()</span></code></a></li>
+</ul>
+</dd>
+</dl>
+<p>High-level class to work with physical bricks.</p>
 <p>This is the &#8216;central&#8217; class (from user&#8217;s view) when working with this toolbox. It
 delivers a convenient interface for creating a connection to the brick and sending
 commands to it. An EV3-object creates 4 Motor- and 4 Sensor-objects, one for each port.</p>
@@ -305,7 +320,7 @@ b.disconnect(); % <br /></p>
 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
 <li><strong>volume</strong> (<em>numeric in [0, 100]</em>) &#8211; in percent</li>
 <li><strong>frequency</strong> (<em>numeric in [250, 10000]</em>) &#8211; in Hertz</li>
-<li><strong>duration</strong> (<em>numeric &gt;0</em>) &#8211; in milliseconds</li>
+<li><strong>duration</strong> (<em>numeric &gt; 0</em>) &#8211; in milliseconds</li>
 </ul>
 </td>
 </tr>
diff --git a/docs/_build/html/test.html b/docs/_build/html/test.html
new file mode 100644
index 0000000000000000000000000000000000000000..50e55fbfa85e2276a11515d77c10c6e88f409b75
--- /dev/null
+++ b/docs/_build/html/test.html
@@ -0,0 +1,445 @@
+<!DOCTYPE html>
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>hidapi &#8212; Mindstorms EV3 Toolbox v0.4-rc.10 documentation</title>
+    
+    <link rel="stylesheet" href="_static/basic.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <link rel="stylesheet" href="_static/bootswatch-3.3.6/readable/bootstrap.min.css" type="text/css" />
+    <link rel="stylesheet" href="_static/bootstrap-sphinx.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    './',
+        VERSION:     'v0.4-rc.10',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="_static/js/jquery-1.11.0.min.js"></script>
+    <script type="text/javascript" src="_static/js/jquery-fix.js"></script>
+    <script type="text/javascript" src="_static/bootstrap-3.3.6/js/bootstrap.min.js"></script>
+    <script type="text/javascript" src="_static/bootstrap-sphinx.js"></script>
+    <link rel="index" title="Index" href="genindex.html" />
+    <link rel="search" title="Search" href="search.html" />
+    <link rel="top" title="Mindstorms EV3 Toolbox v0.4-rc.10 documentation" href="index.html" />
+    <link rel="next" title="usbBrickIO" href="usbBrickIO.html" />
+    <link rel="prev" title="Sensor" href="Sensor.html" />
+<meta charset='utf-8'>
+<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
+<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
+<meta name="apple-mobile-web-app-capable" content="yes">
+
+  </head>
+  <body role="document">
+
+  <div id="navbar" class="navbar navbar-default navbar-fixed-top">
+    <div class="container">
+      <div class="navbar-header">
+        <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
+        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+        </button>
+        <a class="navbar-brand" href="index.html">
+          Mindstorms EV3 Toolbox</a>
+        <span class="navbar-text navbar-version pull-left"><b>v0.4</b></span>
+      </div>
+
+        <div class="collapse navbar-collapse nav-collapse">
+          <ul class="nav navbar-nav">
+            
+            
+              <li class="dropdown globaltoc-container">
+  <a role="button"
+     id="dLabelGlobalToc"
+     data-toggle="dropdown"
+     data-target="#"
+     href="index.html">Site <b class="caret"></b></a>
+  <ul class="dropdown-menu globaltoc"
+      role="menu"
+      aria-labelledby="dLabelGlobalToc"><ul>
+<li class="toctree-l1"><a class="reference internal" href="readme.html">General</a></li>
+<li class="toctree-l1"><a class="reference internal" href="examples.html">Examples</a></li>
+</ul>
+<ul>
+<li class="toctree-l1"><a class="reference internal" href="EV3.html">EV3</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Motor.html">Motor</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Sensor.html">Sensor</a></li>
+</ul>
+<ul class="current">
+<li class="toctree-l1 current"><a class="current reference internal" href="#">hidapi</a></li>
+<li class="toctree-l1"><a class="reference internal" href="usbBrickIO.html">usbBrickIO</a></li>
+<li class="toctree-l1"><a class="reference internal" href="btBrickIO.html">btBrickIO</a></li>
+</ul>
+</ul>
+</li>
+              
+                <li class="dropdown">
+  <a role="button"
+     id="dLabelLocalToc"
+     data-toggle="dropdown"
+     data-target="#"
+     href="#">Page <b class="caret"></b></a>
+  <ul class="dropdown-menu localtoc"
+      role="menu"
+      aria-labelledby="dLabelLocalToc"><ul>
+<li><a class="reference internal" href="#">hidapi</a></li>
+</ul>
+</ul>
+</li>
+              
+            
+            
+              
+                
+  <li>
+    <a href="Sensor.html" title="Previous Chapter: Sensor"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">&laquo; Sensor</span>
+    </a>
+  </li>
+  <li>
+    <a href="usbBrickIO.html" title="Next Chapter: usbBrickIO"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">usbBrickIO &raquo;</span>
+    </a>
+  </li>
+              
+            
+            
+            
+            
+              <li class="hidden-sm">
+<div id="sourcelink">
+  <a href="_sources/test.txt"
+     rel="nofollow">Source</a>
+</div></li>
+            
+          </ul>
+
+          
+            
+<form class="navbar-form navbar-right" action="search.html" method="get">
+ <div class="form-group">
+  <input type="text" name="q" class="form-control" placeholder="Search" />
+ </div>
+  <input type="hidden" name="check_keywords" value="yes" />
+  <input type="hidden" name="area" value="default" />
+</form>
+          
+        </div>
+    </div>
+  </div>
+
+<div class="container">
+  <div class="row">
+    <div class="col-md-12 content">
+      
+  <span class="target" id="module-source"></span><div class="section" id="hidapi">
+<h1>hidapi<a class="headerlink" href="#hidapi" title="Permalink to this headline">¶</a></h1>
+<dl class="class">
+<dt id="source.hidapi">
+<em class="property">class </em><code class="descclassname">source.</code><code class="descname">hidapi</code><span class="sig-paren">(</span><em>vendorID</em>, <em>productID</em>, <em>nReadBuffer</em>, <em>nWriteBuffer</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi" title="Permalink to this definition">¶</a></dt>
+<dd><p>Interface to the hidapi library</p>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>Developed from the hidapi available at <a class="reference external" href="http://www.signal11.us/oss/hidapi/">http://www.signal11.us/oss/hidapi/</a>.</li>
+<li>Windows: hidapi.dll needed.</li>
+<li>Mac: hidapi.dylib needed. In addition, Xcode has to be installed.</li>
+<li>Linux: hidapi has to be compiled on host-system.</li>
+</ul>
+<dl class="attribute">
+<dt id="source.hidapi.handle">
+<code class="descname">handle</code><a class="headerlink" href="#source.hidapi.handle" title="Permalink to this definition">¶</a></dt>
+<dd></dd></dl>
+
+<dl class="attribute">
+<dt id="source.hidapi.vendorID">
+<code class="descname">vendorID</code><a class="headerlink" href="#source.hidapi.vendorID" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>numeric</em> &#8211; Vendor-ID of the USB device.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.hidapi.productID">
+<code class="descname">productID</code><a class="headerlink" href="#source.hidapi.productID" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>numeric</em> &#8211; Product-ID of the USB device.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.hidapi.nReadBuffer">
+<code class="descname">nReadBuffer</code><a class="headerlink" href="#source.hidapi.nReadBuffer" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>numeric</em> &#8211; Read-buffer size in bytes.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.hidapi.nWriteBuffer">
+<code class="descname">nWriteBuffer</code><a class="headerlink" href="#source.hidapi.nWriteBuffer" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>numeric</em> &#8211; Write-buffer size in bytes. Needs to be 1 Byte bigger than
+actual packet.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.hidapi.slib">
+<code class="descname">slib</code><a class="headerlink" href="#source.hidapi.slib" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>string</em> &#8211; Name of shared library file (without file extension). Defaults to
+&#8216;hidapi&#8217;.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.hidapi.sheader">
+<code class="descname">sheader</code><a class="headerlink" href="#source.hidapi.sheader" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>string</em> &#8211; Name of shared library header. Defaults to &#8216;hidapi.h&#8217;.</p>
+</dd></dl>
+
+<p class="rubric">Example</p>
+<p>hidHandle = hidapi(1684,0005,1024,1025); %|br|</p>
+<dl class="method">
+<dt id="source.hidapi.close">
+<code class="descname">close</code><span class="sig-paren">(</span><em>hid</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.close" title="Permalink to this definition">¶</a></dt>
+<dd><p>Close the connection to a hid device.</p>
+<dl class="docutils">
+<dt>Throws:</dt>
+<dd>InvalidHandle: Handle to USB-device not valid</dd>
+</dl>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>Gets called automatically when deleting the hidapi instance.</li>
+</ul>
+<ol class="upperroman simple" start="2001">
+<li>Check if pointer is (unexpectedly) already invalidated</li>
+</ol>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.enumerate">
+<code class="descname">enumerate</code><span class="sig-paren">(</span><em>hid</em>, <em>vendorID</em>, <em>productID</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.enumerate" title="Permalink to this definition">¶</a></dt>
+<dd><p>Enumerates the info about the hid device with the given vendorID and productID
+and returns a string with the returned hid information.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
+<li><strong>vendorID</strong> (<em>numeric</em>) &#8211; Vendor-ID of the USB device in decimal.</li>
+<li><strong>productID</strong> (<em>numeric</em>) &#8211; Product-ID of the USB device in decimal.</li>
+</ul>
+</td>
+</tr>
+</tbody>
+</table>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>Using a vendorID and productID of (0,0) will enumerate all connected hid
+devices.</li>
+<li>MATLAB does not have the hid_device_infoPtr struct so some of the returned
+information will need to be resized and cast into uint8 or chars.</li>
+</ul>
+<p>Enumerate the hid devices</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.error">
+<code class="descname">error</code><span class="sig-paren">(</span><em>hid</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.error" title="Permalink to this definition">¶</a></dt>
+<dd><p>Return the hid device error string if a function produced an error.</p>
+<dl class="docutils">
+<dt>Throws:</dt>
+<dd>InvalidHandle: Handle to USB-device not valid</dd>
+</dl>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>This function must be called explicitly if you think an error was generated
+from the hid device.</li>
+</ul>
+<ol class="upperroman simple" start="2001">
+<li>Check if pointer is (unexpectedly) already invalidated</li>
+</ol>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.exit">
+<code class="descname">exit</code><span class="sig-paren">(</span><em>hid</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.exit" title="Permalink to this definition">¶</a></dt>
+<dd><p>hidapi.exit Exit hidapi</p>
+<p>hid.exit() exits the hidapi library.</p>
+<dl class="docutils">
+<dt>Throws:</dt>
+<dd>CommError: Error during communication with device</dd>
+</dl>
+<p>Notes::
+- You should not have to call this function directly.</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.getHIDInfoString">
+<code class="descname">getHIDInfoString</code><span class="sig-paren">(</span><em>hid</em>, <em>info</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.getHIDInfoString" title="Permalink to this definition">¶</a></dt>
+<dd><p>Get the corresponding hid info from the hid device.</p>
+<dl class="docutils">
+<dt>Throws:</dt>
+<dd>CommError: Error during communication with device
+InvalidHandle: Handle to USB-device not valid</dd>
+</dl>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>Info is the hid information string.</li>
+</ul>
+<p>See also HIDAPI.GETMANUFACTURERSSTRING, HIDAPI.GETPRODUCTSTRING,
+HIDAPI.GETSERIALNUMBERSTRING.</p>
+<p>Read buffer nReadBuffer length</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.getManufacturersString">
+<code class="descname">getManufacturersString</code><span class="sig-paren">(</span><em>hid</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.getManufacturersString" title="Permalink to this definition">¶</a></dt>
+<dd><p>Get manufacturers string from hid object using getHIDInfoString.</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.getProductString">
+<code class="descname">getProductString</code><span class="sig-paren">(</span><em>hid</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.getProductString" title="Permalink to this definition">¶</a></dt>
+<dd><p>Get product string from hid object using getProductString.</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.getSerialNumberString">
+<code class="descname">getSerialNumberString</code><span class="sig-paren">(</span><em>hid</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.getSerialNumberString" title="Permalink to this definition">¶</a></dt>
+<dd><p>Get serial number from hid object using getSerialNumberString.</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.init">
+<code class="descname">init</code><span class="sig-paren">(</span><em>hid</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.init" title="Permalink to this definition">¶</a></dt>
+<dd><p>Inits the hidapi library.</p>
+<dl class="docutils">
+<dt>Throws:</dt>
+<dd>CommError: Error during communication with device</dd>
+</dl>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>This is called automatically in the library itself with the open function. You
+should not have to call this function directly.</li>
+</ul>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.open">
+<code class="descname">open</code><span class="sig-paren">(</span><em>hid</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.open" title="Permalink to this definition">¶</a></dt>
+<dd><p>Open a connection with a hid device</p>
+<dl class="docutils">
+<dt>Throws:</dt>
+<dd>CommError: Error during communication with device</dd>
+</dl>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>Gets called automatically when creating an hidapi-object.</li>
+<li>The pointer return value from this library call is always null so it is not
+possible to know if the open was successful.</li>
+<li>The final parameter to the open hidapi library call has different types
+depending on OS. On windows it is uint16, on linux/mac int32.</li>
+</ul>
+<p>Create a null pointer for the hid_open function (depends on OS)</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.read">
+<code class="descname">read</code><span class="sig-paren">(</span><em>hid</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.read" title="Permalink to this definition">¶</a></dt>
+<dd><p>Read from a hid device and returns the read bytes.</p>
+<dl class="docutils">
+<dt>Throws:</dt>
+<dd>CommError: Error during communication with device
+InvalidHandle: Handle to USB-device not valid</dd>
+</dl>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>Will print an error if no data was read.</li>
+</ul>
+<p>Read buffer of nReadBuffer length</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.read_timeout">
+<code class="descname">read_timeout</code><span class="sig-paren">(</span><em>hid</em>, <em>timeOut</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.read_timeout" title="Permalink to this definition">¶</a></dt>
+<dd><p>Read from a hid device with a timeout and return the read bytes.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>timeOut</strong> (<em>numeric &gt;= 0</em>) &#8211; Milliseconds after which a timeout-error occurs if no
+packet could be read.</td>
+</tr>
+</tbody>
+</table>
+<dl class="docutils">
+<dt>Throws:</dt>
+<dd>CommError: Error during communication with device
+InvalidHandle: Handle to USB-device not valid</dd>
+</dl>
+<p>Read buffer of nReadBuffer length</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.setNonBlocking">
+<code class="descname">setNonBlocking</code><span class="sig-paren">(</span><em>hid</em>, <em>nonblock</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.setNonBlocking" title="Permalink to this definition">¶</a></dt>
+<dd><p>Set the non blocking flag on the hid device connection.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>nonblock</strong> (<em>numeric in {0,1}</em>) &#8211; 0 disables nonblocking, 1 enables nonblocking</td>
+</tr>
+</tbody>
+</table>
+<dl class="docutils">
+<dt>Throws:</dt>
+<dd>CommError: Error during communication with device
+InvalidHandle: Handle to USB-device not valid</dd>
+</dl>
+<ol class="upperroman simple" start="2001">
+<li>Check if pointer is (unexpectedly) already invalidated</li>
+</ol>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.hidapi.write">
+<code class="descname">write</code><span class="sig-paren">(</span><em>hid</em>, <em>wmsg</em>, <em>reportID</em><span class="sig-paren">)</span><a class="headerlink" href="#source.hidapi.write" title="Permalink to this definition">¶</a></dt>
+<dd><p>Write to a hid device.</p>
+<dl class="docutils">
+<dt>Throws:</dt>
+<dd>CommError: Error during communication with device
+InvalidHandle: Handle to USB-device not valid</dd>
+</dl>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>Will print an error if there is a mismatch between the buffer size and the
+reported number of bytes written.</li>
+</ul>
+<p>Append a 0 at the front for HID report ID</p>
+</dd></dl>
+
+</dd></dl>
+
+</div>
+
+
+    </div>
+      
+  </div>
+</div>
+<footer class="footer">
+  <div class="container">
+    <p class="pull-right">
+      <a href="#">Back to top</a>
+      
+    </p>
+    <p>
+        &copy; Copyright 2016, LfB - RWTH Aachen.<br/>
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.8.<br/>
+    </p>
+  </div>
+</footer>
+  </body>
+</html>
\ No newline at end of file
diff --git a/docs/_build/html/usbBrickIO.html b/docs/_build/html/usbBrickIO.html
new file mode 100644
index 0000000000000000000000000000000000000000..c539f81b082f9eab9f2803b1becabf8ae97ec64f
--- /dev/null
+++ b/docs/_build/html/usbBrickIO.html
@@ -0,0 +1,277 @@
+<!DOCTYPE html>
+
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    
+    <title>usbBrickIO &#8212; Mindstorms EV3 Toolbox v0.4-rc.10 documentation</title>
+    
+    <link rel="stylesheet" href="_static/basic.css" type="text/css" />
+    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+    <link rel="stylesheet" href="_static/bootswatch-3.3.6/readable/bootstrap.min.css" type="text/css" />
+    <link rel="stylesheet" href="_static/bootstrap-sphinx.css" type="text/css" />
+    
+    <script type="text/javascript">
+      var DOCUMENTATION_OPTIONS = {
+        URL_ROOT:    './',
+        VERSION:     'v0.4-rc.10',
+        COLLAPSE_INDEX: false,
+        FILE_SUFFIX: '.html',
+        HAS_SOURCE:  true
+      };
+    </script>
+    <script type="text/javascript" src="_static/jquery.js"></script>
+    <script type="text/javascript" src="_static/underscore.js"></script>
+    <script type="text/javascript" src="_static/doctools.js"></script>
+    <script type="text/javascript" src="_static/js/jquery-1.11.0.min.js"></script>
+    <script type="text/javascript" src="_static/js/jquery-fix.js"></script>
+    <script type="text/javascript" src="_static/bootstrap-3.3.6/js/bootstrap.min.js"></script>
+    <script type="text/javascript" src="_static/bootstrap-sphinx.js"></script>
+    <link rel="index" title="Index" href="genindex.html" />
+    <link rel="search" title="Search" href="search.html" />
+    <link rel="top" title="Mindstorms EV3 Toolbox v0.4-rc.10 documentation" href="index.html" />
+    <link rel="next" title="btBrickIO" href="btBrickIO.html" />
+    <link rel="prev" title="hidapi" href="hid.html" />
+<meta charset='utf-8'>
+<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
+<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
+<meta name="apple-mobile-web-app-capable" content="yes">
+
+  </head>
+  <body role="document">
+
+  <div id="navbar" class="navbar navbar-default navbar-fixed-top">
+    <div class="container">
+      <div class="navbar-header">
+        <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
+        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+        </button>
+        <a class="navbar-brand" href="index.html">
+          Mindstorms EV3 Toolbox</a>
+        <span class="navbar-text navbar-version pull-left"><b>v0.4</b></span>
+      </div>
+
+        <div class="collapse navbar-collapse nav-collapse">
+          <ul class="nav navbar-nav">
+            
+            
+              <li class="dropdown globaltoc-container">
+  <a role="button"
+     id="dLabelGlobalToc"
+     data-toggle="dropdown"
+     data-target="#"
+     href="index.html">Site <b class="caret"></b></a>
+  <ul class="dropdown-menu globaltoc"
+      role="menu"
+      aria-labelledby="dLabelGlobalToc"><ul>
+<li class="toctree-l1"><a class="reference internal" href="readme.html">General</a></li>
+<li class="toctree-l1"><a class="reference internal" href="examples.html">Examples</a></li>
+</ul>
+<ul>
+<li class="toctree-l1"><a class="reference internal" href="EV3.html">EV3</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Motor.html">Motor</a></li>
+<li class="toctree-l1"><a class="reference internal" href="Sensor.html">Sensor</a></li>
+</ul>
+<ul class="current">
+<li class="toctree-l1"><a class="reference internal" href="hid.html">hidapi</a></li>
+<li class="toctree-l1 current"><a class="current reference internal" href="#">usbBrickIO</a></li>
+<li class="toctree-l1"><a class="reference internal" href="btBrickIO.html">btBrickIO</a></li>
+</ul>
+</ul>
+</li>
+              
+                <li class="dropdown">
+  <a role="button"
+     id="dLabelLocalToc"
+     data-toggle="dropdown"
+     data-target="#"
+     href="#">Page <b class="caret"></b></a>
+  <ul class="dropdown-menu localtoc"
+      role="menu"
+      aria-labelledby="dLabelLocalToc"><ul>
+<li><a class="reference internal" href="#">usbBrickIO</a></li>
+</ul>
+</ul>
+</li>
+              
+            
+            
+              
+                
+  <li>
+    <a href="hid.html" title="Previous Chapter: hidapi"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm hidden-tablet">&laquo; hidapi</span>
+    </a>
+  </li>
+  <li>
+    <a href="btBrickIO.html" title="Next Chapter: btBrickIO"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm hidden-tablet">btBrickIO &raquo;</span>
+    </a>
+  </li>
+              
+            
+            
+            
+            
+              <li class="hidden-sm">
+<div id="sourcelink">
+  <a href="_sources/usbBrickIO.txt"
+     rel="nofollow">Source</a>
+</div></li>
+            
+          </ul>
+
+          
+            
+<form class="navbar-form navbar-right" action="search.html" method="get">
+ <div class="form-group">
+  <input type="text" name="q" class="form-control" placeholder="Search" />
+ </div>
+  <input type="hidden" name="check_keywords" value="yes" />
+  <input type="hidden" name="area" value="default" />
+</form>
+          
+        </div>
+    </div>
+  </div>
+
+<div class="container">
+  <div class="row">
+    <div class="col-md-12 content">
+      
+  <span class="target" id="module-source"></span><div class="section" id="usbbrickio">
+<h1>usbBrickIO<a class="headerlink" href="#usbbrickio" title="Permalink to this headline">¶</a></h1>
+<dl class="class">
+<dt id="source.usbBrickIO">
+<em class="property">class </em><code class="descname">usbBrickIO</code><span class="sig-paren">(</span><em>varargin</em><span class="sig-paren">)</span><a class="headerlink" href="#source.usbBrickIO" title="Permalink to this definition">¶</a></dt>
+<dd><dl class="docutils">
+<dt><em>List of methods</em>:</dt>
+<dd><ul class="first last simple">
+<li><a class="reference internal" href="#source.usbBrickIO.open" title="source.usbBrickIO.open"><code class="xref mat mat-meth docutils literal"><span class="pre">open()</span></code></a></li>
+<li><a class="reference internal" href="#source.usbBrickIO.close" title="source.usbBrickIO.close"><code class="xref mat mat-meth docutils literal"><span class="pre">close()</span></code></a></li>
+<li><a class="reference internal" href="#source.usbBrickIO.read" title="source.usbBrickIO.read"><code class="xref mat mat-meth docutils literal"><span class="pre">read()</span></code></a></li>
+<li><a class="reference internal" href="#source.usbBrickIO.write" title="source.usbBrickIO.write"><code class="xref mat mat-meth docutils literal"><span class="pre">write()</span></code></a></li>
+<li><a class="reference internal" href="#source.usbBrickIO.setProperties" title="source.usbBrickIO.setProperties"><code class="xref mat mat-meth docutils literal"><span class="pre">setProperties()</span></code></a></li>
+</ul>
+</dd>
+</dl>
+<p>USB interface between MATLAB and the brick</p>
+<p class="rubric">Notes</p>
+<ul class="simple">
+<li>Uses the hid library implementation in hidapi.m</li>
+<li>The default parameters should always work when you try to connect to an EV3 brick,
+so in nearly all use-cases, the constructor does not need any parameters (besides
+'debug' eventually).</li>
+</ul>
+<dl class="attribute">
+<dt id="source.usbBrickIO.debug">
+<code class="descname">debug</code><a class="headerlink" href="#source.usbBrickIO.debug" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>bool</em> &#8211; If true, each open/close/read/write-call will be noted in the console.
+Defaults to false.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.usbBrickIO.vendorID">
+<code class="descname">vendorID</code><a class="headerlink" href="#source.usbBrickIO.vendorID" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>numeric</em> &#8211; Vendor-ID of the USB device. Defaults to 0x694 (EV3 vendor ID).</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.usbBrickIO.productID">
+<code class="descname">productID</code><a class="headerlink" href="#source.usbBrickIO.productID" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>numeric</em> &#8211; Product-ID of the USB device. Defaults to 0x0005 (EV3 product ID).</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.usbBrickIO.nReadBuffer">
+<code class="descname">nReadBuffer</code><a class="headerlink" href="#source.usbBrickIO.nReadBuffer" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>numeric</em> &#8211; Read-buffer size in bytes. Defaults to 1024.</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.usbBrickIO.nWriteBuffer">
+<code class="descname">nWriteBuffer</code><a class="headerlink" href="#source.usbBrickIO.nWriteBuffer" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>numeric</em> &#8211; Write-buffer size in bytes. Needs to be 1 Byte bigger than
+actual packet. Defaults to 1025 (EV3 USB maximum packet size = 1024).</p>
+</dd></dl>
+
+<dl class="attribute">
+<dt id="source.usbBrickIO.timeOut">
+<code class="descname">timeOut</code><a class="headerlink" href="#source.usbBrickIO.timeOut" title="Permalink to this definition">¶</a></dt>
+<dd><p><em>numeric &gt;= 0</em> &#8211; Milliseconds after which a timeout-error occurs if no packet could be
+read. Defaults to 10000.</p>
+</dd></dl>
+
+<p class="rubric">Examples</p>
+<p>% Connecting via USB <br />
+commHandle = usbBrickIO(); % <br />
+% Connecting via USB with enabled debug output <br />
+commHandle = usbBrickIO('debug', true); % <br /></p>
+<dl class="method">
+<dt id="source.usbBrickIO.close">
+<code class="descname">close</code><span class="sig-paren">(</span><em>brickIO</em><span class="sig-paren">)</span><a class="headerlink" href="#source.usbBrickIO.close" title="Permalink to this definition">¶</a></dt>
+<dd><p>Closes the usb connection the brick through the hidapi interface.</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.usbBrickIO.open">
+<code class="descname">open</code><span class="sig-paren">(</span><em>brickIO</em><span class="sig-paren">)</span><a class="headerlink" href="#source.usbBrickIO.open" title="Permalink to this definition">¶</a></dt>
+<dd><p>Opens the usb connection to the brick through the hidapi interface.</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.usbBrickIO.read">
+<code class="descname">read</code><span class="sig-paren">(</span><em>brickIO</em><span class="sig-paren">)</span><a class="headerlink" href="#source.usbBrickIO.read" title="Permalink to this definition">¶</a></dt>
+<dd><p>Reads data from the brick through usb using the hidapi interface and returns the data in uint8 format.</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.usbBrickIO.setProperties">
+<code class="descname">setProperties</code><span class="sig-paren">(</span><em>brickIO</em>, <em>varargin</em><span class="sig-paren">)</span><a class="headerlink" href="#source.usbBrickIO.setProperties" title="Permalink to this definition">¶</a></dt>
+<dd><p>Sets multiple usbBrickIO properties at once using MATLAB's inputParser.</p>
+<p>The syntax is as follows: commHandle.setProperties('propertyName1',
+propertyValue1, 'propertyName2', propertyValue2, ...). Valid, optional properties
+are: debug, vendorID, productID, nReadBuffer, nWriteBuffer, timeOut.</p>
+<p>See also USBBRICKIO.DEBUG, USBBRICKIO.VENDORID, USBBRICKIO.PRODUCTID,
+USBBRICKIO.NREADBUFFER, USBBRICKIO.NWRITEBUFFER, USBBRICKIO.TIMEOUT</p>
+</dd></dl>
+
+<dl class="method">
+<dt id="source.usbBrickIO.write">
+<code class="descname">write</code><span class="sig-paren">(</span><em>brickIO</em>, <em>wmsg</em><span class="sig-paren">)</span><a class="headerlink" href="#source.usbBrickIO.write" title="Permalink to this definition">¶</a></dt>
+<dd><p>Writes data to the brick through usb using the hidapi interface.</p>
+<table class="docutils field-list" frame="void" rules="none">
+<col class="field-name" />
+<col class="field-body" />
+<tbody valign="top">
+<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>wmsg</strong> (<em>uint8 array</em>) &#8211; Data to be written to the brick via usb</td>
+</tr>
+</tbody>
+</table>
+</dd></dl>
+
+</dd></dl>
+
+</div>
+
+
+    </div>
+      
+  </div>
+</div>
+<footer class="footer">
+  <div class="container">
+    <p class="pull-right">
+      <a href="#">Back to top</a>
+      
+    </p>
+    <p>
+        &copy; Copyright 2016, LfB - RWTH Aachen.<br/>
+      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.8.<br/>
+    </p>
+  </div>
+</footer>
+  </body>
+</html>
\ No newline at end of file
diff --git a/docs/_build/latex/MindstormsEV3Toolbox.aux b/docs/_build/latex/MindstormsEV3Toolbox.aux
index 767dbc5a5ce759ea0f68f8deb5188b2ba65a08f3..96a5449598b3ead9dcee504e9bc78d519ffaf9bd 100644
--- a/docs/_build/latex/MindstormsEV3Toolbox.aux
+++ b/docs/_build/latex/MindstormsEV3Toolbox.aux
@@ -57,17 +57,17 @@
 \newlabel{EV3:source.EV3.debug}{{1.3}{4}{Notes}{section*.14}{}}
 \newlabel{EV3:source.EV3.batteryMode}{{1.3}{4}{Notes}{section*.15}{}}
 \newlabel{EV3:source.EV3.batteryValue}{{1.3}{4}{Notes}{section*.16}{}}
-\newlabel{EV3:source.EV3.isConnected}{{1.3}{4}{Notes}{section*.17}{}}
-\@writefile{toc}{\contentsline {paragraph}{Example}{4}{paragraph*.18}}
-\newlabel{EV3:source.EV3.beep}{{1.3}{4}{Example}{section*.19}{}}
+\newlabel{EV3:source.EV3.isConnected}{{1.3}{5}{Notes}{section*.17}{}}
+\@writefile{toc}{\contentsline {paragraph}{Example}{5}{paragraph*.18}}
+\newlabel{EV3:source.EV3.beep}{{1.3}{5}{Example}{section*.19}{}}
 \@writefile{toc}{\contentsline {paragraph}{Notes}{5}{paragraph*.20}}
 \@writefile{toc}{\contentsline {paragraph}{Example}{5}{paragraph*.21}}
 \newlabel{EV3:source.EV3.connect}{{1.3}{5}{Example}{section*.22}{}}
 \@writefile{toc}{\contentsline {paragraph}{Example}{5}{paragraph*.23}}
 \newlabel{EV3:source.EV3.disconnect}{{1.3}{5}{Example}{section*.24}{}}
 \@writefile{toc}{\contentsline {paragraph}{Notes}{5}{paragraph*.25}}
-\@writefile{toc}{\contentsline {paragraph}{Example}{5}{paragraph*.26}}
-\newlabel{EV3:source.EV3.playTone}{{1.3}{5}{Example}{section*.27}{}}
+\@writefile{toc}{\contentsline {paragraph}{Example}{6}{paragraph*.26}}
+\newlabel{EV3:source.EV3.playTone}{{1.3}{6}{Example}{section*.27}{}}
 \@writefile{toc}{\contentsline {paragraph}{Example}{6}{paragraph*.28}}
 \newlabel{EV3:source.EV3.setProperties}{{1.3}{6}{Example}{section*.29}{}}
 \@writefile{toc}{\contentsline {paragraph}{Example}{6}{paragraph*.30}}
@@ -76,37 +76,37 @@
 \@writefile{toc}{\contentsline {paragraph}{Example}{6}{paragraph*.33}}
 \newlabel{EV3:source.EV3.tonePlayed}{{1.3}{6}{Example}{section*.34}{}}
 \newlabel{Motor:module-source}{{1.3}{6}{EV3}{section*.35}{}}
-\@writefile{toc}{\contentsline {section}{\numberline {1.4}Motor}{6}{section.1.4}}
-\newlabel{Motor::doc}{{1.4}{6}{Motor}{section.1.4}{}}
-\newlabel{Motor:motor}{{1.4}{6}{Motor}{section.1.4}{}}
-\newlabel{Motor:source.Motor}{{1.4}{6}{Motor}{section*.36}{}}
+\@writefile{toc}{\contentsline {section}{\numberline {1.4}Motor}{7}{section.1.4}}
+\newlabel{Motor::doc}{{1.4}{7}{Motor}{section.1.4}{}}
+\newlabel{Motor:motor}{{1.4}{7}{Motor}{section.1.4}{}}
+\newlabel{Motor:source.Motor}{{1.4}{7}{Motor}{section*.36}{}}
 \@writefile{toc}{\contentsline {paragraph}{Notes}{7}{paragraph*.37}}
 \newlabel{Motor:source.Motor.power}{{1.4}{7}{Notes}{section*.38}{}}
 \newlabel{Motor:source.Motor.speedRegulation}{{1.4}{7}{Notes}{section*.39}{}}
 \newlabel{Motor:source.Motor.smoothStart}{{1.4}{7}{Notes}{section*.40}{}}
 \newlabel{Motor:source.Motor.smoothStop}{{1.4}{7}{Notes}{section*.41}{}}
-\newlabel{Motor:source.Motor.limitValue}{{1.4}{7}{Notes}{section*.42}{}}
-\newlabel{Motor:source.Motor.limitMode}{{1.4}{7}{Notes}{section*.43}{}}
-\newlabel{Motor:source.Motor.brakeMode}{{1.4}{7}{Notes}{section*.44}{}}
-\newlabel{Motor:source.Motor.debug}{{1.4}{7}{Notes}{section*.45}{}}
-\newlabel{Motor:source.Motor.isRunning}{{1.4}{7}{Notes}{section*.46}{}}
-\newlabel{Motor:source.Motor.tachoCount}{{1.4}{7}{Notes}{section*.47}{}}
-\newlabel{Motor:source.Motor.currentSpeed}{{1.4}{7}{Notes}{section*.48}{}}
-\newlabel{Motor:source.Motor.type}{{1.4}{7}{Notes}{section*.49}{}}
+\newlabel{Motor:source.Motor.limitValue}{{1.4}{8}{Notes}{section*.42}{}}
+\newlabel{Motor:source.Motor.limitMode}{{1.4}{8}{Notes}{section*.43}{}}
+\newlabel{Motor:source.Motor.brakeMode}{{1.4}{8}{Notes}{section*.44}{}}
+\newlabel{Motor:source.Motor.debug}{{1.4}{8}{Notes}{section*.45}{}}
+\newlabel{Motor:source.Motor.isRunning}{{1.4}{8}{Notes}{section*.46}{}}
+\newlabel{Motor:source.Motor.tachoCount}{{1.4}{8}{Notes}{section*.47}{}}
+\newlabel{Motor:source.Motor.currentSpeed}{{1.4}{8}{Notes}{section*.48}{}}
+\newlabel{Motor:source.Motor.type}{{1.4}{8}{Notes}{section*.49}{}}
 \newlabel{Motor:source.Motor.internalReset}{{1.4}{8}{Notes}{section*.50}{}}
 \@writefile{toc}{\contentsline {paragraph}{Notes}{8}{paragraph*.51}}
 \newlabel{Motor:source.Motor.resetTachoCount}{{1.4}{8}{Notes}{section*.52}{}}
 \newlabel{Motor:source.Motor.setBrake}{{1.4}{8}{Notes}{section*.53}{}}
-\@writefile{toc}{\contentsline {paragraph}{Notes}{8}{paragraph*.54}}
-\newlabel{Motor:source.Motor.setProperties}{{1.4}{8}{Notes}{section*.55}{}}
+\@writefile{toc}{\contentsline {paragraph}{Notes}{9}{paragraph*.54}}
+\newlabel{Motor:source.Motor.setProperties}{{1.4}{9}{Notes}{section*.55}{}}
 \@writefile{toc}{\contentsline {paragraph}{Example}{9}{paragraph*.56}}
 \newlabel{Motor:source.Motor.start}{{1.4}{9}{Notes}{section*.57}{}}
 \newlabel{Motor:source.Motor.stop}{{1.4}{9}{Notes}{section*.58}{}}
 \@writefile{toc}{\contentsline {paragraph}{Notes}{9}{paragraph*.59}}
 \newlabel{Motor:source.Motor.syncedStart}{{1.4}{9}{Notes}{section*.60}{}}
-\@writefile{toc}{\contentsline {paragraph}{Notes}{9}{paragraph*.61}}
-\@writefile{toc}{\contentsline {paragraph}{Example}{9}{paragraph*.62}}
-\newlabel{Motor:source.Motor.syncedStop}{{1.4}{9}{Notes}{section*.63}{}}
+\@writefile{toc}{\contentsline {paragraph}{Notes}{10}{paragraph*.61}}
+\@writefile{toc}{\contentsline {paragraph}{Example}{10}{paragraph*.62}}
+\newlabel{Motor:source.Motor.syncedStop}{{1.4}{10}{Notes}{section*.63}{}}
 \@writefile{toc}{\contentsline {paragraph}{Notes}{10}{paragraph*.64}}
 \newlabel{Motor:source.Motor.waitFor}{{1.4}{10}{Notes}{section*.65}{}}
 \@writefile{toc}{\contentsline {paragraph}{Notes}{10}{paragraph*.66}}
@@ -115,29 +115,86 @@
 \newlabel{Sensor:sensor}{{1.5}{10}{Sensor}{section.1.5}{}}
 \newlabel{Sensor::doc}{{1.5}{10}{Sensor}{section.1.5}{}}
 \newlabel{Sensor:source.Sensor}{{1.5}{10}{Sensor}{section*.68}{}}
-\@writefile{toc}{\contentsline {paragraph}{Notes}{10}{paragraph*.69}}
-\newlabel{Sensor:source.Sensor.mode}{{1.5}{10}{Notes}{section*.70}{}}
+\@writefile{toc}{\contentsline {paragraph}{Notes}{11}{paragraph*.69}}
+\newlabel{Sensor:source.Sensor.mode}{{1.5}{11}{Notes}{section*.70}{}}
 \newlabel{Sensor:source.Sensor.debug}{{1.5}{12}{Notes}{section*.71}{}}
-\newlabel{Sensor:source.Sensor.value}{{1.5}{12}{Notes}{section*.72}{}}
-\newlabel{Sensor:source.Sensor.type}{{1.5}{12}{Notes}{section*.73}{}}
+\newlabel{Sensor:source.Sensor.value}{{1.5}{13}{Notes}{section*.72}{}}
+\newlabel{Sensor:source.Sensor.type}{{1.5}{13}{Notes}{section*.73}{}}
 \newlabel{Sensor:source.Sensor.reset}{{1.5}{13}{Notes}{section*.74}{}}
 \@writefile{toc}{\contentsline {paragraph}{Notes}{13}{paragraph*.75}}
 \newlabel{Sensor:source.Sensor.setProperties}{{1.5}{13}{Notes}{section*.76}{}}
-\@writefile{toc}{\contentsline {paragraph}{Example}{13}{paragraph*.77}}
-\newlabel{CommandLayer:module-source}{{1.5}{13}{Sensor}{section*.78}{}}
-\@writefile{toc}{\contentsline {section}{\numberline {1.6}CommandLayer}{13}{section.1.6}}
-\newlabel{CommandLayer:commandlayer}{{1.6}{13}{CommandLayer}{section.1.6}{}}
-\newlabel{CommandLayer::doc}{{1.6}{13}{CommandLayer}{section.1.6}{}}
-\@writefile{toc}{\contentsline {subsection}{\numberline {1.6.1}Command}{13}{subsection.1.6.1}}
-\newlabel{CommandLayer:command}{{1.6.1}{13}{Command}{subsection.1.6.1}{}}
-\@writefile{toc}{\contentsline {subsection}{\numberline {1.6.2}CommunicationInterface}{13}{subsection.1.6.2}}
-\newlabel{CommandLayer:communicationinterface}{{1.6.2}{13}{CommunicationInterface}{subsection.1.6.2}{}}
-\newlabel{CommunicationLayer:module-source}{{1.6.2}{13}{CommunicationInterface}{section*.79}{}}
-\@writefile{toc}{\contentsline {section}{\numberline {1.7}CommunicationLayer}{13}{section.1.7}}
-\newlabel{CommunicationLayer:communicationlayer}{{1.7}{13}{CommunicationLayer}{section.1.7}{}}
-\newlabel{CommunicationLayer::doc}{{1.7}{13}{CommunicationLayer}{section.1.7}{}}
-\@writefile{toc}{\contentsline {subsection}{\numberline {1.7.1}USB}{13}{subsection.1.7.1}}
-\newlabel{CommunicationLayer:usb}{{1.7.1}{13}{USB}{subsection.1.7.1}{}}
-\@writefile{toc}{\contentsline {subsection}{\numberline {1.7.2}Bluetooth}{13}{subsection.1.7.2}}
-\newlabel{CommunicationLayer:bluetooth}{{1.7.2}{13}{Bluetooth}{subsection.1.7.2}{}}
-\@writefile{toc}{\contentsline {chapter}{Index}{15}{section*.80}}
+\@writefile{toc}{\contentsline {paragraph}{Example}{14}{paragraph*.77}}
+\newlabel{hid:module-source}{{1.5}{14}{Sensor}{section*.78}{}}
+\@writefile{toc}{\contentsline {section}{\numberline {1.6}hidapi}{14}{section.1.6}}
+\newlabel{hid:hidapi}{{1.6}{14}{hidapi}{section.1.6}{}}
+\newlabel{hid::doc}{{1.6}{14}{hidapi}{section.1.6}{}}
+\newlabel{hid:source.hidapi}{{1.6}{14}{hidapi}{section*.79}{}}
+\@writefile{toc}{\contentsline {paragraph}{Notes}{14}{paragraph*.80}}
+\newlabel{hid:source.hidapi.handle}{{1.6}{14}{Notes}{section*.81}{}}
+\newlabel{hid:source.hidapi.vendorID}{{1.6}{14}{Notes}{section*.82}{}}
+\newlabel{hid:source.hidapi.productID}{{1.6}{14}{Notes}{section*.83}{}}
+\newlabel{hid:source.hidapi.nReadBuffer}{{1.6}{14}{Notes}{section*.84}{}}
+\newlabel{hid:source.hidapi.nWriteBuffer}{{1.6}{15}{Notes}{section*.85}{}}
+\newlabel{hid:source.hidapi.slib}{{1.6}{15}{Notes}{section*.86}{}}
+\newlabel{hid:source.hidapi.sheader}{{1.6}{15}{Notes}{section*.87}{}}
+\@writefile{toc}{\contentsline {paragraph}{Example}{15}{paragraph*.88}}
+\newlabel{hid:source.hidapi.close}{{1.6}{15}{Example}{section*.89}{}}
+\@writefile{toc}{\contentsline {paragraph}{Notes}{15}{paragraph*.90}}
+\newlabel{hid:source.hidapi.enumerate}{{1.6}{15}{Example}{section*.91}{}}
+\@writefile{toc}{\contentsline {paragraph}{Notes}{15}{paragraph*.92}}
+\newlabel{hid:source.hidapi.error}{{1.6}{15}{Example}{section*.93}{}}
+\@writefile{toc}{\contentsline {paragraph}{Notes}{15}{paragraph*.94}}
+\newlabel{hid:source.hidapi.exit}{{1.6}{16}{Example}{section*.95}{}}
+\newlabel{hid:source.hidapi.getHIDInfoString}{{1.6}{16}{Example}{section*.96}{}}
+\@writefile{toc}{\contentsline {paragraph}{Notes}{16}{paragraph*.97}}
+\newlabel{hid:source.hidapi.getManufacturersString}{{1.6}{16}{Example}{section*.98}{}}
+\newlabel{hid:source.hidapi.getProductString}{{1.6}{16}{Example}{section*.99}{}}
+\newlabel{hid:source.hidapi.getSerialNumberString}{{1.6}{16}{Example}{section*.100}{}}
+\newlabel{hid:source.hidapi.init}{{1.6}{16}{Example}{section*.101}{}}
+\@writefile{toc}{\contentsline {paragraph}{Notes}{16}{paragraph*.102}}
+\newlabel{hid:source.hidapi.open}{{1.6}{16}{Example}{section*.103}{}}
+\@writefile{toc}{\contentsline {paragraph}{Notes}{16}{paragraph*.104}}
+\newlabel{hid:source.hidapi.read}{{1.6}{17}{Example}{section*.105}{}}
+\@writefile{toc}{\contentsline {paragraph}{Notes}{17}{paragraph*.106}}
+\newlabel{hid:source.hidapi.read_timeout}{{1.6}{17}{Example}{section*.107}{}}
+\newlabel{hid:source.hidapi.setNonBlocking}{{1.6}{17}{Example}{section*.108}{}}
+\newlabel{hid:source.hidapi.write}{{1.6}{17}{Example}{section*.109}{}}
+\@writefile{toc}{\contentsline {paragraph}{Notes}{17}{paragraph*.110}}
+\newlabel{usbBrickIO:module-source}{{1.6}{17}{hidapi}{section*.111}{}}
+\@writefile{toc}{\contentsline {section}{\numberline {1.7}usbBrickIO}{18}{section.1.7}}
+\newlabel{usbBrickIO:usbbrickio}{{1.7}{18}{usbBrickIO}{section.1.7}{}}
+\newlabel{usbBrickIO::doc}{{1.7}{18}{usbBrickIO}{section.1.7}{}}
+\newlabel{usbBrickIO:source.usbBrickIO}{{1.7}{18}{usbBrickIO}{section*.112}{}}
+\@writefile{toc}{\contentsline {paragraph}{Notes}{18}{paragraph*.113}}
+\newlabel{usbBrickIO:source.usbBrickIO.debug}{{1.7}{18}{Notes}{section*.114}{}}
+\newlabel{usbBrickIO:source.usbBrickIO.vendorID}{{1.7}{18}{Notes}{section*.115}{}}
+\newlabel{usbBrickIO:source.usbBrickIO.productID}{{1.7}{18}{Notes}{section*.116}{}}
+\newlabel{usbBrickIO:source.usbBrickIO.nReadBuffer}{{1.7}{18}{Notes}{section*.117}{}}
+\newlabel{usbBrickIO:source.usbBrickIO.nWriteBuffer}{{1.7}{18}{Notes}{section*.118}{}}
+\newlabel{usbBrickIO:source.usbBrickIO.timeOut}{{1.7}{18}{Notes}{section*.119}{}}
+\@writefile{toc}{\contentsline {paragraph}{Examples}{18}{paragraph*.120}}
+\newlabel{usbBrickIO:source.usbBrickIO.close}{{1.7}{18}{Examples}{section*.121}{}}
+\newlabel{usbBrickIO:source.usbBrickIO.open}{{1.7}{18}{Examples}{section*.122}{}}
+\newlabel{usbBrickIO:source.usbBrickIO.read}{{1.7}{18}{Examples}{section*.123}{}}
+\newlabel{usbBrickIO:source.usbBrickIO.setProperties}{{1.7}{18}{Examples}{section*.124}{}}
+\newlabel{usbBrickIO:source.usbBrickIO.write}{{1.7}{19}{Examples}{section*.125}{}}
+\newlabel{btBrickIO:module-source}{{1.7}{19}{usbBrickIO}{section*.126}{}}
+\@writefile{toc}{\contentsline {section}{\numberline {1.8}btBrickIO}{19}{section.1.8}}
+\newlabel{btBrickIO:btbrickio}{{1.8}{19}{btBrickIO}{section.1.8}{}}
+\newlabel{btBrickIO::doc}{{1.8}{19}{btBrickIO}{section.1.8}{}}
+\newlabel{btBrickIO:source.btBrickIO}{{1.8}{19}{btBrickIO}{section*.127}{}}
+\@writefile{toc}{\contentsline {paragraph}{Notes}{19}{paragraph*.128}}
+\newlabel{btBrickIO:source.btBrickIO.debug}{{1.8}{19}{Notes}{section*.129}{}}
+\newlabel{btBrickIO:source.btBrickIO.serialPort}{{1.8}{19}{Notes}{section*.130}{}}
+\newlabel{btBrickIO:source.btBrickIO.deviceName}{{1.8}{19}{Notes}{section*.131}{}}
+\newlabel{btBrickIO:source.btBrickIO.channel}{{1.8}{19}{Notes}{section*.132}{}}
+\newlabel{btBrickIO:source.btBrickIO.timeOut}{{1.8}{20}{Notes}{section*.133}{}}
+\newlabel{btBrickIO:source.btBrickIO.backend}{{1.8}{20}{Notes}{section*.134}{}}
+\@writefile{toc}{\contentsline {paragraph}{Examples}{20}{paragraph*.135}}
+\newlabel{btBrickIO:source.btBrickIO.close}{{1.8}{20}{Examples}{section*.136}{}}
+\newlabel{btBrickIO:source.btBrickIO.open}{{1.8}{20}{Examples}{section*.137}{}}
+\newlabel{btBrickIO:source.btBrickIO.read}{{1.8}{20}{Examples}{section*.138}{}}
+\newlabel{btBrickIO:source.btBrickIO.setProperties}{{1.8}{20}{Examples}{section*.139}{}}
+\newlabel{btBrickIO:source.btBrickIO.write}{{1.8}{20}{Examples}{section*.140}{}}
+\@writefile{toc}{\contentsline {chapter}{MATLAB Module Index}{21}{section*.141}}
+\@writefile{toc}{\contentsline {chapter}{Index}{23}{section*.142}}
diff --git a/docs/_build/latex/MindstormsEV3Toolbox.idx b/docs/_build/latex/MindstormsEV3Toolbox.idx
index 9dbeb0934d10efd95da254201cc3eec0f9a75951..c4ec5427ad4be5283bfff9b17c9ff33a15b4d91c 100644
--- a/docs/_build/latex/MindstormsEV3Toolbox.idx
+++ b/docs/_build/latex/MindstormsEV3Toolbox.idx
@@ -11,45 +11,92 @@
 \indexentry{debug (source.EV3 attribute)|hyperpage}{4}
 \indexentry{batteryMode (source.EV3 attribute)|hyperpage}{4}
 \indexentry{batteryValue (source.EV3 attribute)|hyperpage}{4}
-\indexentry{isConnected (source.EV3 attribute)|hyperpage}{4}
-\indexentry{beep() (source.EV3 method)|hyperpage}{4}
+\indexentry{isConnected (source.EV3 attribute)|hyperpage}{5}
+\indexentry{beep() (source.EV3 method)|hyperpage}{5}
 \indexentry{connect() (source.EV3 method)|hyperpage}{5}
 \indexentry{disconnect() (source.EV3 method)|hyperpage}{5}
-\indexentry{playTone() (source.EV3 method)|hyperpage}{5}
+\indexentry{playTone() (source.EV3 method)|hyperpage}{6}
 \indexentry{setProperties() (source.EV3 method)|hyperpage}{6}
 \indexentry{stopAllMotors() (source.EV3 method)|hyperpage}{6}
 \indexentry{stopTone() (source.EV3 method)|hyperpage}{6}
 \indexentry{tonePlayed() (source.EV3 method)|hyperpage}{6}
 \indexentry{source (module)|hyperpage}{6}
-\indexentry{Motor (class in source)|hyperpage}{6}
+\indexentry{Motor (class in source)|hyperpage}{7}
 \indexentry{power (source.Motor attribute)|hyperpage}{7}
 \indexentry{speedRegulation (source.Motor attribute)|hyperpage}{7}
 \indexentry{smoothStart (source.Motor attribute)|hyperpage}{7}
 \indexentry{smoothStop (source.Motor attribute)|hyperpage}{7}
-\indexentry{limitValue (source.Motor attribute)|hyperpage}{7}
-\indexentry{limitMode (source.Motor attribute)|hyperpage}{7}
-\indexentry{brakeMode (source.Motor attribute)|hyperpage}{7}
-\indexentry{debug (source.Motor attribute)|hyperpage}{7}
-\indexentry{isRunning (source.Motor attribute)|hyperpage}{7}
-\indexentry{tachoCount (source.Motor attribute)|hyperpage}{7}
-\indexentry{currentSpeed (source.Motor attribute)|hyperpage}{7}
-\indexentry{type (source.Motor attribute)|hyperpage}{7}
+\indexentry{limitValue (source.Motor attribute)|hyperpage}{8}
+\indexentry{limitMode (source.Motor attribute)|hyperpage}{8}
+\indexentry{brakeMode (source.Motor attribute)|hyperpage}{8}
+\indexentry{debug (source.Motor attribute)|hyperpage}{8}
+\indexentry{isRunning (source.Motor attribute)|hyperpage}{8}
+\indexentry{tachoCount (source.Motor attribute)|hyperpage}{8}
+\indexentry{currentSpeed (source.Motor attribute)|hyperpage}{8}
+\indexentry{type (source.Motor attribute)|hyperpage}{8}
 \indexentry{internalReset() (source.Motor method)|hyperpage}{8}
 \indexentry{resetTachoCount() (source.Motor method)|hyperpage}{8}
 \indexentry{setBrake() (source.Motor method)|hyperpage}{8}
-\indexentry{setProperties() (source.Motor method)|hyperpage}{8}
+\indexentry{setProperties() (source.Motor method)|hyperpage}{9}
 \indexentry{start() (source.Motor method)|hyperpage}{9}
 \indexentry{stop() (source.Motor method)|hyperpage}{9}
 \indexentry{syncedStart() (source.Motor method)|hyperpage}{9}
-\indexentry{syncedStop() (source.Motor method)|hyperpage}{9}
+\indexentry{syncedStop() (source.Motor method)|hyperpage}{10}
 \indexentry{waitFor() (source.Motor method)|hyperpage}{10}
 \indexentry{source (module)|hyperpage}{10}
 \indexentry{Sensor (class in source)|hyperpage}{10}
-\indexentry{mode (source.Sensor attribute)|hyperpage}{10}
+\indexentry{mode (source.Sensor attribute)|hyperpage}{11}
 \indexentry{debug (source.Sensor attribute)|hyperpage}{12}
-\indexentry{value (source.Sensor attribute)|hyperpage}{12}
-\indexentry{type (source.Sensor attribute)|hyperpage}{12}
+\indexentry{value (source.Sensor attribute)|hyperpage}{13}
+\indexentry{type (source.Sensor attribute)|hyperpage}{13}
 \indexentry{reset() (source.Sensor method)|hyperpage}{13}
 \indexentry{setProperties() (source.Sensor method)|hyperpage}{13}
-\indexentry{source (module)|hyperpage}{13}
-\indexentry{source (module)|hyperpage}{13}
+\indexentry{source (module)|hyperpage}{14}
+\indexentry{hidapi (class in source)|hyperpage}{14}
+\indexentry{handle (source.hidapi attribute)|hyperpage}{14}
+\indexentry{vendorID (source.hidapi attribute)|hyperpage}{14}
+\indexentry{productID (source.hidapi attribute)|hyperpage}{14}
+\indexentry{nReadBuffer (source.hidapi attribute)|hyperpage}{14}
+\indexentry{nWriteBuffer (source.hidapi attribute)|hyperpage}{15}
+\indexentry{slib (source.hidapi attribute)|hyperpage}{15}
+\indexentry{sheader (source.hidapi attribute)|hyperpage}{15}
+\indexentry{close() (source.hidapi method)|hyperpage}{15}
+\indexentry{enumerate() (source.hidapi method)|hyperpage}{15}
+\indexentry{error() (source.hidapi method)|hyperpage}{15}
+\indexentry{exit() (source.hidapi method)|hyperpage}{16}
+\indexentry{getHIDInfoString() (source.hidapi method)|hyperpage}{16}
+\indexentry{getManufacturersString() (source.hidapi method)|hyperpage}{16}
+\indexentry{getProductString() (source.hidapi method)|hyperpage}{16}
+\indexentry{getSerialNumberString() (source.hidapi method)|hyperpage}{16}
+\indexentry{init() (source.hidapi method)|hyperpage}{16}
+\indexentry{open() (source.hidapi method)|hyperpage}{16}
+\indexentry{read() (source.hidapi method)|hyperpage}{17}
+\indexentry{read\_timeout() (source.hidapi method)|hyperpage}{17}
+\indexentry{setNonBlocking() (source.hidapi method)|hyperpage}{17}
+\indexentry{write() (source.hidapi method)|hyperpage}{17}
+\indexentry{source (module)|hyperpage}{17}
+\indexentry{usbBrickIO (class in source)|hyperpage}{18}
+\indexentry{debug (source.usbBrickIO attribute)|hyperpage}{18}
+\indexentry{vendorID (source.usbBrickIO attribute)|hyperpage}{18}
+\indexentry{productID (source.usbBrickIO attribute)|hyperpage}{18}
+\indexentry{nReadBuffer (source.usbBrickIO attribute)|hyperpage}{18}
+\indexentry{nWriteBuffer (source.usbBrickIO attribute)|hyperpage}{18}
+\indexentry{timeOut (source.usbBrickIO attribute)|hyperpage}{18}
+\indexentry{close() (source.usbBrickIO method)|hyperpage}{18}
+\indexentry{open() (source.usbBrickIO method)|hyperpage}{18}
+\indexentry{read() (source.usbBrickIO method)|hyperpage}{18}
+\indexentry{setProperties() (source.usbBrickIO method)|hyperpage}{18}
+\indexentry{write() (source.usbBrickIO method)|hyperpage}{19}
+\indexentry{source (module)|hyperpage}{19}
+\indexentry{btBrickIO (class in source)|hyperpage}{19}
+\indexentry{debug (source.btBrickIO attribute)|hyperpage}{19}
+\indexentry{serialPort (source.btBrickIO attribute)|hyperpage}{19}
+\indexentry{deviceName (source.btBrickIO attribute)|hyperpage}{19}
+\indexentry{channel (source.btBrickIO attribute)|hyperpage}{19}
+\indexentry{timeOut (source.btBrickIO attribute)|hyperpage}{20}
+\indexentry{backend (source.btBrickIO attribute)|hyperpage}{20}
+\indexentry{close() (source.btBrickIO method)|hyperpage}{20}
+\indexentry{open() (source.btBrickIO method)|hyperpage}{20}
+\indexentry{read() (source.btBrickIO method)|hyperpage}{20}
+\indexentry{setProperties() (source.btBrickIO method)|hyperpage}{20}
+\indexentry{write() (source.btBrickIO method)|hyperpage}{20}
diff --git a/docs/_build/latex/MindstormsEV3Toolbox.ilg b/docs/_build/latex/MindstormsEV3Toolbox.ilg
index 71dbe03a91a3d1ce8f630d9dd105aa283353952f..3d55ef3f7de820a3aa8987d6ca06bedd5757b916 100644
--- a/docs/_build/latex/MindstormsEV3Toolbox.ilg
+++ b/docs/_build/latex/MindstormsEV3Toolbox.ilg
@@ -1,7 +1,7 @@
 This is makeindex, version 2.15 [TeX Live 2013] (kpathsea + Thai support).
 Scanning style file ./python.ist......done (6 attributes redefined, 0 ignored).
-Scanning input file MindstormsEV3Toolbox.idx....done (55 entries accepted, 0 rejected).
-Sorting entries....done (342 comparisons).
-Generating output file MindstormsEV3Toolbox.ind....done (93 lines written, 0 warnings).
+Scanning input file MindstormsEV3Toolbox.idx....done (102 entries accepted, 0 rejected).
+Sorting entries....done (719 comparisons).
+Generating output file MindstormsEV3Toolbox.ind....done (155 lines written, 0 warnings).
 Output written in MindstormsEV3Toolbox.ind.
 Transcript written in MindstormsEV3Toolbox.ilg.
diff --git a/docs/_build/latex/MindstormsEV3Toolbox.ind b/docs/_build/latex/MindstormsEV3Toolbox.ind
index e261917e2663ce88ac64af6d6488c42d689ddddd..aa7d79c74657690881f91eb3d205ac2d2a882b73 100644
--- a/docs/_build/latex/MindstormsEV3Toolbox.ind
+++ b/docs/_build/latex/MindstormsEV3Toolbox.ind
@@ -2,54 +2,98 @@
 \def\bigletter#1{{\Large\sffamily#1}\nopagebreak\vspace{1mm}}
 
   \bigletter B
+  \item backend (source.btBrickIO attribute), \hyperpage{20}
   \item batteryMode (source.EV3 attribute), \hyperpage{4}
   \item batteryValue (source.EV3 attribute), \hyperpage{4}
-  \item beep() (source.EV3 method), \hyperpage{4}
-  \item brakeMode (source.Motor attribute), \hyperpage{7}
+  \item beep() (source.EV3 method), \hyperpage{5}
+  \item brakeMode (source.Motor attribute), \hyperpage{8}
+  \item btBrickIO (class in source), \hyperpage{19}
 
   \indexspace
   \bigletter C
+  \item channel (source.btBrickIO attribute), \hyperpage{19}
+  \item close() (source.btBrickIO method), \hyperpage{20}
+  \item close() (source.hidapi method), \hyperpage{15}
+  \item close() (source.usbBrickIO method), \hyperpage{18}
   \item connect() (source.EV3 method), \hyperpage{5}
-  \item currentSpeed (source.Motor attribute), \hyperpage{7}
+  \item currentSpeed (source.Motor attribute), \hyperpage{8}
 
   \indexspace
   \bigletter D
+  \item debug (source.btBrickIO attribute), \hyperpage{19}
   \item debug (source.EV3 attribute), \hyperpage{4}
-  \item debug (source.Motor attribute), \hyperpage{7}
+  \item debug (source.Motor attribute), \hyperpage{8}
   \item debug (source.Sensor attribute), \hyperpage{12}
+  \item debug (source.usbBrickIO attribute), \hyperpage{18}
+  \item deviceName (source.btBrickIO attribute), \hyperpage{19}
   \item disconnect() (source.EV3 method), \hyperpage{5}
 
   \indexspace
   \bigletter E
+  \item enumerate() (source.hidapi method), \hyperpage{15}
+  \item error() (source.hidapi method), \hyperpage{15}
   \item EV3 (class in source), \hyperpage{3}
+  \item exit() (source.hidapi method), \hyperpage{16}
+
+  \indexspace
+  \bigletter G
+  \item getHIDInfoString() (source.hidapi method), \hyperpage{16}
+  \item getManufacturersString() (source.hidapi method), \hyperpage{16}
+  \item getProductString() (source.hidapi method), \hyperpage{16}
+  \item getSerialNumberString() (source.hidapi method), \hyperpage{16}
+
+  \indexspace
+  \bigletter H
+  \item handle (source.hidapi attribute), \hyperpage{14}
+  \item hidapi (class in source), \hyperpage{14}
 
   \indexspace
   \bigletter I
+  \item init() (source.hidapi method), \hyperpage{16}
   \item internalReset() (source.Motor method), \hyperpage{8}
-  \item isConnected (source.EV3 attribute), \hyperpage{4}
-  \item isRunning (source.Motor attribute), \hyperpage{7}
+  \item isConnected (source.EV3 attribute), \hyperpage{5}
+  \item isRunning (source.Motor attribute), \hyperpage{8}
 
   \indexspace
   \bigletter L
-  \item limitMode (source.Motor attribute), \hyperpage{7}
-  \item limitValue (source.Motor attribute), \hyperpage{7}
+  \item limitMode (source.Motor attribute), \hyperpage{8}
+  \item limitValue (source.Motor attribute), \hyperpage{8}
 
   \indexspace
   \bigletter M
-  \item mode (source.Sensor attribute), \hyperpage{10}
-  \item Motor (class in source), \hyperpage{6}
+  \item mode (source.Sensor attribute), \hyperpage{11}
+  \item Motor (class in source), \hyperpage{7}
   \item motorA (source.EV3 attribute), \hyperpage{4}
   \item motorB (source.EV3 attribute), \hyperpage{4}
   \item motorC (source.EV3 attribute), \hyperpage{4}
   \item motorD (source.EV3 attribute), \hyperpage{4}
 
+  \indexspace
+  \bigletter N
+  \item nReadBuffer (source.hidapi attribute), \hyperpage{14}
+  \item nReadBuffer (source.usbBrickIO attribute), \hyperpage{18}
+  \item nWriteBuffer (source.hidapi attribute), \hyperpage{15}
+  \item nWriteBuffer (source.usbBrickIO attribute), \hyperpage{18}
+
+  \indexspace
+  \bigletter O
+  \item open() (source.btBrickIO method), \hyperpage{20}
+  \item open() (source.hidapi method), \hyperpage{16}
+  \item open() (source.usbBrickIO method), \hyperpage{18}
+
   \indexspace
   \bigletter P
-  \item playTone() (source.EV3 method), \hyperpage{5}
+  \item playTone() (source.EV3 method), \hyperpage{6}
   \item power (source.Motor attribute), \hyperpage{7}
+  \item productID (source.hidapi attribute), \hyperpage{14}
+  \item productID (source.usbBrickIO attribute), \hyperpage{18}
 
   \indexspace
   \bigletter R
+  \item read() (source.btBrickIO method), \hyperpage{20}
+  \item read() (source.hidapi method), \hyperpage{17}
+  \item read() (source.usbBrickIO method), \hyperpage{18}
+  \item read\_timeout() (source.hidapi method), \hyperpage{17}
   \item reset() (source.Sensor method), \hyperpage{13}
   \item resetTachoCount() (source.Motor method), \hyperpage{8}
 
@@ -60,34 +104,52 @@
   \item sensor2 (source.EV3 attribute), \hyperpage{4}
   \item sensor3 (source.EV3 attribute), \hyperpage{4}
   \item sensor4 (source.EV3 attribute), \hyperpage{4}
+  \item serialPort (source.btBrickIO attribute), \hyperpage{19}
   \item setBrake() (source.Motor method), \hyperpage{8}
+  \item setNonBlocking() (source.hidapi method), \hyperpage{17}
+  \item setProperties() (source.btBrickIO method), \hyperpage{20}
   \item setProperties() (source.EV3 method), \hyperpage{6}
-  \item setProperties() (source.Motor method), \hyperpage{8}
+  \item setProperties() (source.Motor method), \hyperpage{9}
   \item setProperties() (source.Sensor method), \hyperpage{13}
+  \item setProperties() (source.usbBrickIO method), \hyperpage{18}
+  \item sheader (source.hidapi attribute), \hyperpage{15}
+  \item slib (source.hidapi attribute), \hyperpage{15}
   \item smoothStart (source.Motor attribute), \hyperpage{7}
   \item smoothStop (source.Motor attribute), \hyperpage{7}
-  \item source (module), \hyperpage{3}, \hyperpage{6}, \hyperpage{10}, \hyperpage{13}
+  \item source (module), \hyperpage{3}, \hyperpage{6}, \hyperpage{10}, \hyperpage{14}, 
+		\hyperpage{17}, \hyperpage{19}
   \item speedRegulation (source.Motor attribute), \hyperpage{7}
   \item start() (source.Motor method), \hyperpage{9}
   \item stop() (source.Motor method), \hyperpage{9}
   \item stopAllMotors() (source.EV3 method), \hyperpage{6}
   \item stopTone() (source.EV3 method), \hyperpage{6}
   \item syncedStart() (source.Motor method), \hyperpage{9}
-  \item syncedStop() (source.Motor method), \hyperpage{9}
+  \item syncedStop() (source.Motor method), \hyperpage{10}
 
   \indexspace
   \bigletter T
-  \item tachoCount (source.Motor attribute), \hyperpage{7}
+  \item tachoCount (source.Motor attribute), \hyperpage{8}
+  \item timeOut (source.btBrickIO attribute), \hyperpage{20}
+  \item timeOut (source.usbBrickIO attribute), \hyperpage{18}
   \item tonePlayed() (source.EV3 method), \hyperpage{6}
-  \item type (source.Motor attribute), \hyperpage{7}
-  \item type (source.Sensor attribute), \hyperpage{12}
+  \item type (source.Motor attribute), \hyperpage{8}
+  \item type (source.Sensor attribute), \hyperpage{13}
+
+  \indexspace
+  \bigletter U
+  \item usbBrickIO (class in source), \hyperpage{18}
 
   \indexspace
   \bigletter V
-  \item value (source.Sensor attribute), \hyperpage{12}
+  \item value (source.Sensor attribute), \hyperpage{13}
+  \item vendorID (source.hidapi attribute), \hyperpage{14}
+  \item vendorID (source.usbBrickIO attribute), \hyperpage{18}
 
   \indexspace
   \bigletter W
   \item waitFor() (source.Motor method), \hyperpage{10}
+  \item write() (source.btBrickIO method), \hyperpage{20}
+  \item write() (source.hidapi method), \hyperpage{17}
+  \item write() (source.usbBrickIO method), \hyperpage{19}
 
 \end{theindex}
diff --git a/docs/_build/latex/MindstormsEV3Toolbox.log b/docs/_build/latex/MindstormsEV3Toolbox.log
index 7d7ef6fe2c5680ef92f08ee695fdd76d70a4639b..97fe6f3b67f180530f03d2c24a4357b35bdd5c5b 100644
--- a/docs/_build/latex/MindstormsEV3Toolbox.log
+++ b/docs/_build/latex/MindstormsEV3Toolbox.log
@@ -1,4 +1,4 @@
-This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian) (format=pdflatex 2016.11.23)  23 FEB 2017 15:01
+This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian) (format=pdflatex 2016.11.23)  9 MAY 2017 15:23
 entering extended mode
  restricted \write18 enabled.
  %&-line parsing enabled.
@@ -1019,7 +1019,9 @@ File: ts1pcr.fd 2001/06/04 font definitions for TS1/pcr.
 )
 LaTeX Font Info:    Font shape `T1/pcr/bx/n' in size <10> not available
 (Font)              Font shape `T1/pcr/b/n' tried instead on input line 1.
-LaTeX Font Info:    Try loading font information for TS1+ptm on input line 208.
+LaTeX Font Info:    Font shape `T1/ptm/bx/it' in size <10> not available
+(Font)              Font shape `T1/ptm/b/it' tried instead on input line 201.
+LaTeX Font Info:    Try loading font information for TS1+ptm on input line 202.
 
 
 (/usr/share/texlive/texmf-dist/tex/latex/psnfss/ts1ptm.fd
@@ -1028,41 +1030,60 @@ File: ts1ptm.fd 2001/06/04 font definitions for TS1/ptm.
 LaTeX Font Info:    Font shape `T1/pcr/m/it' in size <10> not available
 (Font)              Font shape `T1/pcr/m/sl' tried instead on input line 1.
  [4]
-Underfull \hbox (badness 10000) in paragraph at lines 369--371
+Underfull \hbox (badness 10000) in paragraph at lines 398--400
 []\T1/pcr/b/n/10 serPort \T1/ptm/m/n/10 (\T1/pcr/m/sl/10 string in {'/dev/rfcom
 m1', '/dev/rfcomm2', ...}\T1/ptm/m/n/10 ) --
  []
 
 [5]
-Underfull \hbox (badness 10000) in paragraph at lines 450--451
+Underfull \hbox (badness 10000) in paragraph at lines 479--480
 []\T1/pcr/b/n/10 batteryMode \T1/ptm/m/n/10 (\T1/pcr/m/sl/10 string in {'Voltag
 e'/'Percentage'}\T1/ptm/m/n/10 ) -- see
  []
 
-[6] [7] [8] [9] [10] [11] [12] (./MindstormsEV3Toolbox.ind [13] [14
+[6] [7] [8] [9] [10] [11] [12] [13] [14] [15]
+Underfull \hbox (badness 10000) in paragraph at lines 1591--1593
+[]\T1/ptm/m/n/10 See also HI-DAPI.GETMANUFACTURERSSTRING, HI-DAPI.GETPRODUCTSTR
+ING, HI-
+ []
+
+[16] [17] [18] [19]
+Underfull \hbox (badness 5504) in paragraph at lines 2066--2068
+[]\T1/ptm/m/n/10 See also BT-BRICKIO.DEBUG, BT-BRICKIO.SERIALPORT, BT-BRICKIO.D
+EVICENAME, BT-
+ []
+
+[20] [21
+
+
+
+] (./MindstormsEV3Toolbox.ind [22
+
+
+] [23
 
-] [15
+] [24
 
 ])
-Package atveryend Info: Empty hook `BeforeClearDocument' on input line 1293.
-Package atveryend Info: Empty hook `AfterLastShipout' on input line 1293.
+Package atveryend Info: Empty hook `BeforeClearDocument' on input line 2098.
+Package atveryend Info: Empty hook `AfterLastShipout' on input line 2098.
 
 (./MindstormsEV3Toolbox.aux)
-Package atveryend Info: Executing hook `AtVeryEndDocument' on input line 1293.
-Package atveryend Info: Executing hook `AtEndAfterFileList' on input line 1293.
+Package atveryend Info: Executing hook `AtVeryEndDocument' on input line 2098.
+Package atveryend Info: Executing hook `AtEndAfterFileList' on input line 2098.
 
 Package rerunfilecheck Info: File `MindstormsEV3Toolbox.out' has not changed.
-(rerunfilecheck)             Checksum: 22BCF1B5A3444C4A0155F0F0F4B50E6D;826.
-Package atveryend Info: Empty hook `AtVeryVeryEnd' on input line 1293.
+(rerunfilecheck)             Checksum: CA85C18231C8BE65A74CF3036572891B;1005.
+Package atveryend Info: Empty hook `AtVeryVeryEnd' on input line 2098.
  ) 
 Here is how much of TeX's memory you used:
- 13469 strings out of 493304
- 183892 string characters out of 6139870
- 275845 words of memory out of 5000000
- 16501 multiletter control sequences out of 15000+600000
- 59422 words of font info for 78 fonts, out of 8000000 for 9000
+ 13596 strings out of 493304
+ 186205 string characters out of 6139870
+ 277350 words of memory out of 5000000
+ 16554 multiletter control sequences out of 15000+600000
+ 62190 words of font info for 80 fonts, out of 8000000 for 9000
  958 hyphenation exceptions out of 8191
- 36i,11n,45p,527b,667s stack positions out of 5000i,500n,10000p,200000b,80000s
+ 36i,12n,45p,527b,673s stack positions out of 5000i,500n,10000p,200000b,80000s
 {/usr/share/texlive/texmf-dist/fonts/enc/dvips/base/8r.enc}</usr/share/texliv
 e/texmf-dist/fonts/type1/urw/courier/ucrb8a.pfb></usr/share/texlive/texmf-dist/
 fonts/type1/urw/courier/ucrr8a.pfb></usr/share/texlive/texmf-dist/fonts/type1/u
@@ -1070,12 +1091,13 @@ rw/courier/ucrro8a.pfb></usr/share/texlive/texmf-dist/fonts/type1/urw/helvetic/
 uhvb8a.pfb></usr/share/texlive/texmf-dist/fonts/type1/urw/helvetic/uhvbo8a.pfb>
 </usr/share/texlive/texmf-dist/fonts/type1/urw/helvetic/uhvr8a.pfb></usr/share/
 texlive/texmf-dist/fonts/type1/urw/times/utmb8a.pfb></usr/share/texlive/texmf-d
-ist/fonts/type1/urw/times/utmr8a.pfb></usr/share/texlive/texmf-dist/fonts/type1
-/urw/times/utmri8a.pfb>
-Output written on MindstormsEV3Toolbox.pdf (19 pages, 147194 bytes).
+ist/fonts/type1/urw/times/utmbi8a.pfb></usr/share/texlive/texmf-dist/fonts/type
+1/urw/times/utmr8a.pfb></usr/share/texlive/texmf-dist/fonts/type1/urw/times/utm
+ri8a.pfb>
+Output written on MindstormsEV3Toolbox.pdf (28 pages, 177469 bytes).
 PDF statistics:
- 374 PDF objects out of 1000 (max. 8388607)
- 335 compressed objects within 4 object streams
- 115 named destinations out of 1000 (max. 500000)
- 93 words of extra memory for PDF output out of 10000 (max. 10000000)
+ 584 PDF objects out of 1000 (max. 8388607)
+ 533 compressed objects within 6 object streams
+ 186 named destinations out of 1000 (max. 500000)
+ 109 words of extra memory for PDF output out of 10000 (max. 10000000)
 
diff --git a/docs/_build/latex/MindstormsEV3Toolbox.out b/docs/_build/latex/MindstormsEV3Toolbox.out
index a3656293d1a5d4a6b281fe33e068efefbe2c3eb8..2a21406590ebad8fc4a7e706f91a278aed799cf3 100644
--- a/docs/_build/latex/MindstormsEV3Toolbox.out
+++ b/docs/_build/latex/MindstormsEV3Toolbox.out
@@ -4,6 +4,8 @@
 \BOOKMARK [1][-]{section.1.3}{\376\377\000E\000V\0003}{chapter.1}% 4
 \BOOKMARK [1][-]{section.1.4}{\376\377\000M\000o\000t\000o\000r}{chapter.1}% 5
 \BOOKMARK [1][-]{section.1.5}{\376\377\000S\000e\000n\000s\000o\000r}{chapter.1}% 6
-\BOOKMARK [1][-]{section.1.6}{\376\377\000C\000o\000m\000m\000a\000n\000d\000L\000a\000y\000e\000r}{chapter.1}% 7
-\BOOKMARK [1][-]{section.1.7}{\376\377\000C\000o\000m\000m\000u\000n\000i\000c\000a\000t\000i\000o\000n\000L\000a\000y\000e\000r}{chapter.1}% 8
-\BOOKMARK [0][-]{section*.80}{\376\377\000I\000n\000d\000e\000x}{}% 9
+\BOOKMARK [1][-]{section.1.6}{\376\377\000h\000i\000d\000a\000p\000i}{chapter.1}% 7
+\BOOKMARK [1][-]{section.1.7}{\376\377\000u\000s\000b\000B\000r\000i\000c\000k\000I\000O}{chapter.1}% 8
+\BOOKMARK [1][-]{section.1.8}{\376\377\000b\000t\000B\000r\000i\000c\000k\000I\000O}{chapter.1}% 9
+\BOOKMARK [0][-]{section*.141}{\376\377\000M\000A\000T\000L\000A\000B\000\040\000M\000o\000d\000u\000l\000e\000\040\000I\000n\000d\000e\000x}{}% 10
+\BOOKMARK [0][-]{section*.142}{\376\377\000I\000n\000d\000e\000x}{}% 11
diff --git a/docs/_build/latex/MindstormsEV3Toolbox.pdf b/docs/_build/latex/MindstormsEV3Toolbox.pdf
index 9cdd0866b3af5daeedf5e982750691f77aeb284c..c3f9b1702839739ec2c5a6c5cbc72bf7007fbbac 100644
Binary files a/docs/_build/latex/MindstormsEV3Toolbox.pdf and b/docs/_build/latex/MindstormsEV3Toolbox.pdf differ
diff --git a/docs/_build/latex/MindstormsEV3Toolbox.tex b/docs/_build/latex/MindstormsEV3Toolbox.tex
index 40579d2915147349fd4b132ed553a93cb45bc90a..495062e2525d46b111c71732b37b91f419faad6d 100644
--- a/docs/_build/latex/MindstormsEV3Toolbox.tex
+++ b/docs/_build/latex/MindstormsEV3Toolbox.tex
@@ -32,7 +32,7 @@
 
 
 \title{Mindstorms EV3 Toolbox Documentation}
-\date{Feb 23, 2017}
+\date{May 09, 2017}
 \release{v0.4-rc.10}
 \author{LfB - RWTH Aachen}
 \newcommand{\sphinxlogo}{}
@@ -146,8 +146,8 @@
 
 This MATLAB toolbox was designed to abstract and simplify controlling Lego Mindstorms
 EV3 robots. Via Bluetooth or USB you can read sensor values or control
-your robots' motors in an intuitive way. On a low level (the {\hyperref[CommunicationLayer::doc]{\sphinxcrossref{\DUrole{doc}{Communication
-layer}}}}) you are able to send various commands directly to the brick, while on a high level,
+your robots' motors in an intuitive way. On a low level (the \DUrole{xref,doc}{Communication
+layer}) you are able to send various commands directly to the brick, while on a high level,
 several classes abstract this behaviour for you. If you want to easily access your EV3 robot,
 these are the classes you will mostly use.
 
@@ -197,7 +197,36 @@ Toolbox documentation
 \label{EV3:ev3}\label{EV3::doc}\index{EV3 (class in source)}
 
 \begin{fulllineitems}
-\phantomsection\label{EV3:source.EV3}\pysiglinewithargsret{\sphinxstrong{class }\sphinxcode{source.}\sphinxbfcode{EV3}}{\emph{varargin}}{}
+\phantomsection\label{EV3:source.EV3}\pysiglinewithargsret{\sphinxstrong{class }\sphinxcode{source.}\sphinxbfcode{EV3}}{\emph{varargin}}{}~\begin{description}
+\item[{\emph{List of methods}:}] \leavevmode\begin{itemize}
+\item {} 
+\sphinxcode{connect()}
+
+\item {} 
+\sphinxcode{disconnect()}
+
+\item {} 
+\sphinxcode{stopAllMotors()}
+
+\item {} 
+\sphinxcode{beep()}
+
+\item {} 
+\sphinxcode{playTone()}
+
+\item {} 
+\sphinxcode{stopTone()}
+
+\item {} 
+\sphinxcode{tonePlayed()}
+
+\item {} 
+\sphinxcode{setProperties()}
+
+\end{itemize}
+
+\end{description}
+
 High-level class to work with physical bricks.
 
 This is the `central' class (from user's view) when working with this toolbox. It
@@ -422,7 +451,7 @@ Plays tone on brick.
 \textbf{\texttt{frequency}} (\emph{\texttt{numeric in {[}250, 10000{]}}}) -- in Hertz
 
 \item {} 
-\textbf{\texttt{duration}} (\emph{\texttt{numeric \textgreater{}0}}) -- in milliseconds
+\textbf{\texttt{duration}} (\emph{\texttt{numeric \textgreater{} 0}}) -- in milliseconds
 
 \end{itemize}
 
@@ -519,7 +548,39 @@ b.tonePlayed(); \% -\textgreater{} Outputs 1 to console.
 \label{Motor::doc}\label{Motor:motor}\index{Motor (class in source)}
 
 \begin{fulllineitems}
-\phantomsection\label{Motor:source.Motor}\pysiglinewithargsret{\sphinxstrong{class }\sphinxcode{source.}\sphinxbfcode{Motor}}{\emph{varargin}}{}
+\phantomsection\label{Motor:source.Motor}\pysiglinewithargsret{\sphinxstrong{class }\sphinxcode{source.}\sphinxbfcode{Motor}}{\emph{varargin}}{}~\begin{description}
+\item[{\emph{List of methods}:}] \leavevmode\begin{itemize}
+\item {} 
+{\hyperref[Motor:source.Motor.start]{\sphinxcrossref{\sphinxcode{start()}}}}
+
+\item {} 
+{\hyperref[Motor:source.Motor.stop]{\sphinxcrossref{\sphinxcode{stop()}}}}
+
+\item {} 
+{\hyperref[Motor:source.Motor.syncedStart]{\sphinxcrossref{\sphinxcode{syncedStart()}}}}
+
+\item {} 
+{\hyperref[Motor:source.Motor.syncedStop]{\sphinxcrossref{\sphinxcode{syncedStop()}}}}
+
+\item {} 
+{\hyperref[Motor:source.Motor.waitFor]{\sphinxcrossref{\sphinxcode{waitFor()}}}}
+
+\item {} 
+{\hyperref[Motor:source.Motor.internalReset]{\sphinxcrossref{\sphinxcode{internalReset()}}}}
+
+\item {} 
+{\hyperref[Motor:source.Motor.resetTachoCount]{\sphinxcrossref{\sphinxcode{resetTachoCount()}}}}
+
+\item {} 
+{\hyperref[Motor:source.Motor.setBrake]{\sphinxcrossref{\sphinxcode{setBrake()}}}}
+
+\item {} 
+{\hyperref[Motor:source.Motor.setProperties]{\sphinxcrossref{\sphinxcode{setProperties()}}}}
+
+\end{itemize}
+
+\end{description}
+
 High-level class to work with motors.
 
 This class is supposed to ease the use of the brick's motors. It is possible to set all
@@ -901,7 +962,18 @@ connected as speed correctly returns 0 if it's not)
 \label{Sensor:sensor}\label{Sensor::doc}\index{Sensor (class in source)}
 
 \begin{fulllineitems}
-\phantomsection\label{Sensor:source.Sensor}\pysiglinewithargsret{\sphinxstrong{class }\sphinxcode{source.}\sphinxbfcode{Sensor}}{\emph{varargin}}{}
+\phantomsection\label{Sensor:source.Sensor}\pysiglinewithargsret{\sphinxstrong{class }\sphinxcode{source.}\sphinxbfcode{Sensor}}{\emph{varargin}}{}~\begin{description}
+\item[{\emph{List of methods}:}] \leavevmode\begin{itemize}
+\item {} 
+{\hyperref[Sensor:source.Sensor.reset]{\sphinxcrossref{\sphinxcode{reset()}}}}
+
+\item {} 
+{\hyperref[Sensor:source.Sensor.setProperties]{\sphinxcrossref{\sphinxcode{setProperties()}}}}
+
+\end{itemize}
+
+\end{description}
+
 High-level class to work with sensors.
 
 The Sensor-class facilitates the communication with sensors. This mainly consists of
@@ -1267,26 +1339,759 @@ b.sensor1.setProperties(`debug', `on', `mode', DeviceMode.Color.Ambient); \%
 
 
 Advanced
-\phantomsection\label{CommandLayer:module-source}\index{source (module)}
+\phantomsection\label{hid:module-source}\index{source (module)}
+
+\section{hidapi}
+\label{hid:hidapi}\label{hid::doc}\index{hidapi (class in source)}
+
+\begin{fulllineitems}
+\phantomsection\label{hid:source.hidapi}\pysiglinewithargsret{\sphinxstrong{class }\sphinxcode{source.}\sphinxbfcode{hidapi}}{\emph{vendorID}, \emph{productID}, \emph{nReadBuffer}, \emph{nWriteBuffer}}{}~\begin{description}
+\item[{\emph{List of methods}:}] \leavevmode\begin{itemize}
+\item {} 
+{\hyperref[hid:source.hidapi.open]{\sphinxcrossref{\sphinxcode{open()}}}}
+
+\item {} 
+{\hyperref[hid:source.hidapi.close]{\sphinxcrossref{\sphinxcode{close()}}}}
+
+\item {} 
+{\hyperref[hid:source.hidapi.read]{\sphinxcrossref{\sphinxcode{read()}}}}
+
+\item {} 
+{\hyperref[hid:source.hidapi.read_timeout]{\sphinxcrossref{\sphinxcode{read\_timeout()}}}}
+
+\item {} 
+{\hyperref[hid:source.hidapi.write]{\sphinxcrossref{\sphinxcode{write()}}}}
+
+\item {} 
+{\hyperref[hid:source.hidapi.getHIDInfoString]{\sphinxcrossref{\sphinxcode{getHIDInfoString()}}}}
+
+\item {} 
+{\hyperref[hid:source.hidapi.setNonBlocking]{\sphinxcrossref{\sphinxcode{setNonBlocking()}}}}
+
+\item {} 
+{\hyperref[hid:source.hidapi.init]{\sphinxcrossref{\sphinxcode{init()}}}}
+
+\item {} 
+{\hyperref[hid:source.hidapi.exit]{\sphinxcrossref{\sphinxcode{exit()}}}}
+
+\item {} 
+{\hyperref[hid:source.hidapi.error]{\sphinxcrossref{\sphinxcode{error()}}}}
+
+\item {} 
+{\hyperref[hid:source.hidapi.enumerate]{\sphinxcrossref{\sphinxcode{enumerate()}}}}
+
+\item {} 
+{\hyperref[hid:source.hidapi.getManufacturersString]{\sphinxcrossref{\sphinxcode{getManufacturersString()}}}}
+
+\item {} 
+{\hyperref[hid:source.hidapi.getProductString]{\sphinxcrossref{\sphinxcode{getProductString()}}}}
+
+\item {} 
+{\hyperref[hid:source.hidapi.getSerialNumberString]{\sphinxcrossref{\sphinxcode{getSerialNumberString()}}}}
+
+\end{itemize}
+
+\end{description}
+
+Interface to the hidapi library
+\paragraph{Notes}
+\begin{itemize}
+\item {} 
+Developed from the hidapi available at \url{http://www.signal11.us/oss/hidapi/}.
+
+\item {} 
+Windows: hidapi.dll needed.
+
+\item {} 
+Mac: hidapi.dylib needed. In addition, Xcode has to be installed.
+
+\item {} 
+Linux: hidapi has to be compiled on host-system.
+
+\end{itemize}
+\index{handle (source.hidapi attribute)}
+
+\begin{fulllineitems}
+\phantomsection\label{hid:source.hidapi.handle}\pysigline{\sphinxbfcode{handle}}
+\end{fulllineitems}
+
+\index{vendorID (source.hidapi attribute)}
+
+\begin{fulllineitems}
+\phantomsection\label{hid:source.hidapi.vendorID}\pysigline{\sphinxbfcode{vendorID}}
+\emph{numeric} -- Vendor-ID of the USB device.
+
+\end{fulllineitems}
+
+\index{productID (source.hidapi attribute)}
+
+\begin{fulllineitems}
+\phantomsection\label{hid:source.hidapi.productID}\pysigline{\sphinxbfcode{productID}}
+\emph{numeric} -- Product-ID of the USB device.
+
+\end{fulllineitems}
+
+\index{nReadBuffer (source.hidapi attribute)}
+
+\begin{fulllineitems}
+\phantomsection\label{hid:source.hidapi.nReadBuffer}\pysigline{\sphinxbfcode{nReadBuffer}}
+\emph{numeric} -- Read-buffer size in bytes.
+
+\end{fulllineitems}
+
+\index{nWriteBuffer (source.hidapi attribute)}
+
+\begin{fulllineitems}
+\phantomsection\label{hid:source.hidapi.nWriteBuffer}\pysigline{\sphinxbfcode{nWriteBuffer}}
+\emph{numeric} -- Write-buffer size in bytes. Needs to be 1 Byte bigger than
+actual packet.
+
+\end{fulllineitems}
+
+\index{slib (source.hidapi attribute)}
+
+\begin{fulllineitems}
+\phantomsection\label{hid:source.hidapi.slib}\pysigline{\sphinxbfcode{slib}}
+\emph{string} -- Name of shared library file (without file extension). Defaults to
+`hidapi'.
+
+\end{fulllineitems}
 
-\section{CommandLayer}
-\label{CommandLayer:commandlayer}\label{CommandLayer::doc}
+\index{sheader (source.hidapi attribute)}
 
-\subsection{Command}
-\label{CommandLayer:command}
+\begin{fulllineitems}
+\phantomsection\label{hid:source.hidapi.sheader}\pysigline{\sphinxbfcode{sheader}}
+\emph{string} -- Name of shared library header. Defaults to `hidapi.h'.
+
+\end{fulllineitems}
+
+\paragraph{Example}
+
+hidHandle = hidapi(1684,0005,1024,1025); \%\textbar{}br\textbar{}
+\index{close() (source.hidapi method)}
+
+\begin{fulllineitems}
+\phantomsection\label{hid:source.hidapi.close}\pysiglinewithargsret{\sphinxbfcode{close}}{\emph{hid}}{}
+Close the connection to a hid device.
+\begin{description}
+\item[{Throws:}] \leavevmode
+InvalidHandle: Handle to USB-device not valid
+
+\end{description}
+\paragraph{Notes}
+\begin{itemize}
+\item {} 
+Gets called automatically when deleting the hidapi instance.
+
+\end{itemize}
+\begin{enumerate}
+\setcounter{enumi}{2000}
+\item {} 
+Check if pointer is (unexpectedly) already invalidated
+
+\end{enumerate}
+
+\end{fulllineitems}
+
+\index{enumerate() (source.hidapi method)}
+
+\begin{fulllineitems}
+\phantomsection\label{hid:source.hidapi.enumerate}\pysiglinewithargsret{\sphinxbfcode{enumerate}}{\emph{hid}, \emph{vendorID}, \emph{productID}}{}
+Enumerates the info about the hid device with the given vendorID and productID
+and returns a string with the returned hid information.
+\begin{quote}\begin{description}
+\item[{Parameters}] \leavevmode\begin{itemize}
+\item {} 
+\textbf{\texttt{vendorID}} (\emph{\texttt{numeric}}) -- Vendor-ID of the USB device in decimal.
+
+\item {} 
+\textbf{\texttt{productID}} (\emph{\texttt{numeric}}) -- Product-ID of the USB device in decimal.
+
+\end{itemize}
+
+\end{description}\end{quote}
+\paragraph{Notes}
+\begin{itemize}
+\item {} 
+Using a vendorID and productID of (0,0) will enumerate all connected hid
+devices.
+
+\item {} 
+MATLAB does not have the hid\_device\_infoPtr struct so some of the returned
+information will need to be resized and cast into uint8 or chars.
+
+\end{itemize}
+
+Enumerate the hid devices
+
+\end{fulllineitems}
+
+\index{error() (source.hidapi method)}
+
+\begin{fulllineitems}
+\phantomsection\label{hid:source.hidapi.error}\pysiglinewithargsret{\sphinxbfcode{error}}{\emph{hid}}{}
+Return the hid device error string if a function produced an error.
+\begin{description}
+\item[{Throws:}] \leavevmode
+InvalidHandle: Handle to USB-device not valid
+
+\end{description}
+\paragraph{Notes}
+\begin{itemize}
+\item {} 
+This function must be called explicitly if you think an error was generated
+from the hid device.
+
+\end{itemize}
+\begin{enumerate}
+\setcounter{enumi}{2000}
+\item {} 
+Check if pointer is (unexpectedly) already invalidated
+
+\end{enumerate}
+
+\end{fulllineitems}
+
+\index{exit() (source.hidapi method)}
+
+\begin{fulllineitems}
+\phantomsection\label{hid:source.hidapi.exit}\pysiglinewithargsret{\sphinxbfcode{exit}}{\emph{hid}}{}
+hidapi.exit Exit hidapi
+
+hid.exit() exits the hidapi library.
+\begin{description}
+\item[{Throws:}] \leavevmode
+CommError: Error during communication with device
 
-\subsection{CommunicationInterface}
-\label{CommandLayer:communicationinterface}\phantomsection\label{CommunicationLayer:module-source}\index{source (module)}
+\end{description}
+
+Notes::
+- You should not have to call this function directly.
+
+\end{fulllineitems}
+
+\index{getHIDInfoString() (source.hidapi method)}
+
+\begin{fulllineitems}
+\phantomsection\label{hid:source.hidapi.getHIDInfoString}\pysiglinewithargsret{\sphinxbfcode{getHIDInfoString}}{\emph{hid}, \emph{info}}{}
+Get the corresponding hid info from the hid device.
+\begin{description}
+\item[{Throws:}] \leavevmode
+CommError: Error during communication with device
+InvalidHandle: Handle to USB-device not valid
+
+\end{description}
+\paragraph{Notes}
+\begin{itemize}
+\item {} 
+Info is the hid information string.
+
+\end{itemize}
+
+See also HIDAPI.GETMANUFACTURERSSTRING, HIDAPI.GETPRODUCTSTRING,
+HIDAPI.GETSERIALNUMBERSTRING.
+
+Read buffer nReadBuffer length
+
+\end{fulllineitems}
+
+\index{getManufacturersString() (source.hidapi method)}
+
+\begin{fulllineitems}
+\phantomsection\label{hid:source.hidapi.getManufacturersString}\pysiglinewithargsret{\sphinxbfcode{getManufacturersString}}{\emph{hid}}{}
+Get manufacturers string from hid object using getHIDInfoString.
+
+\end{fulllineitems}
+
+\index{getProductString() (source.hidapi method)}
+
+\begin{fulllineitems}
+\phantomsection\label{hid:source.hidapi.getProductString}\pysiglinewithargsret{\sphinxbfcode{getProductString}}{\emph{hid}}{}
+Get product string from hid object using getProductString.
+
+\end{fulllineitems}
+
+\index{getSerialNumberString() (source.hidapi method)}
+
+\begin{fulllineitems}
+\phantomsection\label{hid:source.hidapi.getSerialNumberString}\pysiglinewithargsret{\sphinxbfcode{getSerialNumberString}}{\emph{hid}}{}
+Get serial number from hid object using getSerialNumberString.
+
+\end{fulllineitems}
+
+\index{init() (source.hidapi method)}
+
+\begin{fulllineitems}
+\phantomsection\label{hid:source.hidapi.init}\pysiglinewithargsret{\sphinxbfcode{init}}{\emph{hid}}{}
+Inits the hidapi library.
+\begin{description}
+\item[{Throws:}] \leavevmode
+CommError: Error during communication with device
+
+\end{description}
+\paragraph{Notes}
+\begin{itemize}
+\item {} 
+This is called automatically in the library itself with the open function. You
+should not have to call this function directly.
+
+\end{itemize}
+
+\end{fulllineitems}
+
+\index{open() (source.hidapi method)}
+
+\begin{fulllineitems}
+\phantomsection\label{hid:source.hidapi.open}\pysiglinewithargsret{\sphinxbfcode{open}}{\emph{hid}}{}
+Open a connection with a hid device
+\begin{description}
+\item[{Throws:}] \leavevmode
+CommError: Error during communication with device
+
+\end{description}
+\paragraph{Notes}
+\begin{itemize}
+\item {} 
+Gets called automatically when creating an hidapi-object.
+
+\item {} 
+The pointer return value from this library call is always null so it is not
+possible to know if the open was successful.
+
+\item {} 
+The final parameter to the open hidapi library call has different types
+depending on OS. On windows it is uint16, on linux/mac int32.
+
+\end{itemize}
 
-\section{CommunicationLayer}
-\label{CommunicationLayer:communicationlayer}\label{CommunicationLayer::doc}
+Create a null pointer for the hid\_open function (depends on OS)
+
+\end{fulllineitems}
+
+\index{read() (source.hidapi method)}
+
+\begin{fulllineitems}
+\phantomsection\label{hid:source.hidapi.read}\pysiglinewithargsret{\sphinxbfcode{read}}{\emph{hid}}{}
+Read from a hid device and returns the read bytes.
+\begin{description}
+\item[{Throws:}] \leavevmode
+CommError: Error during communication with device
+InvalidHandle: Handle to USB-device not valid
+
+\end{description}
+\paragraph{Notes}
+\begin{itemize}
+\item {} 
+Will print an error if no data was read.
+
+\end{itemize}
+
+Read buffer of nReadBuffer length
+
+\end{fulllineitems}
+
+\index{read\_timeout() (source.hidapi method)}
+
+\begin{fulllineitems}
+\phantomsection\label{hid:source.hidapi.read_timeout}\pysiglinewithargsret{\sphinxbfcode{read\_timeout}}{\emph{hid}, \emph{timeOut}}{}
+Read from a hid device with a timeout and return the read bytes.
+\begin{quote}\begin{description}
+\item[{Parameters}] \leavevmode
+\textbf{\texttt{timeOut}} (\emph{\texttt{numeric \textgreater{}= 0}}) -- Milliseconds after which a timeout-error occurs if no
+packet could be read.
+
+\end{description}\end{quote}
+\begin{description}
+\item[{Throws:}] \leavevmode
+CommError: Error during communication with device
+InvalidHandle: Handle to USB-device not valid
+
+\end{description}
+
+Read buffer of nReadBuffer length
+
+\end{fulllineitems}
+
+\index{setNonBlocking() (source.hidapi method)}
+
+\begin{fulllineitems}
+\phantomsection\label{hid:source.hidapi.setNonBlocking}\pysiglinewithargsret{\sphinxbfcode{setNonBlocking}}{\emph{hid}, \emph{nonblock}}{}
+Set the non blocking flag on the hid device connection.
+\begin{quote}\begin{description}
+\item[{Parameters}] \leavevmode
+\textbf{\texttt{nonblock}} (\emph{\texttt{numeric in \{0,1\}}}) -- 0 disables nonblocking, 1 enables nonblocking
+
+\end{description}\end{quote}
+\begin{description}
+\item[{Throws:}] \leavevmode
+CommError: Error during communication with device
+InvalidHandle: Handle to USB-device not valid
+
+\end{description}
+\begin{enumerate}
+\setcounter{enumi}{2000}
+\item {} 
+Check if pointer is (unexpectedly) already invalidated
+
+\end{enumerate}
+
+\end{fulllineitems}
+
+\index{write() (source.hidapi method)}
+
+\begin{fulllineitems}
+\phantomsection\label{hid:source.hidapi.write}\pysiglinewithargsret{\sphinxbfcode{write}}{\emph{hid}, \emph{wmsg}, \emph{reportID}}{}
+Write to a hid device.
+\begin{description}
+\item[{Throws:}] \leavevmode
+CommError: Error during communication with device
+InvalidHandle: Handle to USB-device not valid
+
+\end{description}
+\paragraph{Notes}
+\begin{itemize}
+\item {} 
+Will print an error if there is a mismatch between the buffer size and the
+reported number of bytes written.
+
+\end{itemize}
+
+Append a 0 at the front for HID report ID
+
+\end{fulllineitems}
+
+
+\end{fulllineitems}
+
+\phantomsection\label{usbBrickIO:module-source}\index{source (module)}
+
+\section{usbBrickIO}
+\label{usbBrickIO:usbbrickio}\label{usbBrickIO::doc}\index{usbBrickIO (class in source)}
+
+\begin{fulllineitems}
+\phantomsection\label{usbBrickIO:source.usbBrickIO}\pysiglinewithargsret{\sphinxstrong{class }\sphinxcode{source.}\sphinxbfcode{usbBrickIO}}{\emph{varargin}}{}~\begin{description}
+\item[{\emph{List of methods}:}] \leavevmode\begin{itemize}
+\item {} 
+{\hyperref[usbBrickIO:source.usbBrickIO.open]{\sphinxcrossref{\sphinxcode{open()}}}}
+
+\item {} 
+{\hyperref[usbBrickIO:source.usbBrickIO.close]{\sphinxcrossref{\sphinxcode{close()}}}}
+
+\item {} 
+{\hyperref[usbBrickIO:source.usbBrickIO.read]{\sphinxcrossref{\sphinxcode{read()}}}}
+
+\item {} 
+{\hyperref[usbBrickIO:source.usbBrickIO.write]{\sphinxcrossref{\sphinxcode{write()}}}}
+
+\item {} 
+{\hyperref[usbBrickIO:source.usbBrickIO.setProperties]{\sphinxcrossref{\sphinxcode{setProperties()}}}}
+
+\end{itemize}
+
+\end{description}
+
+USB interface between MATLAB and the brick
+\paragraph{Notes}
+\begin{itemize}
+\item {} 
+Uses the hid library implementation in hidapi.m
+
+\item {} 
+The default parameters should always work when you try to connect to an EV3 brick,
+so in nearly all use-cases, the constructor does not need any parameters (besides
+`debug' eventually).
+
+\end{itemize}
+\index{debug (source.usbBrickIO attribute)}
+
+\begin{fulllineitems}
+\phantomsection\label{usbBrickIO:source.usbBrickIO.debug}\pysigline{\sphinxbfcode{debug}}
+\emph{bool} -- If true, each open/close/read/write-call will be noted in the console.
+Defaults to false.
+
+\end{fulllineitems}
+
+\index{vendorID (source.usbBrickIO attribute)}
+
+\begin{fulllineitems}
+\phantomsection\label{usbBrickIO:source.usbBrickIO.vendorID}\pysigline{\sphinxbfcode{vendorID}}
+\emph{numeric} -- Vendor-ID of the USB device. Defaults to 0x694 (EV3 vendor ID).
+
+\end{fulllineitems}
+
+\index{productID (source.usbBrickIO attribute)}
+
+\begin{fulllineitems}
+\phantomsection\label{usbBrickIO:source.usbBrickIO.productID}\pysigline{\sphinxbfcode{productID}}
+\emph{numeric} -- Product-ID of the USB device. Defaults to 0x0005 (EV3 product ID).
+
+\end{fulllineitems}
+
+\index{nReadBuffer (source.usbBrickIO attribute)}
+
+\begin{fulllineitems}
+\phantomsection\label{usbBrickIO:source.usbBrickIO.nReadBuffer}\pysigline{\sphinxbfcode{nReadBuffer}}
+\emph{numeric} -- Read-buffer size in bytes. Defaults to 1024.
+
+\end{fulllineitems}
+
+\index{nWriteBuffer (source.usbBrickIO attribute)}
+
+\begin{fulllineitems}
+\phantomsection\label{usbBrickIO:source.usbBrickIO.nWriteBuffer}\pysigline{\sphinxbfcode{nWriteBuffer}}
+\emph{numeric} -- Write-buffer size in bytes. Needs to be 1 Byte bigger than
+actual packet. Defaults to 1025 (EV3 USB maximum packet size = 1024).
+
+\end{fulllineitems}
+
+\index{timeOut (source.usbBrickIO attribute)}
+
+\begin{fulllineitems}
+\phantomsection\label{usbBrickIO:source.usbBrickIO.timeOut}\pysigline{\sphinxbfcode{timeOut}}
+\emph{numeric \textgreater{}= 0} -- Milliseconds after which a timeout-error occurs if no packet could be
+read. Defaults to 10000.
+
+\end{fulllineitems}
+
+\paragraph{Examples}
+
+\% Connecting via USB 
+commHandle = usbBrickIO(); \% 
+\% Connecting via USB with enabled debug output 
+commHandle = usbBrickIO(`debug', true); \% 
+\index{close() (source.usbBrickIO method)}
+
+\begin{fulllineitems}
+\phantomsection\label{usbBrickIO:source.usbBrickIO.close}\pysiglinewithargsret{\sphinxbfcode{close}}{\emph{brickIO}}{}
+Closes the usb connection the brick through the hidapi interface.
+
+\end{fulllineitems}
+
+\index{open() (source.usbBrickIO method)}
+
+\begin{fulllineitems}
+\phantomsection\label{usbBrickIO:source.usbBrickIO.open}\pysiglinewithargsret{\sphinxbfcode{open}}{\emph{brickIO}}{}
+Opens the usb connection to the brick through the hidapi interface.
+
+\end{fulllineitems}
+
+\index{read() (source.usbBrickIO method)}
+
+\begin{fulllineitems}
+\phantomsection\label{usbBrickIO:source.usbBrickIO.read}\pysiglinewithargsret{\sphinxbfcode{read}}{\emph{brickIO}}{}
+Reads data from the brick through usb using the hidapi interface and returns the data in uint8 format.
+
+\end{fulllineitems}
+
+\index{setProperties() (source.usbBrickIO method)}
+
+\begin{fulllineitems}
+\phantomsection\label{usbBrickIO:source.usbBrickIO.setProperties}\pysiglinewithargsret{\sphinxbfcode{setProperties}}{\emph{brickIO}, \emph{varargin}}{}
+Sets multiple usbBrickIO properties at once using MATLAB's inputParser.
+
+The syntax is as follows: commHandle.setProperties(`propertyName1',
+propertyValue1, `propertyName2', propertyValue2, ...). Valid, optional properties
+are: debug, vendorID, productID, nReadBuffer, nWriteBuffer, timeOut.
+
+See also USBBRICKIO.DEBUG, USBBRICKIO.VENDORID, USBBRICKIO.PRODUCTID,
+USBBRICKIO.NREADBUFFER, USBBRICKIO.NWRITEBUFFER, USBBRICKIO.TIMEOUT
+
+\end{fulllineitems}
+
+\index{write() (source.usbBrickIO method)}
+
+\begin{fulllineitems}
+\phantomsection\label{usbBrickIO:source.usbBrickIO.write}\pysiglinewithargsret{\sphinxbfcode{write}}{\emph{brickIO}, \emph{wmsg}}{}
+Writes data to the brick through usb using the hidapi interface.
+\begin{quote}\begin{description}
+\item[{Parameters}] \leavevmode
+\textbf{\texttt{wmsg}} (\emph{\texttt{uint8 array}}) -- Data to be written to the brick via usb
+
+\end{description}\end{quote}
+
+\end{fulllineitems}
+
+
+\end{fulllineitems}
+
+\phantomsection\label{btBrickIO:module-source}\index{source (module)}
+
+\section{btBrickIO}
+\label{btBrickIO:btbrickio}\label{btBrickIO::doc}\index{btBrickIO (class in source)}
+
+\begin{fulllineitems}
+\phantomsection\label{btBrickIO:source.btBrickIO}\pysiglinewithargsret{\sphinxstrong{class }\sphinxcode{source.}\sphinxbfcode{btBrickIO}}{\emph{varargin}}{}~\begin{description}
+\item[{\emph{List of methods}:}] \leavevmode\begin{itemize}
+\item {} 
+{\hyperref[btBrickIO:source.btBrickIO.open]{\sphinxcrossref{\sphinxcode{open()}}}}
+
+\item {} 
+{\hyperref[btBrickIO:source.btBrickIO.close]{\sphinxcrossref{\sphinxcode{close()}}}}
+
+\item {} 
+{\hyperref[btBrickIO:source.btBrickIO.read]{\sphinxcrossref{\sphinxcode{read()}}}}
+
+\item {} 
+{\hyperref[btBrickIO:source.btBrickIO.write]{\sphinxcrossref{\sphinxcode{write()}}}}
+
+\item {} 
+{\hyperref[btBrickIO:source.btBrickIO.setProperties]{\sphinxcrossref{\sphinxcode{setProperties()}}}}
+
+\end{itemize}
+
+\end{description}
+
+Bluetooth interface between MATLAB and the brick
+\paragraph{Notes}
+\begin{itemize}
+\item {} 
+Connects to the bluetooth module on the host through a serial
+connection. Hence be sure that a serial connection to the bluetooth
+module can be made. Also be sure that the bluetooth module has been paired
+to the brick before trying to connect.
+
+\item {} \begin{description}
+\item[{Usage is OS-dependent:}] \leavevmode\begin{itemize}
+\item {} 
+Windows: the deviceName- \& channel-properties are needed for connection. The implementation is based on the Instrument Control toolbox.
+
+\item {} 
+Linux (and potentially Mac): serialPort-property is needed for connection. The implementation is based on MATLAB's serial port implementation.
+
+\end{itemize}
+
+\end{description}
+
+\item {} 
+For general information, see also \sphinxcode{BrickIO}.
+
+\end{itemize}
+\index{debug (source.btBrickIO attribute)}
+
+\begin{fulllineitems}
+\phantomsection\label{btBrickIO:source.btBrickIO.debug}\pysigline{\sphinxbfcode{debug}}
+\emph{bool} -- If true, each open/close/read/write-call will be shown in the console.
+Defaults to false.
+
+\end{fulllineitems}
+
+\index{serialPort (source.btBrickIO attribute)}
+
+\begin{fulllineitems}
+\phantomsection\label{btBrickIO:source.btBrickIO.serialPort}\pysigline{\sphinxbfcode{serialPort}}
+\emph{string} -- Path to the serial-port object. Only needed when using MATLAB's
+serial class (i.e. on linux/mac). Defaults to `/dev/rfcomm0'.
+
+\end{fulllineitems}
+
+\index{deviceName (source.btBrickIO attribute)}
+
+\begin{fulllineitems}
+\phantomsection\label{btBrickIO:source.btBrickIO.deviceName}\pysigline{\sphinxbfcode{deviceName}}
+\emph{string} -- Name of the BT-device = the brick. Only needed when using the
+Instrument Control toolbox (i.e. on windows). Defaults to `EV3'.
+
+\end{fulllineitems}
+
+\index{channel (source.btBrickIO attribute)}
+
+\begin{fulllineitems}
+\phantomsection\label{btBrickIO:source.btBrickIO.channel}\pysigline{\sphinxbfcode{channel}}
+\emph{numeric \textgreater{} 0} -- BT-channel of the connected BT-device. Only needed when using
+the Instrument Control toolbox (i.e. on windows). Defaults to 1.
+
+\end{fulllineitems}
+
+\index{timeOut (source.btBrickIO attribute)}
+
+\begin{fulllineitems}
+\phantomsection\label{btBrickIO:source.btBrickIO.timeOut}\pysigline{\sphinxbfcode{timeOut}}
+\emph{numeric \textgreater{}= 0} -- seconds after which a timeout-error occurs if no packet could be
+read. Defaults to 10.
+
+\end{fulllineitems}
+
+\index{backend (source.btBrickIO attribute)}
+
+\begin{fulllineitems}
+\phantomsection\label{btBrickIO:source.btBrickIO.backend}\pysigline{\sphinxbfcode{backend}}
+\emph{`serial'\textbar{}'instrumentControl'} -- Backend this implementation is based on. Is
+automatically chosen depending on the OS. Defaults to `serial' on linux/mac
+systems, and to `instrumentControl' on windows systems.
+
+\end{fulllineitems}
+
+\paragraph{Examples}
+
+\% Connecting on windows 
+commHandle = btBrickIO(`deviceName', `MyEV3', `channel', 1); \% 
+\% Connecting on windows using MATLABs default serial port implementation for testing 
+commHandle = btBrickIO(`deviceName', `MyEV3', `channel', 1, `backend', `serial'); \% 
+\% Connecting on mac/linux 
+commHandle = btBrickIO(`serPort', `/dev/rfcomm0'); \% 
+\index{close() (source.btBrickIO method)}
+
+\begin{fulllineitems}
+\phantomsection\label{btBrickIO:source.btBrickIO.close}\pysiglinewithargsret{\sphinxbfcode{close}}{\emph{brickIO}}{}
+Closes the bluetooth connection the brick using fclose.
+
+\end{fulllineitems}
+
+\index{open() (source.btBrickIO method)}
+
+\begin{fulllineitems}
+\phantomsection\label{btBrickIO:source.btBrickIO.open}\pysiglinewithargsret{\sphinxbfcode{open}}{\emph{brickIO}}{}
+Opens the bluetooth connection to the brick using fopen.
+
+\end{fulllineitems}
+
+\index{read() (source.btBrickIO method)}
+
+\begin{fulllineitems}
+\phantomsection\label{btBrickIO:source.btBrickIO.read}\pysiglinewithargsret{\sphinxbfcode{read}}{\emph{brickIO}}{}
+Reads data from the brick through bluetooth via fread and returns the data in uint8 format.
+
+\end{fulllineitems}
+
+\index{setProperties() (source.btBrickIO method)}
+
+\begin{fulllineitems}
+\phantomsection\label{btBrickIO:source.btBrickIO.setProperties}\pysiglinewithargsret{\sphinxbfcode{setProperties}}{\emph{brickIO}, \emph{varargin}}{}
+Sets multiple btBrickIO properties at once using MATLAB's inputParser.
+
+The syntax is as follows: commHandle.setProperties(`propertyName1',
+propertyValue1, `propertyName2', propertyValue2, ...). Valid, optional properties
+are: debug, serPort, deviceName, channel, timeout.
+
+See also BTBRICKIO.DEBUG, BTBRICKIO.SERIALPORT, BTBRICKIO.DEVICENAME,
+BTBRICKIO.CHANNEL, BTBRICKIO.TIMEOUT
+
+\end{fulllineitems}
+
+\index{write() (source.btBrickIO method)}
+
+\begin{fulllineitems}
+\phantomsection\label{btBrickIO:source.btBrickIO.write}\pysiglinewithargsret{\sphinxbfcode{write}}{\emph{brickIO}, \emph{wmsg}}{}
+Writes data to the brick through bluetooth via fwrite.
+\begin{quote}\begin{description}
+\item[{Parameters}] \leavevmode
+\textbf{\texttt{wmsg}} (\emph{\texttt{uint8 array}}) -- Data to be written to the brick via bluetooth
+
+\end{description}\end{quote}
+
+\end{fulllineitems}
+
+
+\end{fulllineitems}
 
-\subsection{USB}
-\label{CommunicationLayer:usb}
 
-\subsection{Bluetooth}
-\label{CommunicationLayer:bluetooth}
 
+\renewcommand{\indexname}{MATLAB Module Index}
+\begin{theindex}
+\def\bigletter#1{{\Large\sffamily#1}\nopagebreak\vspace{1mm}}
+\bigletter{s}
+\item {\texttt{source}}, \pageref{usbBrickIO:module-source}
+\end{theindex}
 
 \renewcommand{\indexname}{Index}
 \printindex
diff --git a/docs/_build/latex/MindstormsEV3Toolbox.toc b/docs/_build/latex/MindstormsEV3Toolbox.toc
index 9f33bc3bdc23cc9156dc2cb004f383e5705337fa..c486de7aa37289cd49fa48fcf6a23657e0798bcf 100644
--- a/docs/_build/latex/MindstormsEV3Toolbox.toc
+++ b/docs/_build/latex/MindstormsEV3Toolbox.toc
@@ -7,33 +7,45 @@
 \contentsline {section}{\numberline {1.2}Examples}{3}{section.1.2}
 \contentsline {section}{\numberline {1.3}EV3}{3}{section.1.3}
 \contentsline {paragraph}{Notes}{4}{paragraph*.5}
-\contentsline {paragraph}{Example}{4}{paragraph*.18}
+\contentsline {paragraph}{Example}{5}{paragraph*.18}
 \contentsline {paragraph}{Notes}{5}{paragraph*.20}
 \contentsline {paragraph}{Example}{5}{paragraph*.21}
 \contentsline {paragraph}{Example}{5}{paragraph*.23}
 \contentsline {paragraph}{Notes}{5}{paragraph*.25}
-\contentsline {paragraph}{Example}{5}{paragraph*.26}
+\contentsline {paragraph}{Example}{6}{paragraph*.26}
 \contentsline {paragraph}{Example}{6}{paragraph*.28}
 \contentsline {paragraph}{Example}{6}{paragraph*.30}
 \contentsline {paragraph}{Example}{6}{paragraph*.33}
-\contentsline {section}{\numberline {1.4}Motor}{6}{section.1.4}
+\contentsline {section}{\numberline {1.4}Motor}{7}{section.1.4}
 \contentsline {paragraph}{Notes}{7}{paragraph*.37}
 \contentsline {paragraph}{Notes}{8}{paragraph*.51}
-\contentsline {paragraph}{Notes}{8}{paragraph*.54}
+\contentsline {paragraph}{Notes}{9}{paragraph*.54}
 \contentsline {paragraph}{Example}{9}{paragraph*.56}
 \contentsline {paragraph}{Notes}{9}{paragraph*.59}
-\contentsline {paragraph}{Notes}{9}{paragraph*.61}
-\contentsline {paragraph}{Example}{9}{paragraph*.62}
+\contentsline {paragraph}{Notes}{10}{paragraph*.61}
+\contentsline {paragraph}{Example}{10}{paragraph*.62}
 \contentsline {paragraph}{Notes}{10}{paragraph*.64}
 \contentsline {paragraph}{Notes}{10}{paragraph*.66}
 \contentsline {section}{\numberline {1.5}Sensor}{10}{section.1.5}
-\contentsline {paragraph}{Notes}{10}{paragraph*.69}
+\contentsline {paragraph}{Notes}{11}{paragraph*.69}
 \contentsline {paragraph}{Notes}{13}{paragraph*.75}
-\contentsline {paragraph}{Example}{13}{paragraph*.77}
-\contentsline {section}{\numberline {1.6}CommandLayer}{13}{section.1.6}
-\contentsline {subsection}{\numberline {1.6.1}Command}{13}{subsection.1.6.1}
-\contentsline {subsection}{\numberline {1.6.2}CommunicationInterface}{13}{subsection.1.6.2}
-\contentsline {section}{\numberline {1.7}CommunicationLayer}{13}{section.1.7}
-\contentsline {subsection}{\numberline {1.7.1}USB}{13}{subsection.1.7.1}
-\contentsline {subsection}{\numberline {1.7.2}Bluetooth}{13}{subsection.1.7.2}
-\contentsline {chapter}{Index}{15}{section*.80}
+\contentsline {paragraph}{Example}{14}{paragraph*.77}
+\contentsline {section}{\numberline {1.6}hidapi}{14}{section.1.6}
+\contentsline {paragraph}{Notes}{14}{paragraph*.80}
+\contentsline {paragraph}{Example}{15}{paragraph*.88}
+\contentsline {paragraph}{Notes}{15}{paragraph*.90}
+\contentsline {paragraph}{Notes}{15}{paragraph*.92}
+\contentsline {paragraph}{Notes}{15}{paragraph*.94}
+\contentsline {paragraph}{Notes}{16}{paragraph*.97}
+\contentsline {paragraph}{Notes}{16}{paragraph*.102}
+\contentsline {paragraph}{Notes}{16}{paragraph*.104}
+\contentsline {paragraph}{Notes}{17}{paragraph*.106}
+\contentsline {paragraph}{Notes}{17}{paragraph*.110}
+\contentsline {section}{\numberline {1.7}usbBrickIO}{18}{section.1.7}
+\contentsline {paragraph}{Notes}{18}{paragraph*.113}
+\contentsline {paragraph}{Examples}{18}{paragraph*.120}
+\contentsline {section}{\numberline {1.8}btBrickIO}{19}{section.1.8}
+\contentsline {paragraph}{Notes}{19}{paragraph*.128}
+\contentsline {paragraph}{Examples}{20}{paragraph*.135}
+\contentsline {chapter}{MATLAB Module Index}{21}{section*.141}
+\contentsline {chapter}{Index}{23}{section*.142}
diff --git a/docs/btBrickIO.rst b/docs/btBrickIO.rst
new file mode 100644
index 0000000000000000000000000000000000000000..5e076d50dc1c141aef7ed955e216f4b3a438723c
--- /dev/null
+++ b/docs/btBrickIO.rst
@@ -0,0 +1,10 @@
+.. automodule:: source
+
+.. |br| raw:: html
+   
+   <br />
+btBrickIO
+=========
+
+.. autoclass:: btBrickIO
+   :members: open, close, read, write, setProperties
diff --git a/docs/hid.rst b/docs/hid.rst
new file mode 100644
index 0000000000000000000000000000000000000000..a81e179691da5a39122479c305bd02a5f82a5619
--- /dev/null
+++ b/docs/hid.rst
@@ -0,0 +1,10 @@
+.. automodule:: source
+
+.. |br| raw:: html
+   
+   <br />
+hidapi
+======
+
+.. autoclass:: hidapi
+   :members: open, close, read, read_timeout, write, getHIDInfoString, setNonBlocking, init, exit, error, enumerate, getManufacturersString, getProductString, getSerialNumberString
diff --git a/docs/index.rst b/docs/index.rst
index a75f04ace42e9750f8f5f8213320a304c343fd57..157a890c15b3b897ca5e3259d9f5fbe22c3fe0fe 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -45,8 +45,9 @@ Toolbox documentation
 Advanced
 
 .. toctree::
-   :maxdepth: 2
-
-   CommandLayer.rst
-   CommunicationLayer.rst
-
+   :maxdepth: 3
+   
+   hid
+   usbBrickIO
+   btBrickIO
+   
diff --git a/docs/process.py b/docs/process.py
index 7704a4582f74a583fb34b0ce802101f9991c0a8b..a350ddc9a07120c70e26a0c9f0ab7db7191957e9 100644
--- a/docs/process.py
+++ b/docs/process.py
@@ -5,64 +5,125 @@ from os import close, remove
 from tempfile import mkstemp
 from shutil import move
 
+TMP_FILE_STR = '%TEMP-FILE FOR BUILDING DOCUMENTATION'
+DOCUMENTED_CLASSES = ['Motor', 'Sensor', 'EV3', 'usbBrickIO', 'btBrickIO']  # If a new class shall be documented, it needs to be added to this list
+
 def preprocess():
     """Preprocesses data for building documentation
 
-    The MATLAB Sphinx extension takes veeery (or even infinitely?) long
-    to build the documentation if a class contains an enumeration.
+    Fixes the following problems:
+        - Comment out enumerations (The MATLAB Sphinx
+        extension takes veeery (or even infinitely?) long to build the
+        documentation if a class contains an enumeration)
+        - Insert comments for creating a list of methods a class contains (Names of
+        relevant methods taken from corresponding .rst-file. This is necessary
+        as the MATLAB Sphinx Extension has no functionality for creating compact
+        method lists.:( )
+
+        -> After creating the documentation, the changes are unmade (postprocess())
+
+    Prerequisites:
+        - Has to be inside toolboxFile/docs
+        - comments in the MATLAB source files shouldn't include the keywords
+        'classdef' and 'enumeration'
     """
 
     code_dir = os.path.abspath('../source')
-    files = _matlab_files(os.listdir(code_dir))
-    
+    files = _matlab_files(os.listdir(code_dir))  # Get list of all toolbox source files
+
+    documented_methods = _find_documented_methods()  # Get names of all documented methods from .rst-files
+
     n_files = len(files)
     for n, file_name in enumerate(files):
-        # print("Preprocessing file {0} [{1}|{2}]".format(file_name, n+1, n_files))
         try:
             fh, abs_path = mkstemp()
             with open(code_dir + "/" + file_name, 'r') as f:
-                with open(abs_path, 'w') as ftemp: 
+                with open(abs_path, 'w') as ftemp:
                     content = f.readlines()
-                    if content[0] == '%TEMP-FILE FOR BUILDING DOCUMENTATION\n':
+                    if content[0] == TMP_FILE_STR + '\n':
                         raise RuntimeError('Found already preprocessed file: ' + file_name)
 
                     try:
-                        for i, line in enumerate(content):  # Worst runtime ever 
-                            if _ignore_line(line) is False and 'enumeration' in line:
-                                ftemp.write('%TEMP-FILE FOR BUILDING DOCUMENTATION\n')
-                                _write_lines(content[:i], ftemp)
-                                for j, enum_line in enumerate(content[i:]):
-                                   ftemp.write(" %"+enum_line)
-                                   if " end" in enum_line or "end\n" == enum_line:		
-                                        _write_lines(content[i+1+j:], ftemp)
-                                        close(fh)
-                                        remove(code_dir + "/" + file_name)
-                                        move(abs_path, code_dir + "/" + file_name)
-                                        # At this point, entire file has been processed: continue outer loop
-                                        # Hackily implemented by raising an exception
-                                        raise StopIteration  
-                    except StopIteration:
+                        for i, line in enumerate(content):  # Worst runtime ever: Iterate over entire file line by line
+                            if _ignore_line(line) is False:
+                                if 'classdef' in line:  # Insert method-list string in relevant class docs
+                                    class_name = line.replace(' ', '').split('%')[0].split('<')[0].split('classdef')[1]
+                                    try:
+                                        methods = documented_methods[class_name]
+
+                                        line = line.replace('\n', '') + '  ' + TMP_FILE_STR + '\n'
+
+                                        _write_lines(content[:i], ftemp)
+                                        _write_lines([line], ftemp)
+                                        _write_lines(_method_lines(methods), ftemp)
+                                        _write_lines(content[i+1:], ftemp)
+
+                                    except KeyError:
+                                        ignore_class = True
+                                        continue
+
+                                    close(fh)
+                                    remove(code_dir + "/" + file_name)
+                                    move(abs_path, code_dir + "/" + file_name)
+
+                                    raise StopIteration
+                                elif 'enumeration' in line:  # Comment out enumeration
+                                    ftemp.write(TMP_FILE_STR + '\n')
+                                    _write_lines(content[:i], ftemp)
+                                    for j, enum_line in enumerate(content[i:]):
+                                        ftemp.write(" %"+enum_line)
+                                        if " end" in enum_line or "end\n" == enum_line:
+                                            _write_lines(content[i+1+j:], ftemp)
+                                            close(fh)
+                                            remove(code_dir + "/" + file_name)
+                                            move(abs_path, code_dir + "/" + file_name)
+
+                                            raise StopIteration
+                    except StopIteration:  # This exception is like a 'continue' for the outer loop when inside an inner loop
                         continue
         except IOError:
             pass
 
 def postprocess():
+    """Postprocesses data after building documentation
+
+    This function reverses the changes done by preprocess() and calls
+    postprocess_html_files afterwards.
+    """
     code_dir = os.path.abspath('../source')
     files = _matlab_files(os.listdir(code_dir))
-    
+
+    documented_methods = _find_documented_methods()
+
     n_files = len(files)
     for n, file_name in enumerate(files):
-        # print("Postprocessing file {0} [{1}|{2}]".format(file_name, n+1, n_files))
         try:
             fh, abs_path = mkstemp()
             with open(code_dir + "/" + file_name, 'r') as f:
-                with open(abs_path, 'w') as ftemp: 
+                with open(abs_path, 'w') as ftemp:
                     content = f.readlines()
-                    if content[0] != '%TEMP-FILE FOR BUILDING DOCUMENTATION\n':
-                        continue
                     try:
                         for i, line in enumerate(content):  # Worst runtime ever
-                            if 'enumeration' in line:
+                            if 'classdef' in line and '%TEMP-FILE FOR BUILDING DOCUMENTATION' in line:
+                                class_name = line.replace(' ', '').split('%')[0].split('<')[0].split('classdef')[1]
+                                try:
+                                    n_methods = len(documented_methods[class_name])
+
+                                    line = line.replace('  '+TMP_FILE_STR, '')
+
+                                    _write_lines(content[:i], ftemp)
+                                    _write_lines([line], ftemp)
+                                    _write_lines(content[i+n_methods+5:], ftemp)
+
+                                except KeyError:
+                                    continue
+
+                                close(fh)
+                                remove(code_dir + "/" + file_name)
+                                move(abs_path, code_dir + "/" + file_name)
+
+                                raise StopIteration
+                            elif 'enumeration' in line:
                                 _write_lines(content[1:i], ftemp)
                                 for j, enum_line in enumerate(content[i:]):
                                    ftemp.write(enum_line.replace(' %', '', 1))
@@ -71,38 +132,52 @@ def postprocess():
                                         close(fh)
                                         remove(code_dir + "/" + file_name)
                                         move(abs_path, code_dir + "/" + file_name)
-                                        # At this point, entire file has been processed: continue outer loop
-                                        # Hackily implemented by raising an exception
-                                        raise StopIteration 
+
+                                        raise StopIteration  # At this point, entire file has been processed: continue outer loop
                     except StopIteration:
                         continue
         except IOError:
             pass
 
     postprocess_html_files()
-    
+
 def postprocess_html_files():
-    documented_classes = ['Motor', 'Sensor', 'EV3']
-        
-    for file_name in documented_classes:
+    """ Postprocesses the created doc html-files
+
+    Some formatting and internal errors occurs when the HTML-files are created.
+    The following bugs have been found and are being fixed by this function:
+        - Replace ` with ' (This is necessary to make code examples
+        copy-pastable. During the creation of the html-files ' has been replaced
+        by ` for some reason.)
+        - Delete module name from class documentation (Sphinx wrongly interprets
+        the file-name of the toolbox as the module name, which it would be if it
+        were dealing with Python)
+        - Replace wrong hrefs by internal links (Some would-be-internal links
+        wrongly point to some ominous 'source.html'-file)
+    """
+
+    for file_name in DOCUMENTED_CLASSES:
         current_file = os.path.abspath('_build/html/' + file_name + '.html')
-        try: 
+        try:
             fh, abs_path = mkstemp()
             with open(current_file, 'r') as f_old:
                 with open(abs_path, 'w') as f_new:
                     content = f_old.readlines()
                     for i, line in enumerate(content):
                         # Replace ` with '
-                        # This is necessary to make code examples copy-pastable. During the
-                        # creation of the html-files, ' has been replaced by ` for some reason. :(
                         if('&#8216' in line or '&#8217' in line):
                             line = line.replace('&#8216;', '\'').replace('&#8217;', '\'')
-                        
-                        # Delete module name from class documentation 
+
+                        # Delete module name from class documentation
                         ugly_module_string = '<code class="descclassname">source.</code>'
                         if(ugly_module_string in line):
                             line = line.replace(ugly_module_string, '')
 
+                        # Replace wrong hrefs by internal links
+                        wrong_href = 'source.html'
+                        if(wrong_href in line):
+                            line = line.replace(wrong_href, '')
+
                         f_new.write(line)
                     close(fh)
                     remove(current_file)
@@ -110,7 +185,8 @@ def postprocess_html_files():
         except IOError:
             print('WARNING: Couldn''t postprocess html-file ' + current_file)
             continue
-      
+
+## Helper functions
 def _ignore_line(line) -> bool:
     return (line.startswith('%') or line == '\n' or line == '')
 
@@ -119,4 +195,39 @@ def _write_lines(lines, f):
         f.write(line)
 
 def _matlab_files(files) -> list:
-    return [f for f in files if (f.endswith(".m") and "_" not in f and "proto" not in f)]	
+    return [f for f in files if (f.endswith(".m") and "_" not in f and "proto" not in f)]
+
+def _rst_files(files) -> list:
+    return [f for f in files if f.endswith(".rst")]
+
+def _method_lines(methods) -> list:
+    doc_lines = ['    %\n']
+    doc_lines.append('    % *List of methods*:\n')
+    for method in methods:
+        doc_lines.append('    %             * :meth:`' + method + '`\n')
+    doc_lines.append('    %\n')
+    doc_lines.append('    %\n')
+
+    return doc_lines
+
+def _find_documented_methods():
+    files = _rst_files(os.listdir(os.path.abspath('.')))
+
+    doc_methods = {}
+    for file_name in files:
+        with open(file_name) as f:
+            content = f.readlines()
+            class_name = ''
+
+            for i, line in enumerate(content):
+                class_string = '.. autoclass:: '
+                if class_name != '':
+                    if ':members:' in line:  # Found line with method names
+                        method_names = line.split(':members: ')[1].split(', ')
+                        method_names = [m.replace('\n', '') for m in method_names[:]]
+                        doc_methods[class_name] = method_names
+
+                if class_string in line:
+                    class_name = line.split(class_string)[1].replace('\n', '')
+
+    return doc_methods
diff --git a/docs/usbBrickIO.rst b/docs/usbBrickIO.rst
new file mode 100644
index 0000000000000000000000000000000000000000..785bdc9777327560b7982902df1a9df17ffb2cc9
--- /dev/null
+++ b/docs/usbBrickIO.rst
@@ -0,0 +1,10 @@
+.. automodule:: source
+
+.. |br| raw:: html
+   
+   <br />
+usbBrickIO
+==========
+
+.. autoclass:: usbBrickIO
+   :members: open, close, read, write, setProperties
diff --git a/source/BrickIO.m b/source/BrickIO.m
index ebdb054b682f28d8dc5562de9e9dad224011b9ae..9b86316daaa464f2fc88338b02847c726145ecad 100755
--- a/source/BrickIO.m
+++ b/source/BrickIO.m
@@ -1,35 +1,36 @@
-%BrickIO Abstract class definition for brick input output
-%
-% Methods::
-%  open         Open the connection to the brick
-%  close        Close the connection to the brick
-%  read         Read data from the brick
-%  write        Write data to the brick
-%
-% Notes::
-% - handle is the connection object
-% - The read function should return a uint8 datatype
-% - The write function should be given a uint8 datatype as a parameter
-
-classdef BrickIO < handle
+classdef BrickIO < MaskedHandle
+    % Abstract class definition for brick input output
+    %
+    % Notes:
+    %     * The read/write-methods use uint8-arrays.
+    %     * Instances of child-classes of BrickIO represent connection handles. The connection is
+    %       opened when creating them and closed when deleting them.
+    %
+    % Methods:
+    %     open: Open the connection to the brick
+    %     close: Close the connection to the brick
+    %     read: Read data from the brick
+    %     write: Write data to the brick
+    % 
+    
     properties (Abstract)
-        % time-out period (if 0, no time-out)
+        % timeOut: time-out period (if 0, no time-out)
         timeOut 
     end
     
-    properties (Abstract, Access = 'protected')
-        % connection handle
+    properties (Abstract, Access = protected)
+        % handle: Connection handle to the device
         handle
     end
     
     methods (Abstract)
-        % open the brick connection
+        % Open the brick connection
         open(BrickIO)
-        % close the brick connection
+        % Close the brick connection
         close(BrickIO)
-        % read data from the brick
+        % Read data from the brick
         read(BrickIO)
-        % write data to the brick
+        % Write data to the brick
         write(BrickIO)
     end
 end
\ No newline at end of file
diff --git a/source/CommunicationInterface.m b/source/CommunicationInterface.m
index 645200d2cdeb8021f23895aba7c6ec1906858554..dc12ca1a88205267c2db8b1b83019a765bbebaec 100755
--- a/source/CommunicationInterface.m
+++ b/source/CommunicationInterface.m
@@ -115,18 +115,6 @@ classdef CommunicationInterface < handle
     properties (SetAccess = private)
         % IO connection type
         ioType;
-        % Bluetooth brick device name
-        btDevice = '';
-        % Bluetooth brick communication channel
-        btChannel = 0;
-        % Wifi brick IP address
-        wfAddr = '';
-        % Wifi brick TCP port
-        wfPort = ''; 
-        % Brick serial number
-        wfSN = ''; 
-        % Bluetooth serial port
-        serPort;
     end
     
     properties (Hidden, Access = private)
@@ -137,71 +125,33 @@ classdef CommunicationInterface < handle
     methods
         %% Constructor, Destructor, Setter...
         function commInterface = CommunicationInterface(varargin) 
-             % Brick.Brick Create a Brick object
+             % CommunicationInterface.CommunicationInterface Create a CommunicationInterface object
              %
-             % b = Brick(OPTIONS) is an object that represents a connection
+             % b = CommunicationInterface(...) is an object that represents a connection
              % interface to a Lego Mindstorms EV3 brick.
              %
-             % Options::
-             %  'debug',D       Debug level, show communications packet
-             %  'ioType',P      IO connection type, either usb, wifi or bt
-             %  'btDevice',bt   Bluetooth brick device name
-             %  'btChannel',cl  Bluetooth connection channel
-             %  'wfAddr',wa     Wifi brick IP address
-             %  'wfPort',pr     Wifi brick TCP port, default 5555
-             %  'wfSN',sn       Wifi brick serial number (found under Brick info on the brick OR through sniffing the UDP packets the brick emits on port 3015)
-             %  'serPort',SP    Serial port connection
-             %
              % Notes::
-             % - Can connect through: usbBrickIO, wfBrickIO, btBrickIO or
-             % instrBrickIO.
-             % - For usbBrickIO:
-             %      b = Brick('ioType','usb')
-             % - For wfBrickIO:
-             %      b = Brick('ioType','wifi','wfAddr','192.168.1.104','wfPort',5555,'wfSN','0016533dbaf5')
-             % - For btBrickIO:
-             %      b = Brick('ioType','bt','serPort','/dev/rfcomm0')
-             % - For instrBrickIO (wifi)
-             %      b = Brick('ioType','instrwifi','wfAddr','192.168.1.104','wfPort',5555,'wfSN','0016533dbaf5')
-             % - For instrBrickIO (bluetooth)
-             %      b = Brick('ioType','instrbt','btDevice','EV3','btChannel',1)
+             % - Can connect through: usbBrickIO, btBrickIO
+             % - For USB connection:
+             %      b = CommunicationInterface('usb')
+             % - For BT connection on linux/mac:
+             %      b = CommunicationInterface('bt','serPort','/dev/rfcomm0')
+             % - For BT conenction on windows:
+             %      b = CommunicationInterface('bt','backend','instrumentControl,'channel',1,'deviceName','EV3')
+             
+             props = commInterface.evaluateProperties(varargin{:});
+             commInterface.ioType = props.ioType;
+             commInterface.debug = props.debug;
              
-             commInterface.setProperties(varargin{:});
-%              % Init the properties
-%              opt.debug = 0;
-%              opt.btDevice = 'EV3';
-%              opt.btChannel = 1;
-%              opt.wfAddr = '192.168.1.104';
-%              opt.wfPort = 5555;
-%              opt.wfSN = '0016533dbaf5';
-%              opt.ioType = 'usb';
-%              opt.serPort = '/dev/rfcomm0';
-%              
-%              % Read in the options
-%              opt = tb_optparse(opt, varargin);
-%              commInterface.debug = opt.debug;
-%              commInterface.ioType = opt.ioType;
-
              try
                  if(strcmp(commInterface.ioType,'usb')) % USB
-                    commInterface.conn = usbBrickIO(commInterface.debug);
-                 elseif(strcmp(commInterface.ioType,'wifi')) % WiFi
-                    commInterface.wfAddr = opt.wfAddr;
-                    commInterface.wfPort = opt.wfPort;
-                    commInterface.wfSN = opt.wfSN;
-                    commInterface.conn = wfBrickIO(commInterface.debug,commInterface.wfAddr,commInterface.wfPort,commInterface.wfSN);
+                    commInterface.conn = usbBrickIO(props.debug);
                  elseif(strcmp(commInterface.ioType,'bt')) % Bluetooth
-%                     commInterface.serPort = opt.serPort;
-                    commInterface.conn = btBrickIO(commInterface.debug,commInterface.serPort);
-                 elseif(strcmp(commInterface.ioType,'instrwifi')) % Instrumentation and Control: WiFi 
-                    commInterface.wfAddr = opt.wfAddr;
-                    commInterface.wfPort = opt.wfPort;
-                    commInterface.wfSN = opt.wfSN;
-                    commInterface.conn = instrBrickIO(commInterface.debug,'wf',commInterface.wfAddr,commInterface.wfPort,commInterface.wfSN);
-                 elseif(strcmp(commInterface.ioType,'instrbt')) % Instrumentation and Control: Bluetooth 
-                    commInterface.btDevice = opt.btDevice;
-                    commInterface.btChannel = opt.btChannel;
-                    commInterface.conn = instrBrickIO(commInterface.debug,'bt',commInterface.btDevice,commInterface.btChannel);
+                    if(strcmp(props.backend, 'serial'))
+                       commInterface.conn = btBrickIO('debug', props.debug, 'serPort', props.serPort);
+                    else
+                       commInterface.conn = btBrickIO('debug', props.debug, 'backend', props.backend, 'channel', props.channel, 'deviceName', props.deviceName);
+                    end
                  end
              catch ME
                  commInterface.conn = [];
@@ -240,37 +190,43 @@ classdef CommunicationInterface < handle
             
             brick.conn.timeOut = timeOut;
         end
-        
         function timeOut = get.timeOut(brick)
             timeOut = brick.conn.timeOut; 
         end
         
-        function setProperties(brick, varargin)
+        function props = evaluateProperties(brick, varargin)
             p = inputParser();
             p.KeepUnmatched = true;
             
             % Set default values
             defaultIOType = 'usb';
             defaultSerPort = '/dev/rfcomm0';
+            defaultBTDevice = 'EV3';
+            defaultBTChannel = 1;
+            if(ispc && license('test', 'instr_control_toolbox'))
+                defaultBackend = 'instrumentControl';
+            else
+                defaultBackend = 'serial';
+            end
             defaultDebug = false;
             
-            % Define anonymous function that will return whether given value in varargin is valid
-            %validTypes = ;
+            % Define anonymous functions that will return whether given value in varargin is valid
             checkIOType = @(x) ismember(x, {'usb', 'bt'});
             checkDebug = @(x) isBool(x);
+            checkBackend = @(x) ismember(x, {'serial', 'instrumentControl'});
             
             % Add parameters
             p.addRequired('ioType', checkIOType);
             p.addOptional('serPort', defaultSerPort);
             p.addOptional('debug', defaultDebug, checkDebug);
+            p.addOptional('deviceName', defaultBTDevice);
+            p.addOptional('channel', defaultBTChannel);
+            p.addOptional('backend', defaultBackend, checkBackend);
             
             % Parse input...
             p.parse(varargin{:});
             
-            % Set properties
-            brick.ioType = p.Results.ioType;
-            brick.serPort = p.Results.serPort;
-            brick.debug = p.Results.debug;
+            props = p.Results;
         end
         
         %% Commands
diff --git a/source/EV3.m b/source/EV3.m
old mode 100755
new mode 100644
index d02659977ea1ad648adfd1e8014754afd83691e1..b06dc6694b3b4f3a93f64300d795dbed1bb75295
--- a/source/EV3.m
+++ b/source/EV3.m
@@ -4,15 +4,16 @@ classdef EV3 < MaskedHandle
     % This is the 'central' class (from user's view) when working with this toolbox. It
     % delivers a convenient interface for creating a connection to the brick and sending
     % commands to it. An EV3-object creates 4 Motor- and 4 Sensor-objects, one for each port.
-    % 
+    %
+    %
     % Notes:
     %     * Creating multiple EV3 objects and connecting them to different physical bricks has not
     %       been thoroughly tested yet, but seems to work on a first glance.
-    %     * When an input argument of a method is marked as optional, the argument needs to be 
-    %       'announced' by a preceding 2nd argument, which is a string containing the name of the argument. 
+    %     * When an input argument of a method is marked as optional, the argument needs to be
+    %       'announced' by a preceding 2nd argument, which is a string containing the name of the argument.
     %       For example, Motor.setProperties may be given a power-parameter. The syntax would be as
     %       follows: *brickObject.motorA.setProperties('power', 50);*
-    %       
+    %
     %
     %
     % Attributes:
@@ -37,30 +38,30 @@ classdef EV3 < MaskedHandle
     %
     % Example:
     %     % This example expects a motor at port A and a (random) sensor at port 1 |br|
-    %     b = EV3(); % |br| 
-    %     b.connect('usb'); % |br|   
+    %     b = EV3(); % |br|
+    %     b.connect('usb'); % |br|
     %     ma = b.motorA; % |br|
     %     ma.setProperties('power', 50, 'limitValue', 720); % |br|
-    %     ma.start(); % |br|  
+    %     ma.start(); % |br|
     %     % fun |br|
     %     ma.waitFor(); % |br|
     %     disp(b.sensor1.value); % |br|
     %     b.beep(); % |br|
     %     delete b; % |br|
-    
+
     properties
         % batteryMode (string in {'Percentage', 'Voltage'}): Mode for reading battery charge. [WRITABLE]
         % See also BATTERYVALUE
         batteryMode;
-        
+
         % debug (numeric in {0,1,2}): Debug mode. [WRITABLE]
         %     - 0: Debug turned off
-        %     - 1: (High-level-) Debug turned on for EV3-object - enables feedback in the 
+        %     - 1: (High-level-) Debug turned on for EV3-object - enables feedback in the
         %          console about what firmware-commands have been called when using a method
         %     - 2: Low-level-Debug turned on - each packet sent and received is printed to the
         %          console
-        debug; 
-        
+        debug;
+
         % Seconds waited after each send
         pauseAfterSend = 0;
     end
@@ -69,13 +70,13 @@ classdef EV3 < MaskedHandle
         % batteryValue (numeric): Current battery charge. Depending on batteryMode, the reading
         %     is either in percentage or voltage. [READ-ONLY]
         % See also BATTERYMODE
-        batteryValue; 
+        batteryValue;
     end
-    
+
     properties (SetAccess = private)  % Read-only properties that are set internally
         % isConnected (bool): True if virtual brick-object is connected to physical one. [READ-ONLY]
-        isConnected = false; 
-        
+        isConnected = false;
+
         % motorA (Motor): Motor-object interfacing port A.
         % See also MOTOR
         motorA;
@@ -88,7 +89,7 @@ classdef EV3 < MaskedHandle
         % motorD (Motor): Motor-object interfacing port D.
         % See also MOTOR
         motorD;
-        
+
         % sensor1 (Sensor): Sensor-object interfacing port 1.
         % See also SENSOR
         sensor1;
@@ -100,63 +101,63 @@ classdef EV3 < MaskedHandle
         sensor3;
         % sensor4 (Sensor): Sensor-object interfacing port 4.
         % See also SENSOR
-        sensor4;            
+        sensor4;
     end
-    
+
     properties (Access = private)
         % commInterface (CommunicationInterface): Interface to communication layer
         %     All commands sent to the Brick are created and written through this object. Each
         %     Motor- and Sensor-object has a reference to it.
         commInterface = 0;
     end
-    
+
     properties (Hidden, Access = private)  % Hidden properties for internal use only
         % init (bool): Indicates init-phase (i.e. constructor is running).
         init = true;
     end
-    
+
     methods  % Standard methods
         %% Constructor
         function ev3 = EV3(varargin)
             % Sets properties of EV3-object and creates Motor- and Sensor-objects with default
             % parameters.
             %
-            % Arguments
+            % Arguments:
             %     varargin: see setProperties(ev3, varargin).
             %
             % See also SETPROPERTIES / :meth:`setProperties(ev3, varargin)`
-            
+
             ev3.setProperties(varargin{:});
-            
+
             ev3.motorA = Motor('A', 'Debug', ev3.debug>0);
             ev3.motorB = Motor('B', 'Debug', ev3.debug>0);
             ev3.motorC = Motor('C', 'Debug', ev3.debug>0);
             ev3.motorD = Motor('D', 'Debug', ev3.debug>0);
-            
-            
+
+
             ev3.sensor1 = Sensor('1', 'Debug', ev3.debug>0);
             ev3.sensor2 = Sensor('2', 'Debug', ev3.debug>0);
             ev3.sensor3 = Sensor('3', 'Debug', ev3.debug>0);
             ev3.sensor4 = Sensor('4', 'Debug', ev3.debug>0);
-            
+
             ev3.init = false;
         end
-        
+
         function delete(ev3)
             % Disconnects from physical brick and deletes this instance.
-            
+
             if ev3.isConnected
                 ev3.disconnect();
             end
         end
-        
-        %% Connection 
+
+        %% Connection
         function connect(ev3, varargin)
             % Connects EV3-object and its Motors and Sensors to physical brick.
             %
             % Arguments:
             %     connectionType (string in {'bt', 'usb'}): Connection type
-            %     serPort (string in {'/dev/rfcomm1', '/dev/rfcomm2', ...}): Path to serial port 
+            %     serPort (string in {'/dev/rfcomm1', '/dev/rfcomm2', ...}): Path to serial port
             %         (necessary if connectionType is 'bt'). *[OPTIONAL]*
             %     beep (bool): If true, EV3 beeps if connection has been established. *[OPTIONAL]*
             %
@@ -166,10 +167,10 @@ classdef EV3 < MaskedHandle
             %     b.connect('bt', 'serPort', '/dev/rfcomm0'); % |br|
             %     % Setup usb connection, beep when connection has been established
             %     b = EV3(); % |br|
-            %     b.connect('usb', 'beep', 'on', ); % |br| 
-            %     
+            %     b.connect('usb', 'beep', 'on', ); % |br|
+            %
             % See also ISCONNECTED / :attr:`isConnected`
-            
+
             if ev3.isConnected
                 if isCommInterfaceValid(ev3.commInterface)
                     error('EV3::connect: Already connected.');
@@ -177,16 +178,16 @@ classdef EV3 < MaskedHandle
                     warning(['EV3::connect: EV3.isConnected is set to ''True'', but ',...
                              'comm handle is invalid. Deleting invalid handle and ' ,...
                              'resetting EV3.isConnected now...']);
-                         
+
                     ev3.commInterface = 0;
                     ev3.isConnected = false;
                 end
             end
-            
+
             if nargin < 2
                  error('EV3::connect: Wrong number of input arguments.');
             end
-            
+
             idxes = strcmpi('beep', varargin);
             idx = find([0, idxes(1:end-1)]);
             if ~isempty(idx)
@@ -197,24 +198,24 @@ classdef EV3 < MaskedHandle
             else
                 beep = false;
             end
-            
+
             % Try to connect
-            try 
+            try
                 % Connect to physical brick
                 % -> Creating communication-handle implicitly establishes connection
                 ev3.commInterface = CommunicationInterface(varargin{:}, 'debug', ev3.debug>=2);
                 ev3.isConnected = true;
-                
+
                 if beep
                     ev3.beep();
                 end
-                
+
                 % Connect motors
                 ev3.motorA.connect(ev3.commInterface);
                 ev3.motorB.connect(ev3.commInterface);
                 ev3.motorC.connect(ev3.commInterface);
                 ev3.motorD.connect(ev3.commInterface);
-                
+
                 % Connect sensors
                 ev3.sensor1.connect(ev3.commInterface);
                 ev3.sensor2.connect(ev3.commInterface);
@@ -227,11 +228,11 @@ classdef EV3 < MaskedHandle
                     ev3.commInterface.delete();
                     ev3.commInterface = 0;
                 end
-                
+
                 rethrow(ME);
             end
         end
-        
+
         function disconnect(ev3)
             % Disconnects EV3-object and its Motors and Sensors from physical brick.
             %
@@ -243,42 +244,42 @@ classdef EV3 < MaskedHandle
             %     b.connect('bt', 'serPort', '/dev/rfcomm0'); % |br|
             %     % do stuff |br|
             %     b.disconnect(); % |br|
-            
+
             ev3.resetPhysicalBrick();
-            
+
             % Disconnect motors and sensors
             % -> set references to comm handle to 0
             ev3.motorA.disconnect();
             ev3.motorB.disconnect();
             ev3.motorC.disconnect();
             ev3.motorD.disconnect();
-            
+
             ev3.sensor1.disconnect();
             ev3.sensor2.disconnect();
             ev3.sensor3.disconnect();
             ev3.sensor4.disconnect();
-            
+
             % Delete handle to comm-interface
             if isCommInterfaceValid(ev3.commInterface) && ev3.commInterface ~= 0
                 ev3.commInterface.delete();
             end
             ev3.commInterface = 0;
-            
+
             ev3.isConnected = false;
         end
-        
+
         %% Device functions
         function stopAllMotors(ev3)
             % Sends a stop-command to all motor-ports.
-            
+
             if ~ev3.isConnected
                 error(['EV3::stopAllMotors: Brick-Object not connected physical brick. ',...
                        'You have to call ev3.connect(...) first!']);
             end
-            
+
             ev3.commInterface.outputStopAll();
         end
-        
+
         %% Sound functions
         function beep(ev3)
             % Plays a 'beep'-tone on brick.
@@ -291,19 +292,19 @@ classdef EV3 < MaskedHandle
             %     b.connect('bt', 'serPort', '/dev/rfcomm0'); % |br|
             %     b.beep(); % |br|
             %
-            
+
             if ~ev3.isConnected
                 error(['EV3::beep: Brick-Object not connected physical brick. ',...
                        'You have to call ev3.connect(...) first!']);
             end
-            
+
             ev3.commInterface.soundPlayTone(10, 1000, 100);
-            
+
             if ev3.debug
 				fprintf('(DEBUG) EV3::beep: Sent ''soundPlayTone''-command\n');
             end
         end
-        
+
         function playTone(ev3, volume, frequency, duration)
             % Plays tone on brick.
             %
@@ -313,24 +314,24 @@ classdef EV3 < MaskedHandle
             %     duration (numeric > 0): in milliseconds
             %
             % Example:
-            %     b = EV3(); % |br| 
+            %     b = EV3(); % |br|
             %     b.connect('bt', 'serPort', '/dev/rfcomm0'); % |br|
             %     b.playTone(40, 5000, 1000);  % Plays tone with 40% volume and 5000Hz for 1
             %     second. |br|
             %
-            
+
             if ~ev3.isConnected
                 error(['EV3::isConnected: Brick-Object not connected physical brick. ',...
                        'You have to call ev3.connect(...) first!']);
             end
-            
+
             ev3.commInterface.soundPlayTone(volume, frequency, duration);
-            
+
             if ev3.debug
 				fprintf('(DEBUG) EV3::playTone: Sent ''soundPlayTone''-command\n');
             end
         end
-        
+
         function stopTone(ev3)
             % Stops tone currently played.
             %
@@ -340,25 +341,25 @@ classdef EV3 < MaskedHandle
             %     b.playTone(10,100,100000000);  % Accidentally given wrong tone duration :) |br|
             %     b.stopTone();  % Stops tone immediately. |br|
             %
-            
+
             if ~ev3.isConnected
                 error(['EV3::stopTone: Brick-Object not connected physical brick. ',...
                        'You have to call ev3.connect(...) first!']);
             end
-            
+
             ev3.commInterface.soundStopTone();
-            
+
             if ev3.debug
 				fprintf('(DEBUG) EV3::stopTone: Called ''soundStopTone''-command\n');
             end
         end
-        
+
         function status = tonePlayed(ev3)
             % Tests if tone is currently played.
             %
-            % Returns:  
+            % Returns:
             %     status (bool): True if a tone is being played
-            %            
+            %
             % Example
             %     b = EV3(); % |br|
             %     b.connect('bt', 'serPort', '/dev/rfcomm0'); % |br|
@@ -366,68 +367,68 @@ classdef EV3 < MaskedHandle
             %     pause(0.5); % Small pause is necessary as tone does not start instantaneously |br|
             %     b.tonePlayed(); % -> Outputs 1 to console.  |br|
             %
-            
+
             if ~ev3.isConnected
                 error(['EV3::tonePlayed: Brick-Object not connected physical brick. ',...
                        'You have to call ev3.connect(...) first!']);
             end
-            
+
             status = ev3.commInterface.soundTest;
-            
+
             if ev3.debug
 				fprintf('(DEBUG) EV3::tonePlayed: Called ''soundTest''-command\n');
             end
         end
-        
+
         %% Setter
         function set.commInterface(ev3, comm)
             if ~isCommInterfaceValid(comm)
                 error('EV3::set.commInterface: Handle to Brick-object not valid.');
             end
-            
+
             ev3.commInterface = comm;
         end
-        
+
         function set.batteryMode(ev3, batteryMode)
             validModes = {'Voltage', 'Percentage'};
             if ~ischar(batteryMode) || ~ismember(batteryMode, validModes)
                 error('EV3::set.batteryMode: Given parameter is not a valid battery mode.');
             end
-            
+
             ev3.batteryMode = batteryMode;
         end
-        
+
         function set.debug(ev3, debug)
             if ~isBool(debug) && debug ~= 2
                 error('EV3::set.debug: Given parameter is not a bool.');
             end
-            
+
             ev3.debug = str2bool(debug);
-            
+
             if ev3.isConnected
-                ev3.commInterface.debug = (ev3.debug >= 2); 
+                ev3.commInterface.debug = (ev3.debug >= 2);
             end
-            
+
             ev3.motorA.debug = (ev3.debug > 0);
             ev3.motorB.debug = (ev3.debug > 0);
             ev3.motorC.debug = (ev3.debug > 0);
             ev3.motorD.debug = (ev3.debug > 0);
-            
+
             ev3.sensor1.debug = (ev3.debug > 0);
             ev3.sensor2.debug = (ev3.debug > 0);
             ev3.sensor3.debug = (ev3.debug > 0);
             ev3.sensor4.debug = (ev3.debug > 0);
         end
-        
+
         function set.pauseAfterSend(ev3, pauseAfterSend)
             if pauseAfterSend < 0
-                error('Give pauseLength invalid.'); 
+                error('Give pauseLength invalid.');
             end
-            
-            ev3.pauseAfterSend = pauseAfterSend; 
+
+            ev3.pauseAfterSend = pauseAfterSend;
             ev3.commInterface.pauseAfterSend = pauseAfterSend; % This does the real job
         end
-        
+
         function setProperties(ev3, varargin)
             % Set multiple EV3 properties at once using MATLAB's inputParser.
             %
@@ -442,9 +443,9 @@ classdef EV3 < MaskedHandle
             %     % Instead of: b.debug = 'on'; b.batteryMode = 'Voltage'; % |br|
             %
             % See also EV3.DEBUG, EV3.BATTERYMODE / :attr:`debug`, :attr:`batteryMode`
-            
+
             p = inputParser();
-            
+
             % Set default values
             if ev3.init
                 defaultDebug = false;
@@ -453,43 +454,43 @@ classdef EV3 < MaskedHandle
                 defaultDebug = ev3.debug;
                 defaultBatteryMode = ev3.batteryMode;
             end
-            
+
             % Add parameter
             p.addOptional('debug', defaultDebug);
             p.addOptional('batteryMode', defaultBatteryMode);
-            
+
             % Parse...
             p.parse(varargin{:});
-            
+
             % Set properties
             ev3.batteryMode = p.Results.batteryMode;
             ev3.debug = p.Results.debug;
         end
-        
+
         %% Getter
         function bat = get.batteryValue(ev3)
             if ~ev3.isConnected
                 warning(ID('noConnection'), 'EV3::getBattery: EV3-Object not connected to physical EV3.');
-                
+
                 bat = 0;
                 return;
             end
-            
+
             bat = ev3.getBattery();
         end
-        
+
         function display(ev3)
             % Displays EV3-properties and its devices.
-            
-            displayProperties(ev3); 
-            
+
+            displayProperties(ev3);
+
             fprintf('\n\tDevices\n');
             props = properties(ev3);
-            
+
             warning('off', 'all');  % Turn off warnings while reading values
             for i = 1:length(props)
                 p = props{i};
-                
+
                 if strcmp(class(ev3.(p)),'Sensor') || strcmp(class(ev3.(p)), 'Motor')
                     fprintf('\t%15s [Type: %s]\n', p, char(ev3.(p).type));
                 end
@@ -497,26 +498,26 @@ classdef EV3 < MaskedHandle
             warning('on', 'all');
         end
     end
-    
+
     methods (Access = private)  % Private brick functions that are wrapped by dependent params
         function bat = getBattery(ev3)
             % Retrieve batteryValue from brick in current mode. (Wrapped by EV3.batteryValue)
-            
+
             if strcmpi(ev3.batteryMode, 'Percentage')
                 bat = ev3.commInterface.uiReadLbatt();
-                
+
                 if ev3.debug
                     fprintf('(DEBUG) EV3::getBattery: Called ''uiReadLBatt''-command\n');
                 end
             else
                 bat = ev3.commInterface.uiReadVbatt();
-                
+
                 if ev3.debug
                     fprintf('(DEBUG) EV3::getBattery: Called ''uiReadVBatt''-command\n');
                 end
             end
         end
-        
+
         function resetPhysicalBrick(ev3)
             % Resets Motors and Sensors.
             %
@@ -524,10 +525,10 @@ classdef EV3 < MaskedHandle
             %     * Gets called automatically by EV3.delete.
             %
             % See also MOTOR.RESETPHYSICALMOTOR, SENSOR.RESETPHYSICALSENSOR
-            
+
             sensors = {'sensor1', 'sensor2', 'sensor3', 'sensor4'};
             motors = {'motorA', 'motorB', 'motorC', 'motorD'};
-            
+
             for i = 1:4
                 motor = motors{i};
                 sensor = sensors{i};
@@ -536,4 +537,4 @@ classdef EV3 < MaskedHandle
             end
         end
     end
-end 
+end
diff --git a/source/Motor.m b/source/Motor.m
old mode 100755
new mode 100644
index 62fb6bcef6d6bbcfdc1f3a78deecc2ea44301883..b9887d67297fc49dbc69cb8316bda253072267c7
--- a/source/Motor.m
+++ b/source/Motor.m
@@ -1,4 +1,4 @@
-classdef Motor < MaskedHandle & dynamicprops
+classdef Motor < MaskedHandle & dynamicprops      
     % High-level class to work with motors.
     %
     % This class is supposed to ease the use of the brick's motors. It is possible to set all
diff --git a/source/Sensor.m b/source/Sensor.m
old mode 100755
new mode 100644
index 2cd6ec2c8e91cce616356f53673431c0e64439a1..f89b80f8c8460d1e3c1e6031ab8c469fc5bbc1e8
--- a/source/Sensor.m
+++ b/source/Sensor.m
@@ -1,4 +1,4 @@
-classdef Sensor < MaskedHandle
+classdef Sensor < MaskedHandle      
     % High-level class to work with sensors.
     % 
     % The Sensor-class facilitates the communication with sensors. This mainly consists of 
diff --git a/source/btBrickIO.m b/source/btBrickIO.m
old mode 100755
new mode 100644
index e5a5bfb1628e59ea513a5d5c9e10d1db4f84187f..ea8ed4c4ad291c3820e84829b1c462fbda562353
--- a/source/btBrickIO.m
+++ b/source/btBrickIO.m
@@ -1,239 +1,305 @@
-%btBrickIO Bluetooth interface between MATLAB and the brick
-%
-% Methods::
-%
-%  btBrickIO    Constructor, initialises and opens the bluetooth connection
-%  delete       Destructor, closes the bluetooth connection
-%
-%  open         Open a bluetooth connection to the brick
-%  close        Close the bluetooth connection to the brick
-%  read         Read data from the brick through bluetooth
-%  write        Write data to the brick through bluetooth
-%
-% Example::
-%           btbrick = btBrickIO(1,'/dev/rfcomm0')
-%
-% Notes::
-% - Connects to the bluetooth module on the host through a serial
-% connection. Hence be sure that a serial connection to the bluetooth
-% module can be made. Also be sure that the bluetooth module can be paired
-% to the brick before MATLAB is opened.
-% - Works under mac and potentially linux (have yet to find a suitable
-% bluetooth device that can pair with the brick under linux).
-% - Does not work under windows (will need to either virtualise the serial
-% bluetooth port or use the instrumentation and control toolbox BrickIO
-% version).
-
-classdef btBrickIO < BrickIO
-    properties
-        % debug input
-        debug = 0;
-        % bluetooth serial port
-        serialPort = '/dev/rfcomm0'
-        % time-out period in seconds (if 0, no time-out)
-        timeOut = 10;
-    end
-    
-    properties (Access = 'protected')
-        % connection handle
-        handle
-    end 
-    
-    methods
-        function brickIO = btBrickIO(debug,serialPort)
-            %btBrickIO.btBrickIO Create a btBrickIO object
-            %
-            % btbrick = btBrickIO(debug,serialPort) is an object which
-            % initialises and opens a bluetooth connection between MATLAB
-            % and the brick using serial functions.
-            %
-            % Notes::
-            % - debug is a flag specifying output printing (0 or 1).
-            
-            if nargin > 1
-                brickIO.debug = debug;
-                brickIO.serialPort = serialPort;
-            end
-            
-            if brickIO.debug > 0
-                fprintf('btBrickIO init\n');
-            end
-            
-            % Set the connection handle
-            try
-                brickIO.handle = serial(brickIO.serialPort);
-            catch ME
-                if ~isempty(strfind(ME.identifier, 'invalidPORT'))
-                    % Throw a clean InvalidSerialPort to avoid confusion in upper layers
-                    msg = 'Couldn''t connect to BT-device because given serial port is invalid.';
-                    id = [ID(), ':', 'InvalidSerialPort'];
-                    throw(MException(id, msg));
-                else
-                    % Throw combined error because error did not happen due to known reasons...
-                    msg = 'Unknown error occurred while creating serial-port-object for BT connection.';
-                    id = [ID(), ':', 'UnknownError'];
-                    newException = MException(id, msg);
-                    newException = addCause(newException, ME);
-                    throw(newException);
-                end
-            end
-            
-            % Open the connection handle
-            brickIO.open;
-        end
-        
-        function delete(brickIO)
-            %btBrickIO.delete Delete the btBrickIO object
-            %
-            % delete(brickIO) closes the bluetooth connection handle
-            
-            if brickIO.debug > 0
-                fprintf('btBrickIO delete\n');
-            end
-            
-            % Disconnect
-            try
-                brickIO.close;
-            catch
-                % Connection already closed (probably due to an error) - do nothing
-            end
-        end
-        
-        function open(brickIO)
-            %btBrickIO.open Open the btBrickIO object
-            %
-            % btBrickIO.open() opens the bluetooth connection to the brick
-            % using fopen.
-            
-            if brickIO.debug > 0
-                fprintf('btBrickIO open\n');
-            end
-            
-            % Open the bt handle
-            try
-                fopen(brickIO.handle);
-            catch ME 
-                if strcmp(ME.identifier, 'MATLAB:serial:fopen:opfailed')
-                    % Throw only clean CommError to avoid confusion in upper layers
-                    msg = 'Failed to open connection to Brick via Bluetooth.';
-                    id = [ID(), ':', 'CommError'];
-                    throw(MException(id, msg));
-                else
-                    % Throw combined error because error did not happen due to communication
-                    % failure
-                    msg = 'Unknown error occurred while connecting to the Brick via Bluetooth.';
-                    id = [ID(), ':', 'UnknownError'];
-                    newException = MException(id, msg);
-                    newException = addCause(newException, ME);
-                    throw(newException);
-                end
-            end
-        end
-
-        function close(brickIO)
-            %btBrickIO.close Close the btBrickIO object
-            %
-            % btBrickIO.close() closes the bluetooth connection the brick
-            % using fclose.
-            
-            if brickIO.debug > 0
-                fprintf('btBrickIO close\n');
-            end 
-            
-            try
-                % Close the close handle
-                fclose(brickIO.handle);
-            catch ME
-                % Throw combined error because error did not happen due to communication
-                % failure
-                msg = 'Unknown error occurred while disconnecting from the Brick via Bluetooth.';
-                id = [ID(), ':', 'UnknownError'];
-                newException = MException(id, msg);
-                newException = addCause(newException, ME);
-                throw(newException);
-            end
-        end
-        
-        function rmsg = read(brickIO)
-            %btBrickIO.read Read data from the btBrickIO object
-            %
-            % rmsg = btBrickIO.read() reads data from the brick through
-            % bluetooth via fread and returns the data in uint8 format.
-            
-            if brickIO.debug > 0
-                fprintf('btBrickIO read\n');
-            end 
-            
-            try
-                % Get the number of bytes to be read from the bt handle
-                nLength = fread(brickIO.handle,2);
-
-                % Read the remaining bytes
-                rmsg = fread(brickIO.handle,double(typecast(uint8(nLength),'uint16')));
-            catch ME
-                if strcmp(ME.identifier, 'MATLAB:serial:fread:opfailed')
-                    % Throw only clean CommError to avoid confusion in upper layers
-                    msg = 'Failed to read data from Brick via Bluetooth.';
-                    id = [ID(), ':', 'CommError'];
-                    throw(MException(id, msg));
-                else
-                    % Throw combined error because error did not happen due to known reasons...
-                    msg = 'Unknown error occurred while reading data from the Brick via BT.';
-                    id = [ID(), ':', 'UnknownError'];
-                    newException = MException(id, msg);
-                    newException = addCause(newException, ME);
-                    throw(newException);
-                end
-            end
-            
-            % Append the reply size to the return message
-            rmsg = uint8([nLength' rmsg']);
-        end
-        
-        function write(brickIO,wmsg)
-            %btBrickIO.write Write data to the btBrickIO object
-            %
-            % btBrickIO.write(wmsg) writes data to the brick through
-            % bluetooth.
-            %
-            % Notes::
-            % - wmsg is the data to be written to the brick via bluetooth
-            % in uint8 format.
-            
-            if brickIO.debug > 0
-                fprintf('btBrickIO write\n');
-            end 
-            
-            try
-                % Write to the bluetooth handle
-                fwrite(brickIO.handle,wmsg);
-            catch ME
-                if strcmp(ME.identifier, 'MATLAB:serial:fwrite:opfailed')
-                    % Throw only clean CommError to avoid confusion in upper layers
-                    msg = 'Failed to send data to Brick via Bluetooth.';
-                    id = [ID(), ':', 'CommError'];
-                    throw(MException(id, msg));
-                else
-                    % Throw combined error because error did not happen due to known reasons...
-                    msg = 'Unknown error occurred while sending data to the Brick via BT.';
-                    id = [ID(), ':', 'UnknownError'];
-                    newException = MException(id, msg);
-                    newException = addCause(newException, ME);
-                    throw(newException);
-                end
-            end
-        end
-        
-        function set.timeOut(brickIO, timeOut)
-            if ~isnumeric(timeOut) || timeOut < 0
-                error(ID(), 'timeOut-period of Bluetooth-handle can only be set to positive numerical values.'); 
-            end
-            
-            brickIO.timeOut = timeOut;
-            
-            if timeOut == 0
-               brickIO.handle.Timeout = 9999999; % MATLAB.serial seems to have no option to disable timeout
-            end
-        end 
-    end 
-end
+classdef btBrickIO < BrickIO      
+    % Bluetooth interface between MATLAB and the brick
+    %
+    % Notes:
+    %     * Connects to the bluetooth module on the host through a serial
+    %       connection. Hence be sure that a serial connection to the bluetooth
+    %       module can be made. Also be sure that the bluetooth module has been paired
+    %       to the brick before trying to connect.
+    %     * Usage is OS-dependent:
+    %           * Windows: the deviceName- & channel-properties are needed for connection. The implementation is based on the Instrument Control toolbox.
+    %           * Linux (and potentially Mac): serialPort-property is needed for connection. The implementation is based on MATLAB's serial port implementation.
+    %
+    %     * For general information, see also :class:`BrickIO`.
+    %
+    % Attributes:
+    %     debug (bool): If true, each open/close/read/write-call will be shown in the console.
+    %        Defaults to false.
+    %     serialPort (string): Path to the serial-port object. Only needed when using MATLAB's 
+    %        serial class (i.e. on linux/mac). Defaults to '/dev/rfcomm0'.
+    %     deviceName (string):  Name of the BT-device = the brick. Only needed when using the 
+    %        Instrument Control toolbox (i.e. on windows). Defaults to 'EV3'.
+    %     channel (numeric > 0): BT-channel of the connected BT-device. Only needed when using 
+    %        the Instrument Control toolbox (i.e. on windows). Defaults to 1.
+    %     timeOut (numeric >= 0): seconds after which a timeout-error occurs if no packet could be
+    %        read. Defaults to 10.
+    %     backend ('serial'|'instrumentControl'): Backend this implementation is based on. Is
+    %        automatically chosen depending on the OS. Defaults to 'serial' on linux/mac
+    %        systems, and to 'instrumentControl' on windows systems.
+    %
+    % 
+    % Examples:
+    %     % Connecting on windows |br|
+    %     commHandle = btBrickIO('deviceName', 'MyEV3', 'channel', 1); % |br| 
+    %     % Connecting on windows using MATLABs default serial port implementation for testing |br|
+    %     commHandle = btBrickIO('deviceName', 'MyEV3', 'channel', 1, 'backend', 'serial'); % |br|
+    %     % Connecting on mac/linux |br|
+    %     commHandle = btBrickIO('serPort', '/dev/rfcomm0'); % |br| 
+    %
+    
+    properties
+        % debug (bool): If true, each open/close/read/write-call will be noted in the console.
+        %     Defaults to false.
+        debug;
+        % serialPort (string): Path to the serial-port object. Defaults to '/dev/rfcomm0'.
+        %     Only needed when using MATLAB's serial class (i.e. on linux/mac). 
+        serialPort;
+        % deviceName (string):  Name of the BT-device = the brick. Defaults to 'EV3'.
+        %     Only needed when using the Instrument Control toolbox (i.e. on windows). 
+        deviceName;
+        % channel (numeric > 0): BT-channel of the connected BT-device. Defaults to 1.
+        %     Only needed when using the Instrument Control toolbox (i.e. on windows). 
+        channel;
+        % timeOut (numeric > 0): Seconds after which a timeout-error occurs if no packet could be read. 
+        %     Defaults to 10.
+        timeOut;
+        % backend ('serial'|'instrumentControl'): Backend this implementation is based on. 
+        %     Is automatically chosen depending on the OS. Defaults to 'serial' on linux/mac
+        %     systems, and to 'instrumentControl' on windows systems.
+        backend;
+    end
+    
+    properties (Access = protected)
+        % handle: Connection handle to the device
+        handle;
+    end 
+    
+    methods
+        function brickIO = btBrickIO(varargin)
+            % Create a btBrickIO object
+            %
+            % Arguments:
+            %     varargin: Any number of property names as strings, each followed by the
+            %         desired value. 
+            % 
+            % Examples: 
+            %     % Connecting on windows
+            %     commHandle = btBrickIO('deviceName', 'MyEV3', 'channel', 1); 
+            %     % Connecting on windows using MATLABs default serial port implementation for testing
+            %     commHandle = btBrickIO('deviceName', 'MyEV3', 'channel', 1, 'backend', 'serial'); 
+            %     % Connecting on mac/linux 
+            %     commHandle = btBrickIO('serPort', '/dev/rfcomm0');
+            %
+            % See also BTBRICKIO.SETPROPERTIES
+            
+            brickIO.setProperties(varargin{:});
+            
+            if brickIO.debug > 0
+                fprintf('(DEBUG) btBrickIO init\n');
+            end
+            
+            % Set the connection handle
+            try
+                if strcmp(brickIO.backend, 'serial')
+                   brickIO.handle = serial(brickIO.serialPort);
+                else
+                   brickIO.handle = Bluetooth(brickIO.deviceName,brickIO.channel);
+                end
+            catch ME
+                if ~isempty(strfind(ME.identifier, 'invalidPORT'))
+                    % Throw a clean InvalidSerialPort to avoid confusion in upper layers
+                    msg = 'Couldn''t connect to BT-device because given serial port is invalid.';
+                    id = [ID(), ':', 'InvalidSerialPort'];
+                    throw(MException(id, msg));
+                else
+                    % Throw combined error because error did not happen due to known reasons...
+                    msg = 'Unknown error occurred while creating serial-port-object for BT connection.';
+                    id = [ID(), ':', 'UnknownError'];
+                    newException = MException(id, msg);
+                    newException = addCause(newException, ME);
+                    throw(newException);
+                end
+            end
+            
+            % Open the connection
+            brickIO.open;
+        end
+        
+        function delete(brickIO)
+            % Delete the btBrickIO object and closes the connection
+            
+            if brickIO.debug > 0
+                fprintf('(DEBUG) (BT delete\n');
+            end
+            
+            % Disconnect
+            try
+                brickIO.close;
+            catch
+                % Connection already closed (probably due to an error) - do nothing
+            end
+        end
+        
+        function open(brickIO)
+            % Opens the bluetooth connection to the brick using fopen.
+            
+            if brickIO.debug > 0
+                fprintf('(DEBUG) (BT open)\n');
+            end
+            
+            % Open the bt handle
+            try
+                fopen(brickIO.handle);
+            catch ME 
+                if strcmp(ME.identifier, 'MATLAB:serial:fopen:opfailed')
+                    % Throw only clean CommError to avoid confusion in upper layers
+                    msg = 'Failed to open connection to Brick via Bluetooth.';
+                    id = [ID(), ':', 'CommError'];
+                    throw(MException(id, msg));
+                else
+                    % Throw combined error because error did not happen due to communication
+                    % failure
+                    msg = 'Unknown error occurred while connecting to the Brick via Bluetooth.';
+                    id = [ID(), ':', 'UnknownError'];
+                    newException = MException(id, msg);
+                    newException = addCause(newException, ME);
+                    throw(newException);
+                end
+            end
+        end
+
+        function close(brickIO)
+            % Closes the bluetooth connection the brick using fclose.
+            
+            if brickIO.debug > 0
+                fprintf('(DEBUG) (BT close) \n');
+            end 
+            
+            try
+                % Close the close handle
+                fclose(brickIO.handle);
+            catch ME
+                % Throw combined error because error did not happen due to communication
+                % failure
+                msg = 'Unknown error occurred while disconnecting from the Brick via Bluetooth.';
+                id = [ID(), ':', 'UnknownError'];
+                newException = MException(id, msg);
+                newException = addCause(newException, ME);
+                throw(newException);
+            end
+        end
+        
+        function rmsg = read(brickIO)
+            % Reads data from the brick through bluetooth via fread and returns the data in uint8 format.
+            
+            if brickIO.debug > 0
+                fprintf('(DEBUG) (BT read) \n');
+            end 
+            
+            try
+                % Get the number of bytes to be read from the bt handle
+                nLength = fread(brickIO.handle,2);
+
+                % Read the remaining bytes
+                rmsg = fread(brickIO.handle,double(typecast(uint8(nLength),'uint16')));
+            catch ME
+                if strcmp(ME.identifier, 'MATLAB:serial:fread:opfailed')
+                    % Throw only clean CommError to avoid confusion in upper layers
+                    msg = 'Failed to read data from Brick via Bluetooth.';
+                    id = [ID(), ':', 'CommError'];
+                    throw(MException(id, msg));
+                else
+                    % Throw combined error because error did not happen due to known reasons...
+                    msg = 'Unknown error occurred while reading data from the Brick via BT.';
+                    id = [ID(), ':', 'UnknownError'];
+                    newException = MException(id, msg);
+                    newException = addCause(newException, ME);
+                    throw(newException);
+                end
+            end
+            
+            % Append the reply size to the return message
+            rmsg = uint8([nLength' rmsg']);
+        end
+        
+        function write(brickIO,wmsg)
+            % Writes data to the brick through bluetooth via fwrite.
+            %
+            % Arguments:
+            %     wmsg (uint8 array): Data to be written to the brick via bluetooth
+            
+            if brickIO.debug > 0
+                fprintf('(DEBUG) btBrickIO write\n');
+            end 
+            
+            try
+                % Write to the bluetooth handle
+                fwrite(brickIO.handle,wmsg);
+            catch ME
+                if strcmp(ME.identifier, 'MATLAB:serial:fwrite:opfailed')
+                    % Throw only clean CommError to avoid confusion in upper layers
+                    msg = 'Failed to send data to Brick via Bluetooth.';
+                    id = [ID(), ':', 'CommError'];
+                    throw(MException(id, msg));
+                else
+                    % Throw combined error because error did not happen due to known reasons...
+                    msg = 'Unknown error occurred while sending data to the Brick via BT.';
+                    id = [ID(), ':', 'UnknownError'];
+                    newException = MException(id, msg);
+                    newException = addCause(newException, ME);
+                    throw(newException);
+                end
+            end
+        end
+        
+        function set.timeOut(brickIO, timeOut)
+            if ~isnumeric(timeOut) || timeOut < 0
+                error(ID(), 'timeOut-period of Bluetooth-handle can only be set to positive numerical values.'); 
+            end
+            
+            brickIO.timeOut = timeOut;
+            
+            if timeOut == 0
+               brickIO.handle.Timeout = 9999999; % MATLAB.serial seems to have no option to disable timeout
+            end
+        end
+        function set.backend(brickIO, backend)
+            if ~strcmp(backend, 'serial')
+                if ~strcmp(backend, 'instrumentControl')
+                    msg = 'btBrickIO''s backend-parameter has to be either ''serial'' or ''instrumentControl''.';
+                    id = [ID(), ':', 'InvalidParameter'];
+                    throw(MException(id, msg));
+                elseif ~license('test', 'instr_control_toolbox')
+                    msg = 'Cannot use Instrument-Control-Toolbox for Bluetooth: Toolbox not installed.';
+                    id = [ID(), ':', 'AssetNotAvailable'];
+                    throw(MException(id, msg));
+                end
+            end
+            
+            brickIO.backend = backend;
+        end
+        function setProperties(brickIO, varargin)
+            % Sets multiple btBrickIO properties at once using MATLAB's inputParser.
+            %
+            % The syntax is as follows: commHandle.setProperties('propertyName1',
+            % propertyValue1, 'propertyName2', propertyValue2, ...). Valid, optional properties
+            % are: debug, serPort, deviceName, channel, timeout.
+            %
+            % See also BTBRICKIO.DEBUG, BTBRICKIO.SERIALPORT, BTBRICKIO.DEVICENAME,
+            % BTBRICKIO.CHANNEL, BTBRICKIO.TIMEOUT
+            
+            p = inputParser();
+            p.KeepUnmatched = 1;
+            
+            p.addOptional('debug', false);
+            p.addOptional('serPort', '/dev/rfcomm0');
+            p.addOptional('deviceName', 'EV3');
+            p.addOptional('channel', 1);
+            p.addOptional('timeOut', 10);
+            if(ispc && license('test', 'instr_control_toolbox'))  % Choose 'backend'-default depending on OS
+                p.addOptional('backend', 'instrumentControl');
+            else
+                p.addOptional('backend', 'serial');
+            end
+            
+            p.parse(varargin{:});
+            
+            brickIO.debug = p.Results.debug;
+            brickIO.serialPort = p.Results.serPort;
+            brickIO.deviceName = p.Results.deviceName;
+            brickIO.channel = p.Results.channel;
+            brickIO.timeOut = p.Results.timeOut;
+            brickIO.backend = p.Results.backend;
+        end
+    end 
+end
diff --git a/source/hidapi.m b/source/hidapi.m
old mode 100755
new mode 100644
index a8803b46dea4d1baaeaba85db5ec3737da8741ff..a9f17b2af7d36a8e4c0797a9bb69034280dc9e50
--- a/source/hidapi.m
+++ b/source/hidapi.m
@@ -1,594 +1,497 @@
-%hidpi Interface to the hidapi library
-%
-% Methods::
-%  hidapi                   Constructor, loads the hidapi library
-%  delete                   Destructor, closes any open hid connection
-%
-%  open                     Open the hid device with vendor and product ID
-%  close                    Close the hid device connection
-%  read                     Read data from the hid device
-%  write                    Write data to the hid device
-%
-%  getHIDInfoString         Get the relevant hid info from the hid device
-%  getManufacturersString   Get the manufacturers string from the hid device
-%  getProductString         Get the product string from the hid device
-%  getSerialNumberString    Get the serial number from the hid device
-%  setNonBlocking           Set non blocking hid read
-%  init                     Init the hidapi (executed in open by default)
-%  exit                     Exit the hidapi
-%  error                    Return the error string
-%  enumerate                Enumerate the connected hid devices
-%
-%
-% Example::
-%           hid = hidapi(1,1684,0005,1024,1025)
-%
-% Notes::
-% - Developed from the hidapi available from http://www.signal11.us/oss/hidapi/
-% - Windows: need the hidapi.dll file
-% - Mac: need the hidapi.dylib file. Will also need Xcode installed to run load library
-% - Linux: will need to compile on host system and copy the resulting .so file
-
-classdef hidapi < handle
-    properties
-        % connection handle
-        handle
-        % debug input
-        debug = 0;
-        % vendor ID
-        vendorID = 0;
-        % product ID
-        productID = 0;
-        % read buffer size
-        nReadBuffer = 256;
-        % write buffer size
-        nWriteBuffer = 256;
-        % shared library
-        slib = 'hidapi';
-        % shared library header
-        sheader = 'hidapi.h';
-        
-    end
-    
-    methods
-        %% Constructor
-        
-        function hid = hidapi(debug,vendorID,productID,nReadBuffer,nWriteBuffer)
-            %hidapi.hidapi Create a hidapi library interface object
-            %
-            % hid = hidapi(debug,vendorID,productID,nReadBuffer,nWriteButter)
-            % is an object which initialises the hidapi from the corresponding
-            % OS library. Other parameters are also initialised. Some OS
-            % checking is required in this function to load the correct
-            % library.
-            %
-            % Throws::
-            %  LoadingLibraryError              Could not load .dll/.dylib/.so-file of hidapi
-            %  InvalidFileNameOrFileMissing     Either file names given were wrong or the files 
-            %                                   are missing (thunk files, proto files, ...)
-            %
-            % Notes::
-            % - debug is a flag specifying output printing (0 or 1).
-            % - vendorID is the vendor ID of the hid device (decimal not hex).
-            % - productID is the product ID of the hid device (decimal not hex).
-            % - nReadBuffer is the length of the read buffer.
-            % - nWriteBuffer is the length of the write buffer.
-            
-            
-            hid.debug = debug;
-            
-            if hid.debug > 0
-                fprintf('hidapi init\n');
-            end
-            
-            if nargin > 1
-                hid.vendorID = vendorID;
-                hid.productID = productID;
-                hid.nReadBuffer = nReadBuffer;
-                hid.nWriteBuffer = nWriteBuffer;
-            end
-            
-            % Disable warnings
-            warning('off','MATLAB:loadlibrary:TypeNotFoundForStructure');
-            warning('off', 'MATLAB:loadlibrary:ClassIsLoaded');
-            
-            try
-                % Check the operating system type and load slib
-                if (ispc == 1)
-                    % Check the bit version
-                    if (strcmp(mexext,'mexw32'))
-                        hid.slib = 'hidapi32';
-                        % Load the library via the proto file
-                        loadlibrary(hid.slib,@hidapi32_proto,'alias','hidapiusb')
-                    elseif (strcmp(mexext,'mexw64'))
-                        hid.slib = 'hidapi64';
-                        % Load the library via the proto file
-                        loadlibrary(hid.slib,@hidapi64_proto,'alias','hidapiusb')
-                    end
-                elseif (ismac == 1)
-                    hid.slib = 'hidapi64';
-                    % Load the library via the proto file
-                    loadlibrary(hid.slib,@hidapi64mac_proto,'alias','hidapiusb');
-                elseif (isunix == 1)
-                    hid.slib = 'libhidapi-libusb';
-                    % Load the shared library
-                    loadlibrary(hid.slib,@hidapi_libusb_proto,'alias','hidapiusb');
-                end
-            catch ME
-                % Create own exception for clarification
-                id = [hid.slib, ':', 'LoadingLibraryError'];
-                msg = strcat({'Could not load library '}, {hid.slib}, {'.'});
-                exception = MException(id, msg);
-
-                % Try to narrow down loading failure
-                if isempty(findstr(ME.identifier, 'LoadFailed')) ...
-                        && isempty(findstr(ME.identifier, 'ErrorLoadingLibrary')) ...
-                        && isempty(findstr(ME.identifier, 'ErrorInHeader'))
-                    id = [hid.slib, ':', 'InvalidFileNameOrFileMissing'];
-                    msg = 'Invalid file names were given or files are not available.';
-                    cause = MException(id, msg);
-                    exception = addCause(exception, cause);
-                end
-
-                throw(exception);
-            end
-            % Remove the library extension
-            hid.slib = 'hidapiusb';
-
-            if hid.debug > 0
-                libfunctionsview('hidapiusb');
-            end
-        end
-        
-        function delete(hid)
-            %hidapi.delete Delete hid object
-            %
-            % delete(hid) closes an open hid device connection. This function is called 
-            % automatically when deleting.
-            %
-            % Notes::
-            % - You cannot unloadlibrary in this function as the object is
-            % still present in the MATLAB work space.
-            
-            if hid.debug > 0
-                fprintf('hidapi delete\n');
-            end
-        end
-        
-        %% Wrapper 
-        
-        function str = getManufacturersString(hid)
-            %hidapi.getManufacturersString get manufacturers string from hid object
-            %
-            % hid.getManufacturersString() returns the manufacturers string
-            % from the hid device using getHIDInfoString.
-            
-            str = getHIDInfoString(hid,'hid_get_manufacturer_string');
-        end
-        
-        function str = getProductString(hid)
-            %hidapi.getProductString get product string from hid object
-            %
-            % hid.getProductString() returns the product string from the
-            % hid device using getProductString.
-            
-            str = getHIDInfoString(hid,'hid_get_product_string');
-        end
-        
-        function str = getSerialNumberString(hid)
-            %hidapi.getSerialNumberString get product string from hid object
-            %
-            % hid.getSerialNumberString() returns the serial number string
-            % from the hid device using getSerialNumberString.
-            
-            str = getHIDInfoString(hid,'hid_get_serial_number_string');
-        end
-        
-        %% Wrapped HIDAPI-Functions
-        
-        function open(hid)
-            %hidapi.open Open a hid object
-            %
-            % hid.open() opens a connection with a hid device with the
-            % initialised values of vendorID and productID from the hidapi
-            % constructor.
-            %
-            % Throws::
-            %  CommError	Error during communication with device
-            %
-            % Notes::
-            % - The pointer return value from this library call is always
-            % null so it is not possible to know if the open was
-            % successful.
-            % - The final parameter to the open hidapi library call has
-            % different types depending on OS. In windows it is uint16 but
-            % linux/mac it is int32.
-            
-            if hid.debug > 0
-                fprintf('hidapi open\n');
-            end
-            
-            % Create a null pointer for the hid_open function (depends on OS)
-            if (ispc == 1)
-                pNull = libpointer('uint16Ptr');
-            elseif ((ismac == 1) || (isunix == 1))
-                pNull = libpointer('int32Ptr');
-            end
-            
-            % Open the hid interface
-            [newHandle,value] = calllib(hid.slib,'hid_open',uint16(hid.vendorID), ...
-                uint16(hid.productID),pNull);
-            
-            % (MMI) Assert error case (hid_open returns null-pointer in error case)
-            assert(isLibPointerValid(newHandle)==1, ...
-                [hid.slib, ':', 'CommError'], ...
-                'Failed to connect to USB device.');
-            
-            hid.handle = newHandle;
-        end
-        
-        function close(hid)
-            %hidapi.close Close hid object
-            %
-            % hid.close() closes the connection to a hid device. Gets called automatically
-            % when deleting the hid instance.
-            %
-            % Throws::
-            %  InvalidHandle	Handle to USB-device not valid
-            %
-            
-            if hid.debug > 0
-                fprintf('hidapi close\n');
-            end
-            
-            % (MMI) Check if pointer is (unexpectedly) already invalidated
-            assert(isLibPointerValid(hid.handle)==1, ...
-                [hid.slib, ':', 'InvalidHandle'], ...
-                'Failed to close USB-connection because pointer to USB-device is already invalidated.');
-            
-            % Close the connection
-            calllib(hid.slib,'hid_close',hid.handle);
-            
-            % Invalidate the pointer
-            hid.handle = [];
-        end
-        
-        % @ MMI
-        function rmsg = read_timeout(hid, timeOut)
-            %hidapi.read_timeout Read from hid object with a time-out
-            %
-            % rmsg = hid.read_timeout() reads from a hid device and returns the
-            % read bytes. Will print an error if no data was read during the time-out period.
-            %
-            % Arguments::
-            %  timeOut          time-out period in milliseconds
-            %
-            % Throws::
-            %  CommError        Error during communication with device
-            %  InvalidHandle    Handle to USB-device not valid
-            %
-            
-            if hid.debug > 0
-                fprintf('hidapi read_timeout\n');
-            end
-            
-            % Read buffer of nReadBuffer length
-            buffer = zeros(1,hid.nReadBuffer);
-            % Create a uint8 pointer
-            pbuffer = libpointer('uint8Ptr', uint8(buffer));
-            
-            % Check if pointer is (unexpectedly) already invalidated
-            assert(isLibPointerValid(hid.handle)==1, ...
-                [hid.slib, ':', 'InvalidHandle'], ...
-                'Failed to read USB-data because pointer to USB-device is invalidated.');
-            
-            % Read data from HID device
-            [res,h] = calllib(hid.slib,'hid_read_timeout',hid.handle,pbuffer,uint64(length(buffer)),timeOut);
-            
-            % Check the response (No assert as there are multiple cases)
-            if res < 1
-                % Error occurred
-                id = [hid.slib, ':', 'CommError'];
-                % Narrow error down
-                if res == -1
-                    msg = 'Connection error (probably lost connection to device)';
-                elseif res == 0
-                    msg = ['Could not read data from device (device is still connected, ',...
-                           'but does not react)'];
-                else
-                    msg = 'Unexpected connection error';
-                end
-                causeException = MException(id, msg);
-                ME = MException(id, 'Failed to read data via USB.');
-                addCause(ME, causeException);
-                throw(ME);
-            end
-            
-            % Return the string value
-            rmsg = pbuffer.Value;
-        end
-        
-        function rmsg = read(hid)
-            %hidapi.read Read from hid object
-            %
-            % rmsg = hid.read() reads from a hid device and returns the
-            % read bytes. Will print an error if no data was read.
-            %
-            % Throws::
-            %  CommError        Error during communication with device
-            %  InvalidHandle    Handle to USB-device not valid
-            %
-            
-            if hid.debug > 0
-                fprintf('hidapi read\n');
-            end
-            
-            % Read buffer of nReadBuffer length
-            buffer = zeros(1,hid.nReadBuffer);
-            % Create a uint8 pointer
-            pbuffer = libpointer('uint8Ptr', uint8(buffer));
-            
-            % (MMI) Check if pointer is (unexpectedly) already invalidated
-            assert(isLibPointerValid(hid.handle)==1, ...
-                [hid.slib, ':', 'InvalidHandle'], ...
-                'Failed to read USB-data because pointer to USB-device is invalidated.');
-            
-            % Read data from HID device
-            [res,h] = calllib(hid.slib,'hid_read',hid.handle,pbuffer,uint64(length(buffer)));
-            
-            % (MMI) Check the response (No assert as there are multiple cases)
-            if res < 1
-                % Error occurred
-                id = [hid.slib, ':', 'CommError'];
-                % Narrow error down
-                if res == -1
-                    msg = 'Connection error (probably lost connection to device)';
-                elseif res == 0
-                    msg = ['Could not read data from device (device is still connected, ',...
-                           'but does not react)'];
-                else
-                    msg = 'Unexpected connection error';
-                end
-                causeException = MException(id, msg);
-                ME = MException(id, 'Failed to read data via USB.');
-                addCause(ME, causeException);
-                throw(ME);
-            end
-            
-            % Return the string value
-            rmsg = pbuffer.Value;
-        end
-        
-        function write(hid,wmsg,reportID)
-            %hidapi.write Write to hid object
-            %
-            % hid.write() writes to a hid device. Will print an error if
-            % there is a mismatch between the buffer size and the reported
-            % number of bytes written.
-            %
-            % Throws::
-            %  CommError        Error during communication with device
-            %  InvalidHandle	Handle to USB-device not valid
-            %
-            
-            if hid.debug > 0
-                fprintf('hidapi write\n');
-            end
-            
-            % Append a 0 at the front for HID report ID
-            wmsg = [reportID wmsg];
-            
-            % Pad with zeros for nWriteBuffer length
-            % (MMI) Note:: The following line does not seem to be necessary;
-            % wmsg does not need to be the max packet size. Uncommenting this doesn't affect
-            % anything, and I would prefer sending short messages over long ones.
-            % Further testing may be required, so for now I don't change a thing.
-            wmsg(end+(hid.nWriteBuffer-length(wmsg))) = 0;
-            
-            % Create a uint8 pointer
-            pbuffer = libpointer('uint8Ptr', uint8(wmsg));
-            
-            % (MMI) Check if pointer is (unexpectedly) already invalidated
-            assert(isLibPointerValid(hid.handle)==1, ...
-                [hid.slib, ':', 'InvalidHandle'], ...
-                'Failed to write to USB because pointer to USB-device is invalidated.');
-            
-            % Write the message
-            [res,h] = calllib(hid.slib,'hid_write',hid.handle,pbuffer,uint64(length(wmsg)));
-            
-            % (MMI) Check the response
-            assert(res == length(wmsg), ...
-                [hid.slib, ':', 'CommError'], ...
-                'Failed to write data via USB.');
-        end
-        
-        function str = getHIDInfoString(hid,info)
-            %hidapi.getHIDInfoString get hid information from object
-            %
-            % hid.getHIDInfoString(info) gets the corresponding hid info
-            % from the hid device
-            %
-            % Throws::
-            %  CommError        Error during communication with device
-            %  InvalidHandle	Handle to USB-device not valid
-            %
-            % Notes::
-            % - info is the hid information string.
-            
-            if hid.debug > 0
-                fprintf(['hidapi ' info '\n']);
-            end
-            % Read buffer nReadBuffer length
-            buffer = zeros(1,hid.nReadBuffer);
-            % Create a libpointer (depends on OS)
-            if (ispc == 1)
-                pbuffer = libpointer('uint16Ptr', uint16(buffer));
-            elseif ((ismac == 1) || (isunix == 1))
-                pbuffer = libpointer('int32Ptr', uint32(buffer));
-            end
-            
-            % (MMI) Check if pointer is (unexpectedly) already invalidated
-            assert(isLibPointerValid(hid.handle)==1, ...
-                [hid.slib, ':', 'InvalidHandle'], ...
-                'Failed to read USB-data because pointer to USB-device is invalidated.');
-            
-            % Get the HID info string
-            [res,h] = calllib(hid.slib,info,hid.handle,pbuffer,uint32(length(buffer)));
-            
-            % (MMI) Check the response
-            assert(res~=-1, ...
-                [hid.slib, ':', 'CommError'], ...
-                'Failed to read HID info string.');
-            
-            % Return the string value
-            str = sprintf('%s',char(pbuffer.Value));
-        end
-        
-        function setNonBlocking(hid,nonblock)
-            %hidapi.setNonBlocking sets non blocking on the hid object
-            %
-            % hid.setNonBlocking(nonblock) sets the non blocking flag on
-            % the hid device connection.
-            %
-            % Throws::
-            %  CommError        Error during communication with device
-            %  InvalidHandle	Handle to USB-device not valid
-            %
-            % Notes::
-            % nonblock - 0 disables nonblocking, 1 enables nonblocking
-            
-            if hid.debug > 0
-                fprintf('hidapi setNonBlocking\n');
-            end
-            
-            % (MMI) Check if pointer is (unexpectedly) already invalidated
-            assert(isLibPointerValid(hid.handle)==1, ...
-                [hid.slib, ':', 'InvalidHandle'], ...
-                'Failed to set USB-read-mode to non-blocking because pointer to USB-device is invalidated.');
-            
-            % Set non blocking
-            [res,h] = calllib(hid.slib,'hid_set_nonblocking',hid.handle,uint32(nonblock));
-            
-            % (MMI) Check the response
-            assert(res~=-1, ...
-                [hid.slib, ':', 'CommError'], ...
-                'Failed to set USB-read-mode to non-blocking.');
-        end
-        
-        function init(hid)
-            %hidapi.init Init hidapi
-            %
-            % hid.init() inits the hidapi library. This is called
-            % automatically in the library itself with the open function.
-            %
-            % Throws::
-            %  CommError	Error during communication with device
-            %
-            % Notes::
-            % - You should not have to call this function directly.
-            
-            if hid.debug > 0
-                fprintf('hidapi init\n');
-            end
-            
-            warning([hid.slib, ':', 'RedundantCall'], ...
-                'The init-function gets called automatically when connecting!');
-            
-            % Init device
-            res = calllib(hid.slib,'hid_init');
-            
-            % (MMI) Check the response
-            assert(res~=-1, ...
-                [hid.slib, ':', 'CommError'], ...
-                'Failed to init USB-device.');
-        end
-        
-        function exit(hid)
-            %hidapi.exit Exit hidapi
-            %
-            % hid.exit() exits the hidapi library.
-            %
-            % Throws::
-            %  CommError	Error during communication with device
-            %
-            % Notes::
-            % - You should not have to call this function directly.
-            
-            if hid.debug > 0
-                fprintf('hidapi exit\n');
-            end
-            
-            warning([hid.slib, ':', 'RedundantCall'], ...
-                'The exit-function gets called automatically when disconnecting!');
-            
-            % Exit device
-            res = calllib(hid.slib,'hid_exit');
-            
-            % (MMI) Check the response
-            assert(res~=-1, ...
-                [hid.slib, ':', 'CommError'], ...
-                'Failed to exit USB-device.');
-        end
-        
-        function str = error(hid)
-            %hidapi.error Output the hid object error string
-            %
-            % hid.error() returns the hid device error string if a function
-            % produced an error.
-            %
-            % Throws::
-            %  InvalidHandle	Handle to USB-device not valid
-            %
-            % Notes::
-            % - This function must be called explicitly if you think an
-            % error was generated from the hid device.
-            
-            if hid.debug > 0
-                fprintf('hidapi error\n');
-            end
-            
-            % (MMI) Check if pointer is (unexpectedly) already invalidated
-            assert(isLibPointerValid(hid.handle)==1, ...
-                [hid.slib, ':', 'InvalidHandle'], ...
-                'Failed to read USB-error-data because pointer to USB-device is invalidated.');
-            
-            [~,str] = calllib(hid.slib,'hid_error',hid.handle);
-        end
-        
-        function str = enumerate(hid,vendorID,productID)
-            %hidapi.enumerate Enumerates the hid object
-            %
-            % str = hid.enumerate(vendorID,productID) enumerates the hid
-            % device with the given vendorID and productID and returns a
-            % string with the returned hid information.
-            %
-            % Notes::
-            % - vendorID is the vendor ID (in decimal not hex).
-            % - productID is the vendor ID (in decimal not hex).
-            % - Using a vendorID and productID of (0,0) will enumerate all
-            % connected hid devices.
-            % - MATLAB does not have the hid_device_infoPtr struct so some
-            % of the returned information will need to be resized and cast
-            % into uint8 or chars.
-            
-            if hid.debug > 0
-                fprintf('hidapi enumerate\n');
-            end
-            
-            % Enumerate the hid devices
-            str = calllib(u.slib,'hid_enumerate',uint16(vendorID),uint16(productID));
-        end
-    end
-end
-
-
-function valid = isLibPointerValid(handle)
-    %isHandleValid Check whether hid.handle is valid libpointer
-
-    valid = 0;
-    if ~isempty(handle)
-        if isa(handle, 'handle') && ~isNull(handle)
-            valid = 1;
-        end
-    end
-end
+classdef hidapi < handle      
+    % Interface to the hidapi library
+    % 
+    % Notes:
+    %     * Developed from the hidapi available at http://www.signal11.us/oss/hidapi/.
+    %     * Windows: hidapi.dll needed.
+    %     * Mac: hidapi.dylib needed. In addition, Xcode has to be installed.
+    %     * Linux: hidapi has to be compiled on host-system. 
+    % 
+    % Attributes:
+    %     handle ():
+    %     vendorID (numeric): Vendor-ID of the USB device.
+    %     productID (numeric): Product-ID of the USB device. 
+    %     nReadBuffer (numeric): Read-buffer size in bytes.
+    %     nWriteBuffer (numeric): Write-buffer size in bytes. Needs to be 1 Byte bigger than
+    %        actual packet.
+    %     slib (string): Name of shared library file (without file extension). Defaults to
+    %        'hidapi'.
+    %     sheader (string): Name of shared library header. Defaults to 'hidapi.h'.
+    %
+    % Example:
+    %     hidHandle = hidapi(1684,0005,1024,1025); %|br|
+    %
+    
+    properties
+        % handle: Connection handle to the device.
+        handle
+        % vendorID (numeric): Vendor-ID of the USB device.
+        vendorID;
+        % productID (numeric): Product-ID of the USB device.
+        productID;
+        % nReadBuffer (numeric): Read-buffer size in bytes. 
+        nReadBuffer;
+        % nWriteBuffer (numeric): Write-buffer size in bytes.
+        %    Needs to be 1 Byte bigger than actual packet.
+        nWriteBuffer;
+        % slib (string): Name of shared library file (without file extension). Defaults to 'hidapi'.
+        slib = 'hidapi';
+        % sheader (string): Name of shared library header. Defaults to 'hidapi.h'.
+        sheader = 'hidapi.h';
+    end
+    
+    methods
+        %% Constructor
+        
+        function hid = hidapi(vendorID,productID,nReadBuffer,nWriteBuffer)
+            % Create a hidapi library interface object from the corresponding library 
+            %
+            % Arguments:
+            %     vendorID (numeric): Vendor-ID of the USB device in decimal.
+            %     productID (numeric): Product-ID of the USB device in decimal. 
+            %     nReadBuffer (numeric): Read-buffer size in bytes.
+            %     nWriteBuffer (numeric): Write-buffer size in bytes. Needs to be 1 Byte bigger than
+            %        actual packet.
+            %
+            % Raises:
+            %     LoadingLibraryError: Could not load .dll/.dylib/.so-file of hidapi.
+            %     InvalidFileNameOrFileMissing: Either file names given were wrong or the files 
+            %        are missing (thunk files, proto files, ...).
+            %
+            
+            hid.vendorID = vendorID;
+            hid.productID = productID;
+            hid.nReadBuffer = nReadBuffer;
+            hid.nWriteBuffer = nWriteBuffer;
+            
+            % Disable warnings
+            warning('off','MATLAB:loadlibrary:TypeNotFoundForStructure');
+            warning('off', 'MATLAB:loadlibrary:ClassIsLoaded');
+            
+            try
+                % Check the operating system type and load slib
+                if (ispc == 1)
+                    % Check the bit version
+                    if (strcmp(mexext,'mexw32'))
+                        hid.slib = 'hidapi32';
+                        % Load the library via the proto file
+                        loadlibrary(hid.slib,@hidapi32_proto,'alias','hidapiusb')
+                    elseif (strcmp(mexext,'mexw64'))
+                        hid.slib = 'hidapi64';
+                        % Load the library via the proto file
+                        loadlibrary(hid.slib,@hidapi64_proto,'alias','hidapiusb')
+                    end
+                elseif (ismac == 1)
+                    hid.slib = 'hidapi64';
+                    % Load the library via the proto file
+                    loadlibrary(hid.slib,@hidapi64mac_proto,'alias','hidapiusb');
+                elseif (isunix == 1)
+                    hid.slib = 'libhidapi-libusb';
+                    % Load the shared library
+                    loadlibrary(hid.slib,@hidapi_libusb_proto,'alias','hidapiusb');
+                end
+            catch ME
+                % Create own exception for clarification
+                id = [hid.slib, ':', 'LoadingLibraryError'];
+                msg = strcat({'Could not load library '}, {hid.slib}, {'.'});
+                exception = MException(id, msg);
+
+                % Try to narrow down loading failure
+                if isempty(findstr(ME.identifier, 'LoadFailed')) ...
+                        && isempty(findstr(ME.identifier, 'ErrorLoadingLibrary')) ...
+                        && isempty(findstr(ME.identifier, 'ErrorInHeader'))
+                    id = [hid.slib, ':', 'InvalidFileNameOrFileMissing'];
+                    msg = 'Invalid file names were given or files are not available.';
+                    cause = MException(id, msg);
+                    exception = addCause(exception, cause);
+                end
+
+                throw(exception);
+            end
+            
+            % Remove the library extension
+            hid.slib = 'hidapiusb';
+
+%             if hid.debug > 0
+%                 libfunctionsview('hidapiusb');
+%             end
+        end
+        
+        function delete(hid)
+            % Close an open hid device connection and delete the object. 
+            %
+            % Notes:
+            %     * You cannot unloadlibrary in this function as the object is still present 
+            %       in the MATLAB work space. Todo: Any alternative?
+        end
+        
+        %% HIDAPI-Functions
+        
+        function open(hid)
+            % Open a connection with a hid device
+            %
+            % Throws:
+            %     CommError: Error during communication with device
+            %
+            % Notes: 
+            %     * Gets called automatically when creating an hidapi-object.
+            %     * The pointer return value from this library call is always null so it is not 
+            %       possible to know if the open was successful.
+            %     * The final parameter to the open hidapi library call has different types 
+            %       depending on OS. On windows it is uint16, on linux/mac int32.
+            
+            % Create a null pointer for the hid_open function (depends on OS)
+            if (ispc == 1)
+                pNull = libpointer('uint16Ptr');
+            elseif ((ismac == 1) || (isunix == 1))
+                pNull = libpointer('int32Ptr');
+            end
+            
+            % Open the hid interface
+            [newHandle,value] = calllib(hid.slib,'hid_open',uint16(hid.vendorID), ...
+                uint16(hid.productID),pNull);
+            
+            % (MMI) Assert error case (hid_open returns null-pointer in error case)
+            assert(isLibPointerValid(newHandle)==1, ...
+                [hid.slib, ':', 'CommError'], ...
+                'Failed to connect to USB device.');
+            
+            hid.handle = newHandle;
+        end
+        
+        function close(hid)
+            % Close the connection to a hid device. 
+            %
+            % Throws:
+            %     InvalidHandle: Handle to USB-device not valid
+            %
+            % Notes:
+            %     * Gets called automatically when deleting the hidapi instance.
+            
+            % (MMI) Check if pointer is (unexpectedly) already invalidated
+            assert(isLibPointerValid(hid.handle)==1, ...
+                [hid.slib, ':', 'InvalidHandle'], ...
+                'Failed to close USB-connection because pointer to USB-device is already invalidated.');
+            
+            % Close the connection
+            calllib(hid.slib,'hid_close',hid.handle);
+            
+            % Invalidate the pointer
+            hid.handle = [];
+        end
+        
+        % Implemented @ MMI
+        function rmsg = read_timeout(hid, timeOut)
+            % Read from a hid device with a timeout and return the read bytes. 
+            %
+            % Arguments:
+            %     timeOut (numeric >= 0): Milliseconds after which a timeout-error occurs if no 
+            %         packet could be read.
+            %
+            % Throws:
+            %     CommError: Error during communication with device
+            %     InvalidHandle: Handle to USB-device not valid
+            %
+            
+            % Read buffer of nReadBuffer length
+            buffer = zeros(1,hid.nReadBuffer);
+            % Create a uint8 pointer
+            pbuffer = libpointer('uint8Ptr', uint8(buffer));
+            
+            % Check if pointer is (unexpectedly) already invalidated
+            assert(isLibPointerValid(hid.handle)==1, ...
+                [hid.slib, ':', 'InvalidHandle'], ...
+                'Failed to read USB-data because pointer to USB-device is invalidated.');
+            
+            % Read data from HID device
+            [res,h] = calllib(hid.slib,'hid_read_timeout',hid.handle,pbuffer,uint64(length(buffer)),timeOut);
+            
+            % Check the response (No assert as there are multiple cases)
+            if res < 1
+                % Error occurred
+                id = [hid.slib, ':', 'CommError'];
+                % Narrow error down
+                if res == -1
+                    msg = 'Connection error (probably lost connection to device)';
+                elseif res == 0
+                    msg = ['Could not read data from device (device is still connected, ',...
+                           'but does not react)'];
+                else
+                    msg = 'Unexpected connection error';
+                end
+                causeException = MException(id, msg);
+                ME = MException(id, 'Failed to read data via USB.');
+                addCause(ME, causeException);
+                throw(ME);
+            end
+            
+            % Return the string value
+            rmsg = pbuffer.Value;
+        end
+        
+        function rmsg = read(hid)
+            % Read from a hid device and returns the read bytes.
+            %
+            % Throws:
+            %     CommError: Error during communication with device
+            %     InvalidHandle: Handle to USB-device not valid
+            % 
+            % Notes: 
+            %     * Will print an error if no data was read.
+            %
+            
+            % Read buffer of nReadBuffer length
+            buffer = zeros(1,hid.nReadBuffer);
+            % Create a uint8 pointer
+            pbuffer = libpointer('uint8Ptr', uint8(buffer));
+            
+            % (MMI) Check if pointer is (unexpectedly) already invalidated
+            assert(isLibPointerValid(hid.handle)==1, ...
+                [hid.slib, ':', 'InvalidHandle'], ...
+                'Failed to read USB-data because pointer to USB-device is invalidated.');
+            
+            % Read data from HID device
+            [res,h] = calllib(hid.slib,'hid_read',hid.handle,pbuffer,uint64(length(buffer)));
+            
+            % (MMI) Check the response (No assert as there are multiple cases)
+            if res < 1
+                % Error occurred
+                id = [hid.slib, ':', 'CommError'];
+                % Narrow error down
+                if res == -1
+                    msg = 'Connection error (probably lost connection to device)';
+                elseif res == 0
+                    msg = ['Could not read data from device (device is still connected, ',...
+                           'but does not react)'];
+                else
+                    msg = 'Unexpected connection error';
+                end
+                causeException = MException(id, msg);
+                ME = MException(id, 'Failed to read data via USB.');
+                addCause(ME, causeException);
+                throw(ME);
+            end
+            
+            % Return the string value
+            rmsg = pbuffer.Value;
+        end
+        
+        function write(hid,wmsg,reportID)
+            % Write to a hid device.
+            %
+            % Throws:
+            %     CommError: Error during communication with device
+            %     InvalidHandle: Handle to USB-device not valid
+            %
+            % Notes: 
+            %     * Will print an error if there is a mismatch between the buffer size and the 
+            %       reported number of bytes written.
+            %
+            
+            % Append a 0 at the front for HID report ID
+            wmsg = [reportID wmsg];
+            
+            % Pad with zeros for nWriteBuffer length
+            % (MMI) Note:: The following line does not seem to be necessary;
+            % wmsg does not need to be the max packet size. Uncommenting this doesn't affect
+            % anything, and I would prefer sending short messages over long ones.
+            % Further testing may be required, so for now I don't change a thing.
+            % (MMI) Update:: Okay, so under Windows, this line IS necessary, as well as the
+            % fixed write-buffer size of 1025 bytes for EV3 (== wMaxPacketSize+1; smaller packets fail; 
+            % bigger packets do get handled by the brick, but the second assertion below will fail).
+            wmsg(end+(hid.nWriteBuffer-length(wmsg))) = 0;
+            
+            % Create a uint8 pointer
+            pbuffer = libpointer('uint8Ptr', uint8(wmsg));
+            
+            % (MMI) Check if pointer is (unexpectedly) already invalidated
+            assert(isLibPointerValid(hid.handle)==1, ...
+                [hid.slib, ':', 'InvalidHandle'], ...
+                'Failed to write to USB because pointer to USB-device is invalidated.');
+            
+            % Write the message
+            [res,h] = calllib(hid.slib,'hid_write',hid.handle,pbuffer,uint64(length(wmsg)));
+            
+            % (MMI) Check the response
+            assert(res == length(wmsg), ...
+                [hid.slib, ':', 'CommError'], ...
+                'Failed to write data via USB.');
+        end
+        
+        function str = getHIDInfoString(hid,info)
+            % Get the corresponding hid info from the hid device.
+            %
+            % Throws:
+            %     CommError: Error during communication with device
+            %     InvalidHandle: Handle to USB-device not valid
+            %
+            % Notes:
+            %     * Info is the hid information string. 
+            %
+            % See also HIDAPI.GETMANUFACTURERSSTRING, HIDAPI.GETPRODUCTSTRING,
+            % HIDAPI.GETSERIALNUMBERSTRING.
+            %
+            
+            % Read buffer nReadBuffer length
+            buffer = zeros(1,hid.nReadBuffer);
+            % Create a libpointer (depends on OS)
+            if (ispc == 1)
+                pbuffer = libpointer('uint16Ptr', uint16(buffer));
+            elseif ((ismac == 1) || (isunix == 1))
+                pbuffer = libpointer('int32Ptr', uint32(buffer));
+            end
+            
+            % (MMI) Check if pointer is (unexpectedly) already invalidated
+            assert(isLibPointerValid(hid.handle)==1, ...
+                [hid.slib, ':', 'InvalidHandle'], ...
+                'Failed to read USB-data because pointer to USB-device is invalidated.');
+            
+            % Get the HID info string
+            [res,h] = calllib(hid.slib,info,hid.handle,pbuffer,uint32(length(buffer)));
+            
+            % (MMI) Check the response
+            assert(res~=-1, ...
+                [hid.slib, ':', 'CommError'], ...
+                'Failed to read HID info string.');
+            
+            % Return the string value
+            str = sprintf('%s',char(pbuffer.Value));
+        end
+        
+        function setNonBlocking(hid,nonblock)
+            % Set the non blocking flag on the hid device connection.
+            %
+            % Arguments:
+            %     nonblock (numeric in {0,1}): 0 disables nonblocking, 1 enables nonblocking
+            %
+            % Throws:
+            %     CommError: Error during communication with device
+            %     InvalidHandle: Handle to USB-device not valid
+            %
+            
+            % (MMI) Check if pointer is (unexpectedly) already invalidated
+            assert(isLibPointerValid(hid.handle)==1, ...
+                [hid.slib, ':', 'InvalidHandle'], ...
+                'Failed to set USB-read-mode to non-blocking because pointer to USB-device is invalidated.');
+            
+            % Set non blocking
+            [res,h] = calllib(hid.slib,'hid_set_nonblocking',hid.handle,uint32(nonblock));
+            
+            % (MMI) Check the response
+            assert(res~=-1, ...
+                [hid.slib, ':', 'CommError'], ...
+                'Failed to set USB-read-mode to non-blocking.');
+        end
+        
+        function init(hid)
+            % Inits the hidapi library. 
+            %
+            % Throws:
+            %     CommError: Error during communication with device
+            %
+            % Notes:
+            %     * This is called automatically in the library itself with the open function. You 
+            %       should not have to call this function directly.
+            %
+            
+            warning([hid.slib, ':', 'RedundantCall'], ...
+                'The init-function gets called automatically when connecting!');
+            
+            % Init device
+            res = calllib(hid.slib,'hid_init');
+            
+            % (MMI) Check the response
+            assert(res~=-1, ...
+                [hid.slib, ':', 'CommError'], ...
+                'Failed to init USB-device.');
+        end
+        
+        function exit(hid)
+            %hidapi.exit Exit hidapi
+            %
+            % hid.exit() exits the hidapi library.
+            %
+            % Throws:
+            %     CommError: Error during communication with device
+            %
+            % Notes::
+            % - You should not have to call this function directly.
+            
+            warning([hid.slib, ':', 'RedundantCall'], ...
+                'The exit-function gets called automatically when disconnecting!');
+            
+            % Exit device
+            res = calllib(hid.slib,'hid_exit');
+            
+            % (MMI) Check the response
+            assert(res~=-1, ...
+                [hid.slib, ':', 'CommError'], ...
+                'Failed to exit USB-device.');
+        end
+        
+        function str = error(hid)
+            % Return the hid device error string if a function produced an error.
+            %
+            % Throws:
+            %     InvalidHandle: Handle to USB-device not valid
+            %
+            % Notes:
+            %     * This function must be called explicitly if you think an error was generated 
+            %       from the hid device.
+            % 
+            
+            % (MMI) Check if pointer is (unexpectedly) already invalidated
+            assert(isLibPointerValid(hid.handle)==1, ...
+                [hid.slib, ':', 'InvalidHandle'], ...
+                'Failed to read USB-error-data because pointer to USB-device is invalidated.');
+            
+            [~,str] = calllib(hid.slib,'hid_error',hid.handle);
+        end
+        
+        function str = enumerate(hid,vendorID,productID)
+            % Enumerates the info about the hid device with the given vendorID and productID 
+            % and returns a string with the returned hid information.
+            %
+            % Arguments:
+            %     vendorID (numeric): Vendor-ID of the USB device in decimal.
+            %     productID (numeric): Product-ID of the USB device in decimal. 
+            %
+            % Notes:
+            %     * Using a vendorID and productID of (0,0) will enumerate all connected hid 
+            %       devices.
+            %     * MATLAB does not have the hid_device_infoPtr struct so some of the returned 
+            %       information will need to be resized and cast into uint8 or chars.
+            %
+            
+            % Enumerate the hid devices
+            str = calllib(u.slib,'hid_enumerate',uint16(vendorID),uint16(productID));
+        end
+        
+        %% Wrapper 
+        
+        function str = getManufacturersString(hid)
+            % Get manufacturers string from hid object using getHIDInfoString.
+            str = getHIDInfoString(hid,'hid_get_manufacturer_string');
+        end
+        function str = getProductString(hid)
+            % Get product string from hid object using getProductString.
+            str = getHIDInfoString(hid,'hid_get_product_string');
+        end
+        function str = getSerialNumberString(hid)
+            % Get serial number from hid object using getSerialNumberString.
+            str = getHIDInfoString(hid,'hid_get_serial_number_string');
+        end
+    end
+end
+
+% Implemented @ MMI
+function valid = isLibPointerValid(handle)
+    % Check whether hid.handle is valid libpointer
+
+    valid = 0;
+    if ~isempty(handle)
+        if isa(handle, 'handle') && ~isNull(handle)
+            valid = 1;
+        end
+    end
+end
diff --git a/source/tb_optparse.m b/source/tb_optparse.m
deleted file mode 100755
index 2fedb2b14a51fe749d72f97268a0de2b03513f02..0000000000000000000000000000000000000000
--- a/source/tb_optparse.m
+++ /dev/null
@@ -1,193 +0,0 @@
-%OPTPARSE Standard option parser for Toolbox functions
-%
-% [OPTOUT,ARGS] = TB_OPTPARSE(OPT, ARGLIST) is a generalized option parser for
-% Toolbox functions.  It supports options that have an assigned value, boolean 
-% or enumeration types (string or int).
-%
-% The software pattern is:
-%
-%       function(a, b, c, varargin)
-%       opt.foo = true;
-%       opt.bar = false;
-%       opt.blah = [];
-%       opt.choose = {'this', 'that', 'other'};
-%       opt.select = {'#no', '#yes'};
-%       opt = tb_optparse(opt, varargin);
-%
-% Optional arguments to the function behave as follows:
-%   'foo'           sets opt.foo <- true
-%   'nobar'         sets opt.foo <- false
-%   'blah', 3       sets opt.blah <- 3
-%   'blah', {x,y}   sets opt.blah <- {x,y}
-%   'that'          sets opt.choose <- 'that'
-%   'yes'           sets opt.select <- 2 (the second element)
-%
-% and can be given in any combination.
-%
-% If neither of 'this', 'that' or 'other' are specified then opt.choose <- 'this'.
-% If neither of 'no' or 'yes' are specified then opt.select <- 1.
-%
-% Note:
-% - that the enumerator names must be distinct from the field names.
-% - that only one value can be assigned to a field, if multiple values
-%    are required they must be converted to a cell array.
-%
-% The allowable options are specified by the names of the fields in the
-% structure opt.  By default if an option is given that is not a field of 
-% opt an error is declared.  
-%
-% Sometimes it is useful to collect the unassigned options and this can be 
-% achieved using a second output argument
-%           [opt,arglist] = tb_optparse(opt, varargin);
-% which is a cell array of all unassigned arguments in the order given in
-% varargin.
-%
-% The return structure is automatically populated with fields: verbose and
-% debug.  The following options are automatically parsed:
-%   'verbose'           sets opt.verbose <- true
-%   'verbose=2'         sets opt.verbose <- 2 (very verbose)
-%   'verbose=3'         sets opt.verbose <- 3 (extremeley verbose)
-%   'verbose=4'         sets opt.verbose <- 4 (ridiculously verbose)
-%   'debug', N          sets opt.debug <- N
-%   'setopt', S         sets opt <- S
-%   'showopt'           displays opt and arglist
-
-function [opt,others] = tb_optparse(in, argv)
-
-    arglist = {};
-
-    argc = 1;
-    opt = in;
-    try
-        opt.verbose = false;
-        opt.debug = 0;
-    end
-
-    showopt = false;
-
-    while argc <= length(argv)
-        option = argv{argc};
-        assigned = false;
-        
-        if isstr(option)
-
-            switch option
-            % look for hardwired options
-            case 'verbose'
-                opt.verbose = true;
-                assigned = true;
-            case 'verbose=2'
-                opt.verbose = 2;
-                assigned = true;
-            case 'verbose=3'
-                opt.verbose = 3;
-                assigned = true;
-            case 'verbose=4'
-                opt.verbose = 4;
-                assigned = true;
-            case 'debug'
-                opt.debug = argv{argc+1};
-                argc = argc+1;
-                assigned = true;
-            case 'setopt'
-                new = argv{argc+1};
-                argc = argc+1;
-                assigned = true;
-
-
-                % copy matching field names from new opt struct to current one
-                for f=fieldnames(new)'
-                    if isfield(opt, f{1})
-                        opt = setfield(opt, f{1}, getfield(new, f{1}));
-                    end
-                end
-            case 'showopt'
-                showopt = true;
-                assigned = true;
-
-            otherwise
-                % does the option match a field in the opt structure?
-                if isfield(opt, option)
-                    val = getfield(opt, option);
-                    if islogical(val)
-                        % a logical variable can only be set by an option
-                        opt = setfield(opt, option, true);
-                    else
-                        % otherwise grab its value from the next arg
-                        opt = setfield(opt, option, argv{argc+1});
-                        argc = argc+1;
-                    end
-                    assigned = true;
-                elseif length(option)>2 && strcmp(option(1:2), 'no') && isfield(opt, option(3:end))
-                    val = getfield(opt, option(3:end));
-                    if islogical(val)
-                        % a logical variable can only be set by an option
-                        opt = setfield(opt, option(3:end), false);
-                        assigned = true;
-                    end
-                else
-                    % the option doesnt match a field name
-                    for field=fieldnames(opt)'
-                        val = getfield(opt, field{1});
-                        if iscell(val)
-                            for i=1:length(val)
-                                if isempty(val{i})
-                                    continue;
-                                end
-                                if strcmp(option, val{i})
-                                    opt = setfield(opt, field{1}, option);
-                                    assigned = true;
-                                    break;
-                                elseif val{i}(1) == '#' && strcmp(option, val{i}(2:end))
-                                    opt = setfield(opt, field{1}, i);
-                                    assigned = true;
-                                    break;
-                                end
-                            end
-                            if assigned
-                                break;
-                            end
-                        end
-                    end
-
-
-                end
-            end % switch
-        end
-        if ~assigned
-            % non matching options are collected
-            if nargout == 2
-                arglist = [arglist argv(argc)];
-            else
-                if isstr(argv{argc})
-                    error(['unknown options: ' argv{argc}]);
-                end
-            end
-        end
-        
-        argc = argc + 1;
-    end % while
-
-    % if enumerator value not assigned, set the default value
-    for field=fieldnames(in)'
-        if iscell(getfield(in, field{1})) && iscell(getfield(opt, field{1}))
-            val = getfield(opt, field{1});
-            if isempty(val{1})
-                opt = setfield(opt, field{1}, val{1});
-            elseif val{1}(1) == '#'
-                opt = setfield(opt, field{1}, 1);
-            else
-                opt = setfield(opt, field{1}, val{1});
-            end
-        end
-    end
-                        
-    if showopt
-        fprintf('Options:\n');
-        opt
-        arglist
-    end
-
-    if nargout == 2
-        others = arglist;
-    end
diff --git a/source/usbBrickIO.m b/source/usbBrickIO.m
old mode 100755
new mode 100644
index 47a682098d4bc2fd538c9a944abd6dda20f9585d..0f7bbf1fcf536b4b8d8d8663636691ce02e94e45
--- a/source/usbBrickIO.m
+++ b/source/usbBrickIO.m
@@ -1,258 +1,280 @@
-%usbBrickIO USB interface between MATLAB and the brick
-%
-% Methods::
-%
-%  usbBrickIO    Constructor, initialises and opens the usb connection
-%  delete       Destructor, closes the usb connection
-%
-%  open         Open a usb connection to the brick
-%  close        Close the usb connection to the brick
-%  read         Read data from the brick through usb
-%  write        Write data to the brick through usb
-%
-% Example::
-%           usbbrick = usbBrickIO()
-%
-% Notes::
-% - Uses the hid library implementation in hidapi.m
-
-classdef usbBrickIO < BrickIO
-    properties
-        % debug input
-        debug = 0;
-        % vendor ID (EV3 = 0x0694)
-        vendorID = 1684;
-        % product ID (EV3 = 0x0005)
-        productID = 5;
-        % read buffer size
-        nReadBuffer = 1024;
-        % write buffer size
-        nWriteBuffer = 1024;
-        % time-out period in milliseconds (if 0, no time-out)
-        timeOut = 10000;
-    end
-    
-    properties (Access = 'protected')
-        % connection handle
-        handle
-    end 
-    
-    methods
-        function brickIO = usbBrickIO(varargin)
-            %usbBrickIO.usbBrickIO Create a usbBrickIO object
-            %
-            % usbbrick = usbBrickIO(varargin) is an object which
-            % initialises a usb connection between MATLAB and the brick
-            % using hidapi.m.
-            % 
-            % Notes::
-            % - Can take one parameter debug which is a flag specifying
-            % output printing (0 or 1).
-            
-            if nargin == 0
-                brickIO.debug = 0;
-            else
-                brickIO.debug = varargin{1}; 
-            end
-            
-            if brickIO.debug > 0
-                fprintf('(DEBUG) (USB init)\n');
-            end
-            
-            % Create the usb handle
-            try
-                brickIO.handle = hidapi(0,brickIO.vendorID,brickIO.productID, ...
-                                        brickIO.nReadBuffer,brickIO.nWriteBuffer);
-            catch ME
-                if ~isempty(strfind(ME.identifier, 'InvalidParameterOrFileMissing'))
-                    % Throw a clean InvalidParameterOrFileMissing to avoid confusion in upper layers
-                    msg = ['Couldn''t load hidapi-library for USB connection due to a ' ...
-                           'missing file. Make sure the correct hidapi-library and its ' ...
-                           'corresponding thunk- and proto-files are available.'];
-                    id = [ID(), ':', 'InvalidParameterOrFileMissing'];
-                    throw(MException(id, msg));
-                elseif ~isempty(strfind(ME.identifier, 'LoadingLibraryError'))
-                    % Throw a clean LoadingLibraryError to avoid confusion in upper layers
-                    msg = 'Failed to load hidapi-library for USB connection.';
-                    id = [ID(), ':', 'LoadingLibraryError'];
-                    throw(MException(id, msg));
-                else
-                    % Throw combined error because error did not happen due to known reasons...
-                    msg = 'Unknown error occurred while trying to load the HIDAPI-lib for USB.';
-                    id = [ID(), ':', 'UnknownError'];
-                    newException = MException(id, msg);
-                    newException = addCause(newException, ME);
-                    throw(newException);
-                end
-            end
-                                
-            % Open the brick IO connection
-            brickIO.open;
-        end
-        
-        function delete(brickIO)
-            %usbBrickIO.delete Delete the usbBrickIO object
-            %
-            % delete(brickIO) closes the usb connection handle
-            
-            if brickIO.debug > 0
-                fprintf('(DEBUG) (USB delete)\n');
-            end
-            
-            try
-                brickIO.close;
-            catch
-                % Connection already closed (probably due to an error) - do nothing
-            end
-        end
-        
-        function open(brickIO)
-            %usbBrickIO.open Open the usbBrickIO object
-            %
-            % usbBrickIO.open() opens the usb handle through the hidapi
-            % interface.
-            
-            if brickIO.debug > 0
-                fprintf('(DEBUG) (USB open)\n');
-            end
-            
-            % Open the usb handle (MMI: and handle possible errors)
-            try
-                brickIO.handle.open;
-            catch ME
-                if ~isempty(strfind(ME.identifier, 'CommError'))
-                    % Throw a clean CommError to avoid confusion in upper layers
-                    msg = 'Failed to open connection to Brick via USB.';
-                    id = [ID(), ':', 'CommError'];
-                    throw(MException(id, msg));
-                else
-                    % Throw combined error because error did not happen due to known reasons...
-                    msg = 'Unknown error occurred while trying to connect to the Brick via USB.';
-                    id = [ID(), ':', 'UnknownError'];
-                    newException = MException(id, msg);
-                    newException = addCause(newException, ME);
-                    throw(newException);
-                end
-            end
-        end
-        
-        function close(brickIO)
-            %usbBrickIO.close Close the usbBrickIO object
-            %
-            % usbBrickIO.close() closes the usb handle through the hidapi
-            % interface.
-            if brickIO.debug > 0
-                fprintf('(DEBUG) (USB close) \n');
-            end 
-            
-            try
-                % Close the usb handle
-                brickIO.handle.close;
-            catch ME
-                % Throw combined error because error did not happen due to known reasons...
-                msg = 'Unknown error occurred while closing the USB connection.';
-                id = [ID(), ':', 'UnknownError'];
-                newException = MException(id, msg);
-                newException = addCause(newException, ME);
-                throw(newException);
-            end
-        end
-        
-        function rmsg = read(brickIO)
-            %usbBrickIO.read Read data from the usbBrickIO object
-            %
-            % rmsg = usbBrickIO.read() reads data from the brick through
-            % usb and returns the data in uint8 format.
-            %
-            % Notes::
-            % - This function is blocking with no time out in the current
-            % implementation.
-            
-            if brickIO.debug > 0
-                fprintf('(DEBUG) (USB read)   ');
-            end 
-            
-            % Read from the usb handle
-            try
-                if brickIO.timeOut ~= 0
-                    rmsg = brickIO.handle.read_timeout(brickIO.timeOut);
-                else
-                    rmsg = brickIO.handle.read();
-                end
-            catch ME
-                if ~isempty(strfind(ME.identifier, 'CommError'))
-                    % Throw a clean CommError to avoid confusion in upper layers
-                    msg = 'Failed to read data from the Brick via USB due to connection-error.';
-                    id = [ID(), ':', 'CommError'];
-                    throw(MException(id, msg));
-                elseif ~isempty(strfind(ME.identifier, 'InvalidHandle'))
-                    % Throw a clean InvalidHandle to avoid confusion in upper layers
-                    msg = 'Failed to read data from the Brick via USB due to invalid handle to USB-device.';
-                    id = [ID(), ':', 'InvalidHandle'];
-                    throw(MException(id, msg));
-                else
-                    % Throw combined error because error did not happen due to known reasons...
-                    msg = 'Unknown error occurred while reading data from the Brick via USB.';
-                    id = [ID(), ':', 'UnknownError'];
-                    newException = MException(id, msg);
-                    newException = addCause(newException, ME);
-                    throw(newException);
-                end
-            end
-            
-            % Get the number of read bytes
-            pLength = double(typecast(uint8(rmsg(1:2)),'uint16')) + 2;
-            
-            % Format the read message (2 byte length plus message)
-            if pLength < length(rmsg)
-                rmsg = rmsg(1:pLength);
-            end
-        end
-        
-        function write(brickIO,wmsg)
-            %usbBrickIO.write Write data to the usbBrickIO object
-            %
-            % usbBrickIO.write(wmsg) writes data to the brick through usb.
-            %
-            % Notes::
-            % - wmsg is the data to be written to the brick via usb in  
-            % uint8 format.
-            
-            if brickIO.debug > 0
-                fprintf('(DEBUG) (USB write)  ');
-            end 
-            
-            % Write to the usb handle using report ID 0
-            try
-                brickIO.handle.write(wmsg,0);
-            catch ME
-                if ~isempty(strfind(ME.identifier, 'CommError'))
-                    % Throw a clean CommError to avoid confusion in upper layers
-                    msg = 'Failed to send data to Brick via USB due to connection-error.';
-                    id = 'RWTHMindstormsEV3:usbBrickIO:write:CommError';
-                    throw(MException(id, msg));
-                elseif ~isempty(strfind(ME.identifier, 'InvalidHandle'))
-                    % Throw a clean InvalidHandle to avoid confusion in upper layers
-                    msg = 'Failed to send data to Brick via USB due to invalid handle to USB-device.';
-                    id = [ID(), ':', 'InvalidHandle'];
-                    throw(MException(id, msg));
-                else
-                    % Throw combined error because error did not happen due to known reasons...
-                    msg = 'Unknown error occurred while sending data to the Brick via USB.';
-                    id = [ID(), ':', 'UnknownError'];
-                    newException = MException(id, msg);
-                    newException = addCause(newException, ME);
-                    throw(newException);
-                end
-            end
-        end
-        
-        function set.timeOut(brickIO, timeOut)
-            if ~isnumeric(timeOut) || timeOut < 0
-                error(ID(), 'timeOut-period of USB-handle can only be set to positive numerical values.'); 
-            end
-            
-            brickIO.timeOut = timeOut*1000;
-        end 
-    end 
-end
+classdef usbBrickIO < BrickIO      
+    % USB interface between MATLAB and the brick
+    %
+    % Notes:
+    %     * Uses the hid library implementation in hidapi.m
+    %     * The default parameters should always work when you try to connect to an EV3 brick,
+    %       so in nearly all use-cases, the constructor does not need any parameters (besides
+    %       'debug' eventually).
+    %
+    % Attributes:
+    %     debug (bool): If true, each open/close/read/write-call will be noted in the console.
+    %        Defaults to false.
+    %     vendorID (numeric): Vendor-ID of the USB device. Defaults to 0x694 (EV3 vendor ID).
+    %     productID (numeric): Product-ID of the USB device. Defaults to 0x0005 (EV3 product ID).
+    %     nReadBuffer (numeric): Read-buffer size in bytes. Defaults to 1024.
+    %     nWriteBuffer (numeric): Write-buffer size in bytes. Needs to be 1 Byte bigger than
+    %        actual packet. Defaults to 1025 (EV3 USB maximum packet size = 1024).
+    %     timeOut (numeric >= 0): Milliseconds after which a timeout-error occurs if no packet could be
+    %        read. Defaults to 10000.
+    %
+    % Examples:
+    %    % Connecting via USB |br|
+    %    commHandle = usbBrickIO(); % |br|
+    %    % Connecting via USB with enabled debug output |br|
+    %    commHandle = usbBrickIO('debug', true); % |br|
+    %
+    
+    properties
+        % debug (bool): If true, each open/close/read/write-call will be noted in the console.
+        %    Defaults to false.
+        debug;
+        % vendorID (numeric): Vendor-ID of the USB device. Defaults to 0x694 (EV3 vendor ID).
+        vendorID;
+        % productID (numeric): Product-ID of the USB device. Defaults to 0x0005 (EV3 product ID).
+        productID;
+        % nReadBuffer (numeric): Read-buffer size in bytes. Defaults to 1024.
+        nReadBuffer;
+        % nWriteBuffer (numeric): Write-buffer size in bytes. Defaults to 1025 (EV3 USB maximum packet size = 1024).
+        %    Needs to be 1 Byte bigger than actual packet. 
+        nWriteBuffer;
+        % timeOut (numeric >= 0): Milliseconds after which a timeout-error occurs if no packet could be read. Defaults to 10000.
+        timeOut;
+    end
+    
+    properties (Access = protected)
+        % handle: Connection handle to the device
+        handle
+    end 
+    
+    methods
+        function brickIO = usbBrickIO(varargin)
+            % Create an usbBrickIO object 
+            %
+            % Arguments:
+            %     varargin: Any number of property names as strings, each followed by the
+            %         desired value. 
+            %
+            % Examples: 
+            %    % Connecting via USB 
+            %    commHandle = usbBrickIO();
+            %    % Connecting via USB with enabled debug output
+            %    commHandle = usbBrickIO('debug', true);
+            %
+            % See also USBBRICKIO.SETPROPERTIES
+            
+            brickIO.setProperties(varargin{:});
+            
+            if brickIO.debug > 0
+                fprintf('(DEBUG) (USB init)\n');
+            end
+            
+            % Set the connection handle
+            try
+                brickIO.handle = hidapi(brickIO.vendorID,brickIO.productID, ...
+                                        brickIO.nReadBuffer,brickIO.nWriteBuffer);
+            catch ME
+                if ~isempty(strfind(ME.identifier, 'InvalidParameterOrFileMissing'))
+                    % Throw a clean InvalidParameterOrFileMissing to avoid confusion in upper layers
+                    msg = ['Couldn''t load hidapi-library for USB connection due to a ' ...
+                           'missing file. Make sure the correct hidapi-library and its ' ...
+                           'corresponding thunk- and proto-files are available.'];
+                    id = [ID(), ':', 'InvalidParameterOrFileMissing'];
+                    throw(MException(id, msg));
+                elseif ~isempty(strfind(ME.identifier, 'LoadingLibraryError'))
+                    % Throw a clean LoadingLibraryError to avoid confusion in upper layers
+                    msg = 'Failed to load hidapi-library for USB connection.';
+                    id = [ID(), ':', 'LoadingLibraryError'];
+                    throw(MException(id, msg));
+                else
+                    % Throw combined error because error did not happen due to known reasons...
+                    msg = 'Unknown error occurred while trying to load the HIDAPI-lib for USB.';
+                    id = [ID(), ':', 'UnknownError'];
+                    newException = MException(id, msg);
+                    newException = addCause(newException, ME);
+                    throw(newException);
+                end
+            end
+                                
+            % Open the connection
+            brickIO.open;
+        end
+        
+        function delete(brickIO)
+            % Delete the usbBrickIO object and closes the connection
+            
+            if brickIO.debug > 0
+                fprintf('(DEBUG) (USB delete)\n');
+            end
+            
+            % Disconnect
+            try
+                brickIO.close;
+            catch
+                % Connection already closed (probably due to an error) - do nothing
+            end
+        end
+        
+        function open(brickIO)
+            % Opens the usb connection to the brick through the hidapi interface.
+            
+            if brickIO.debug > 0
+                fprintf('(DEBUG) (USB open)\n');
+            end
+            
+            % Open the usb handle 
+            try
+                brickIO.handle.open;
+            catch ME
+                if ~isempty(strfind(ME.identifier, 'CommError'))
+                    % Throw a clean CommError to avoid confusion in upper layers
+                    msg = 'Failed to open connection to Brick via USB.';
+                    id = [ID(), ':', 'CommError'];
+                    throw(MException(id, msg));
+                else
+                    % Throw combined error because error did not happen due to known reasons...
+                    msg = 'Unknown error occurred while trying to connect to the Brick via USB.';
+                    id = [ID(), ':', 'UnknownError'];
+                    newException = MException(id, msg);
+                    newException = addCause(newException, ME);
+                    throw(newException);
+                end
+            end
+        end
+        
+        function close(brickIO)
+            % Closes the usb connection the brick through the hidapi interface.
+            
+            if brickIO.debug > 0
+                fprintf('(DEBUG) (USB close) \n');
+            end 
+            
+            try
+                % Close the usb handle
+                brickIO.handle.close;
+            catch ME
+                % Throw combined error because error did not happen due to known reasons...
+                msg = 'Unknown error occurred while closing the USB connection.';
+                id = [ID(), ':', 'UnknownError'];
+                newException = MException(id, msg);
+                newException = addCause(newException, ME);
+                throw(newException);
+            end
+        end
+        
+        function rmsg = read(brickIO)
+            % Reads data from the brick through usb using the hidapi interface and returns the data in uint8 format.
+            
+            if brickIO.debug > 0
+                fprintf('(DEBUG) (USB read)   ');
+            end 
+            
+            % Read from the usb handle
+            try
+                if brickIO.timeOut ~= 0
+                    rmsg = brickIO.handle.read_timeout(brickIO.timeOut);
+                else
+                    rmsg = brickIO.handle.read();
+                end
+            catch ME
+                if ~isempty(strfind(ME.identifier, 'CommError'))
+                    % Throw a clean CommError to avoid confusion in upper layers
+                    msg = 'Failed to read data from the Brick via USB due to connection-error.';
+                    id = [ID(), ':', 'CommError'];
+                    throw(MException(id, msg));
+                elseif ~isempty(strfind(ME.identifier, 'InvalidHandle'))
+                    % Throw a clean InvalidHandle to avoid confusion in upper layers
+                    msg = 'Failed to read data from the Brick via USB due to invalid handle to USB-device.';
+                    id = [ID(), ':', 'InvalidHandle'];
+                    throw(MException(id, msg));
+                else
+                    % Throw combined error because error did not happen due to known reasons...
+                    msg = 'Unknown error occurred while reading data from the Brick via USB.';
+                    id = [ID(), ':', 'UnknownError'];
+                    newException = MException(id, msg);
+                    newException = addCause(newException, ME);
+                    throw(newException);
+                end
+            end
+            
+            % Get the number of read bytes
+            pLength = double(typecast(uint8(rmsg(1:2)),'uint16')) + 2;
+            
+            % Format the read message (2 byte length plus message)
+            if pLength < length(rmsg)
+                rmsg = rmsg(1:pLength);
+            end
+        end
+        
+        function write(brickIO,wmsg)
+            % Writes data to the brick through usb using the hidapi interface.
+            %
+            % Arguments:
+            %     wmsg (uint8 array): Data to be written to the brick via usb
+            
+            if brickIO.debug > 0
+                fprintf('(DEBUG) (USB write)  ');
+            end 
+            
+            % Write to the usb handle using report ID 0
+            try
+                brickIO.handle.write(wmsg,0);
+            catch ME
+                if ~isempty(strfind(ME.identifier, 'CommError'))
+                    % Throw a clean CommError to avoid confusion in upper layers
+                    msg = 'Failed to send data to Brick via USB due to connection-error.';
+                    id = 'RWTHMindstormsEV3:usbBrickIO:write:CommError';
+                    throw(MException(id, msg));
+                elseif ~isempty(strfind(ME.identifier, 'InvalidHandle'))
+                    % Throw a clean InvalidHandle to avoid confusion in upper layers
+                    msg = 'Failed to send data to Brick via USB due to invalid handle to USB-device.';
+                    id = [ID(), ':', 'InvalidHandle'];
+                    throw(MException(id, msg));
+                else
+                    % Throw combined error because error did not happen due to known reasons...
+                    msg = 'Unknown error occurred while sending data to the Brick via USB.';
+                    id = [ID(), ':', 'UnknownError'];
+                    newException = MException(id, msg);
+                    newException = addCause(newException, ME);
+                    throw(newException);
+                end
+            end
+        end
+        
+        function set.timeOut(brickIO, timeOut)
+            if ~isnumeric(timeOut) || timeOut < 0
+                error(ID(), 'timeOut-period of USB-handle can only be set to positive numerical values.'); 
+            end
+            
+            brickIO.timeOut = timeOut*1000;
+        end 
+        function setProperties(brickIO, varargin)
+            % Sets multiple usbBrickIO properties at once using MATLAB's inputParser.
+            %
+            % The syntax is as follows: commHandle.setProperties('propertyName1',
+            % propertyValue1, 'propertyName2', propertyValue2, ...). Valid, optional properties
+            % are: debug, vendorID, productID, nReadBuffer, nWriteBuffer, timeOut.
+            %
+            % See also USBBRICKIO.DEBUG, USBBRICKIO.VENDORID, USBBRICKIO.PRODUCTID,
+            % USBBRICKIO.NREADBUFFER, USBBRICKIO.NWRITEBUFFER, USBBRICKIO.TIMEOUT
+            
+            p = inputParser();
+            
+            p.addOptional('debug', false);
+            p.addOptional('vendorID', 1684);
+            p.addOptional('productID', 5);
+            p.addOptional('nReadBuffer', 1024);
+            p.addOptional('nWriteBuffer', 1025);
+            p.addOptional('timeOut', 10000);
+            
+            p.parse(varargin{:});
+            
+            brickIO.debug = p.Results.debug;
+            brickIO.vendorID = p.Results.vendorID;
+            brickIO.productID = p.Results.productID;
+            brickIO.nReadBuffer = p.Results.nReadBuffer;
+            brickIO.nWriteBuffer = p.Results.nWriteBuffer;
+            brickIO.timeOut = p.Results.timeOut;
+        end
+    end 
+end