zhhyu7 commented on code in PR #12914:
URL: https://github.com/apache/nuttx/pull/12914#discussion_r1722634403


##########
boards/sim/sim/sim/src/sim_composite.c:
##########
@@ -210,6 +211,61 @@ static void *board_composite1_connect(int port)
   return composite_initialize(composite_getdevdescs(), dev, dev_idx);
 }
 
+/****************************************************************************
+ * Name:  board_composite2_connect
+ *
+ * Description:
+ *   Connect the USB composite device on the specified USB device port for
+ *   configuration 2.
+ *
+ * Input Parameters:
+ *   port     - The USB device port.
+ *
+ * Returned Value:
+ *   A non-NULL handle value is returned on success.  NULL is returned on
+ *   any failure.
+ *
+ ****************************************************************************/
+
+static void *board_composite2_connect(int port)
+{
+  struct composite_devdesc_s dev[1];
+  int dev_idx = 0;
+
+#ifdef CONFIG_NET_CDCNCM
+  int ifnobase = 0;
+  int strbase = COMPOSITE_NSTRIDS - 1;
+
+  /* Configure the CDC/NCM device */
+
+  cdcncm_get_composite_devdesc(&dev[dev_idx]);
+
+  /* Interfaces */
+
+  dev[dev_idx].devinfo.ifnobase = ifnobase;
+  dev[dev_idx].minor = 0;
+
+  /* Strings */
+
+  dev[dev_idx].devinfo.strbase = strbase;
+
+  /* Endpoints */
+
+  dev[dev_idx].devinfo.epno[CDCNCM_EP_INTIN_IDX] = 5;
+  dev[dev_idx].devinfo.epno[CDCNCM_EP_BULKIN_IDX] = 6;
+  dev[dev_idx].devinfo.epno[CDCNCM_EP_BULKOUT_IDX] = 7;
+
+  /* Count up the base numbers */
+
+  ifnobase += dev[dev_idx].devinfo.ninterfaces;
+  strbase += dev[dev_idx].devinfo.nstrings;

Review Comment:
   Done.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to