Better checking of whether a packet is received in the RNDISEthernetHost Class driver...
authorDean Camera <dean@fourwalledcubicle.com>
Fri, 27 Nov 2009 06:32:26 +0000 (06:32 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Fri, 27 Nov 2009 06:32:26 +0000 (06:32 +0000)
Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.c
Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.h
LUFA/Drivers/USB/USB.h
LUFA/ManPages/FutureChanges.txt

index 28d7b17..02dd46a 100644 (file)
@@ -159,18 +159,21 @@ int main(void)
 /** Prints incomming packets from the attached RNDIS device to the serial port. */\r
 void PrintIncommingPackets(void)\r
 {\r
 /** Prints incomming packets from the attached RNDIS device to the serial port. */\r
 void PrintIncommingPackets(void)\r
 {\r
-       uint16_t PacketLength;\r
-       \r
-       RNDIS_Host_ReadPacket(&Ethernet_RNDIS_Interface, &PacketBuffer, &PacketLength);\r
-       \r
-       if (PacketLength)\r
+       if (RNDIS_Host_IsPacketReceived(&Ethernet_RNDIS_Interface))\r
        {\r
        {\r
+               LEDs_SetAllLEDs(LEDMASK_USB_BUSY);\r
+\r
+               uint16_t PacketLength;\r
+               RNDIS_Host_ReadPacket(&Ethernet_RNDIS_Interface, &PacketBuffer, &PacketLength);\r
+       \r
                printf("***PACKET (Size %d)***\r\n", PacketLength);\r
        \r
                for (uint16_t i = 0; i < PacketLength; i++)\r
                  printf("%02x ", PacketBuffer[i]);\r
 \r
                printf("***PACKET (Size %d)***\r\n", PacketLength);\r
        \r
                for (uint16_t i = 0; i < PacketLength; i++)\r
                  printf("%02x ", PacketBuffer[i]);\r
 \r
-               printf("\r\n\r\n");             \r
+               printf("\r\n\r\n");\r
+               \r
+               LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
        }\r
 }\r
 \r
        }\r
 }\r
 \r
index 5f84980..ea87648 100644 (file)
@@ -63,6 +63,9 @@
                /** LED mask for the library LED driver, to indicate that an error has occurred in the USB interface. */\r
                #define LEDMASK_USB_ERROR        (LEDS_LED1 | LEDS_LED3)\r
                \r
                /** LED mask for the library LED driver, to indicate that an error has occurred in the USB interface. */\r
                #define LEDMASK_USB_ERROR        (LEDS_LED1 | LEDS_LED3)\r
                \r
+               /** LED mask for the library LED driver, to indicate that the USB interface is busy. */\r
+               #define LEDMASK_USB_BUSY         (LEDS_LED2)\r
+\r
        /* Function Prototypes: */\r
                void SetupHardware(void);\r
                void PrintIncommingPackets(void);\r
        /* Function Prototypes: */\r
                void SetupHardware(void);\r
                void PrintIncommingPackets(void);\r
index f1d7d5b..b40d6ab 100644 (file)
@@ -83,8 +83,8 @@
  *  <table>\r
  *  <tr>\r
  *   <th width="100px">USB Class</th> \r
  *  <table>\r
  *  <tr>\r
  *   <th width="100px">USB Class</th> \r
- *   <th width="80px">Device</th> \r
- *   <th width="80px">Host</th> \r
+ *   <th width="90px">Device Mode</th> \r
+ *   <th width="90px">Host Mode</th> \r
  *  </tr>\r
  *  <tr>\r
  *   <td>Audio</td>\r
  *  </tr>\r
  *  <tr>\r
  *   <td>Audio</td>\r
  *  </tr>\r
  *  <tr>\r
  *   <td>Printer</td>\r
  *  </tr>\r
  *  <tr>\r
  *   <td>Printer</td>\r
- *   <td bgcolor="#00EE00">No</td>\r
+ *   <td bgcolor="#EE0000">No</td>\r
 *    <td bgcolor="#00EE00">Yes</td>\r
  *  </tr>\r
  *  <tr>\r
  *   <td>RNDIS</td>\r
  *   <td bgcolor="#00EE00">Yes</td>\r
 *    <td bgcolor="#00EE00">Yes</td>\r
  *  </tr>\r
  *  <tr>\r
  *   <td>RNDIS</td>\r
  *   <td bgcolor="#00EE00">Yes</td>\r
- *   <td bgcolor="#EE0000">Yes</td>\r
+ *   <td bgcolor="#00EE00">Yes</td>\r
  *  </tr>\r
  *  <tr>\r
  *   <td>Still Image</td>\r
  *  </tr>\r
  *  <tr>\r
  *   <td>Still Image</td>\r
index 112c980..12e972c 100644 (file)
   *  If you have an item to add to this list, please contact the library author via email, the LUFA mailing list,\r
   *  or post your suggestion as an enhancement request to the project bug tracker.\r
   *\r
   *  If you have an item to add to this list, please contact the library author via email, the LUFA mailing list,\r
   *  or post your suggestion as an enhancement request to the project bug tracker.\r
   *\r
-  *  <b>Targeted for the Next Release (SVN Development Only):</b>\r
-  *\r
   *  <b>Targeted for Future Releases:</b>\r
   *  - Code Features\r
   *      -# Add hub support when in Host mode for multiple devices\r
   *      -# Add ability to get number of bytes not written with pipe/endpoint write routines after an error\r
   *      -# Add standardized descriptor names to class driver structures\r
   *  <b>Targeted for Future Releases:</b>\r
   *  - Code Features\r
   *      -# Add hub support when in Host mode for multiple devices\r
   *      -# Add ability to get number of bytes not written with pipe/endpoint write routines after an error\r
   *      -# Add standardized descriptor names to class driver structures\r
-  *      -# Finish RNDIS Host Class driver\r
   *      -# Correct mishandling of error cases in Mass Storage demos\r
   *  - Documentation/Support\r
   *      -# Remake AVRStudio project files\r
   *      -# Correct mishandling of error cases in Mass Storage demos\r
   *  - Documentation/Support\r
   *      -# Remake AVRStudio project files\r