<p><b>@dylad</b> commented on this pull request.</p>

<p>quick round.<br>
I'll try to test whenever I can</p><hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/12267#discussion_r325574668">sys/usb/usbus/usbus_control.c</a>:</p>
<pre style='color:#555'>> @@ -213,21 +212,19 @@ static int _recv_dev_setup(usbus_t *usbus, usb_setup_t *pkt)
             case USB_SETUP_REQ_SET_ADDRESS:
                 DEBUG("usbus_control: Setting address\n");
                 usbus->addr = (uint8_t)pkt->value;
-                res = 0;
+                res = 1;
</pre>
<p>Any reason to change this ? Usually we consider 0 to be OK and < 0 not OK</p>

<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/12267#discussion_r325576245">sys/usb/usbus/usbus_control.c</a>:</p>
<pre style='color:#555'>> @@ -307,6 +307,17 @@ static void _usbus_config_ep0(usbus_control_handler_t *ep0_handler)
     usbdev_ep_ready(ep0_handler->out, 0);
 }
 
+uint8_t *usbus_control_get_out_data(usbus_t *usbus, size_t *len)
+{
+    assert((int)usbus->state == (int)USBUS_CONTROL_REQUEST_STATE_OUTDATA);
</pre>
<p>Is it desireable to mix up <code>usbus_state_t</code> with <code>usbus_setuprq_state_t</code> ?</p>

<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/12267#discussion_r325578066">tests/usbus/main.c</a>:</p>
<pre style='color:#555'>> +    }
+}
+
+static void _ep_esr_validation(usbdev_mock_t *dev, usbdev_mock_ep_t *ep)
+{
+    DEBUG("[ep esr]: Data available for stack: %u\n", ep->available);
+    if (req_phase == TEST_REQ_PHASE_IDLE) {
+        DEBUG("[ep esr]: Done with the request\n");
+        /* signal USBDEV_EVENT_ESR to call _test_sequence */
+        dev->usbdev.cb(&dev->usbdev, USBDEV_EVENT_ESR);
+    }
+    ep->ep.dev->epcb(&ep->ep, USBDEV_EVENT_TR_COMPLETE);
+}
+
+/* Handles Control endpoint validation from the usbdev side  */
+/* Called as part of the endpoint ready function             */
</pre>
<p>put these comments together</p>

<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/12267#discussion_r325579339">tests/usbus/usbdev_mock.c</a>:</p>
<pre style='color:#555'>> +{
+    (void)ep;
+}
+
+int _ep_get(usbdev_ep_t *ep, usbopt_ep_t opt,
+            void *value, size_t max_len)
+{
+    usbdev_mock_ep_t *testep = (usbdev_mock_ep_t *)ep;
+
+    (void)max_len;
+    switch (opt) {
+        case USBOPT_EP_AVAILABLE:
+            *((size_t *)value) = testep->available;
+            return sizeof(size_t);
+        default:
+            break;
</pre>
<p>Please add a DEBUG statement</p>

<hr>

<p>In <a href="https://github.com/RIOT-OS/RIOT/pull/12267#discussion_r325579969">tests/usbus/usbdev_mock.h</a>:</p>
<pre style='color:#555'>> + *
+ * @param dev   usbdev mock device state
+ * @param ep    usbdev mock device endpoint
+ * @param len   length supplied to the ready call
+ */
+typedef void (*usbdev_mock_ready_cb_t)(usbdev_mock_t *dev,
+                                       usbdev_mock_ep_t *ep,
+                                       size_t len);
+
+/**
+ * @brief usbdev mock device
+ */
+struct usbdev_mock {
+    usbdev_t usbdev;                    /**< Generic usbdev device          */
+    usbdev_mock_ep_t in[1];             /**< IN endpoints                   */
+    usbdev_mock_ep_t out[1];            /**< OUT endpoints                  */
</pre>
<p>why an array with one element ??</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/RIOT-OS/RIOT/pull/12267?email_source=notifications&email_token=ABE7WYDATYL3LMX2SWZGN3DQKHZ37A5CNFSM4IXUWNC2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCFC4ZCA#pullrequestreview-289787016">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYAMS25UKIITG7LQTE3QKHZ37ANCNFSM4IXUWNCQ">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABE7WYGBNYQXACZJQB35HUTQKHZ37A5CNFSM4IXUWNC2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCFC4ZCA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/pull/12267?email_source=notifications\u0026email_token=ABE7WYDATYL3LMX2SWZGN3DQKHZ37A5CNFSM4IXUWNC2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCFC4ZCA#pullrequestreview-289787016",
"url": "https://github.com/RIOT-OS/RIOT/pull/12267?email_source=notifications\u0026email_token=ABE7WYDATYL3LMX2SWZGN3DQKHZ37A5CNFSM4IXUWNC2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCFC4ZCA#pullrequestreview-289787016",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>