Fix up the incomplete Webserver project so that it integrates with the uIP stack...
[pub/USBasp.git] / LUFA / Drivers / USB / Class / Host / CDC.h
index 397f3c5..dbc1f9e 100644 (file)
@@ -1,13 +1,13 @@
 /*\r
              LUFA Library\r
 /*\r
              LUFA Library\r
-     Copyright (C) Dean Camera, 2009.\r
+     Copyright (C) Dean Camera, 2010.\r
               \r
   dean [at] fourwalledcubicle [dot] com\r
       www.fourwalledcubicle.com\r
 */\r
 \r
 /*\r
               \r
   dean [at] fourwalledcubicle [dot] com\r
       www.fourwalledcubicle.com\r
 */\r
 \r
 /*\r
-  Copyright 2009  Dean Camera (dean [at] fourwalledcubicle [dot] com)\r
+  Copyright 2010  Dean Camera (dean [at] fourwalledcubicle [dot] com)\r
 \r
   Permission to use, copy, modify, distribute, and sell this \r
   software and its documentation for any purpose is hereby granted\r
 \r
   Permission to use, copy, modify, distribute, and sell this \r
   software and its documentation for any purpose is hereby granted\r
                        uint8_t CDC_Host_SendControlLineStateChange(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);\r
                        \r
                        /** Sends a given string to the attached USB device, if connected. If a device is not connected when the function is called, the\r
                        uint8_t CDC_Host_SendControlLineStateChange(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);\r
                        \r
                        /** Sends a given string to the attached USB device, if connected. If a device is not connected when the function is called, the\r
-                        *  string is discarded.\r
+                        *  string is discarded. Bytes will be queued for transmission to the device until either the pipe bank becomes full, or the\r
+                        *  \ref CDC_Host_Flush() function is called to flush the pending data to the host. This allows for multiple bytes to be \r
+                        *  packed into a single pipe packet, increasing data throughput.\r
+                        *\r
+                        *  \note This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the\r
+                        *        call will fail.\r
                         *\r
                         *  \param[in,out] CDCInterfaceInfo  Pointer to a structure containing a CDC Class host configuration and state\r
                         *  \param[in] Data  Pointer to the string to send to the device\r
                         *\r
                         *  \param[in,out] CDCInterfaceInfo  Pointer to a structure containing a CDC Class host configuration and state\r
                         *  \param[in] Data  Pointer to the string to send to the device\r
                        uint8_t CDC_Host_SendString(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, char* Data, const uint16_t Length)\r
                                                    ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);\r
                        \r
                        uint8_t CDC_Host_SendString(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo, char* Data, const uint16_t Length)\r
                                                    ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);\r
                        \r
-                       /** Sends a given byte to the attached USB device, if connected. If a host is not connected when the function is called, the\r
-                        *  byte is discarded.\r
+                       /** Sends a given byte to the attached USB device, if connected. If a device is not connected when the function is called, the\r
+                        *  byte is discarded. Bytes will be queued for transmission to the device until either the pipe bank becomes full, or the\r
+                        *  \ref CDC_Host_Flush() function is called to flush the pending data to the host. This allows for multiple bytes to be \r
+                        *  packed into a single pipe packet, increasing data throughput.\r
+                        *\r
+                        *  \note This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the\r
+                        *        call will fail.\r
                         *\r
                         *  \param[in,out] CDCInterfaceInfo  Pointer to a structure containing a CDC Class host configuration and state\r
                         *  \param[in] Data  Byte of data to send to the device\r
                         *\r
                         *  \param[in,out] CDCInterfaceInfo  Pointer to a structure containing a CDC Class host configuration and state\r
                         *  \param[in] Data  Byte of data to send to the device\r
 \r
                        /** Determines the number of bytes received by the CDC interface from the device, waiting to be read.\r
                         *\r
 \r
                        /** Determines the number of bytes received by the CDC interface from the device, waiting to be read.\r
                         *\r
+                        *  \note This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the\r
+                        *        call will fail.\r
+                        *\r
                         *  \param[in,out] CDCInterfaceInfo  Pointer to a structure containing a CDC Class host configuration and state\r
                         *\r
                         *  \return Total number of buffered bytes received from the device\r
                         *  \param[in,out] CDCInterfaceInfo  Pointer to a structure containing a CDC Class host configuration and state\r
                         *\r
                         *  \return Total number of buffered bytes received from the device\r
                         *  returns 0. The \ref CDC_Host_BytesReceived() function should be queried before data is received to ensure that no data\r
                         *  underflow occurs.\r
                         *\r
                         *  returns 0. The \ref CDC_Host_BytesReceived() function should be queried before data is received to ensure that no data\r
                         *  underflow occurs.\r
                         *\r
+                        *  \note This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the\r
+                        *        call will fail.\r
+                        *\r
                         *  \param[in,out] CDCInterfaceInfo  Pointer to a structure containing a CDC Class host configuration and state\r
                         *\r
                         *  \return Next received byte from the device, or 0 if no data received\r
                         *  \param[in,out] CDCInterfaceInfo  Pointer to a structure containing a CDC Class host configuration and state\r
                         *\r
                         *  \return Next received byte from the device, or 0 if no data received\r
                        \r
                        /** Flushes any data waiting to be sent, ensuring that the send buffer is cleared.\r
                         *\r
                        \r
                        /** Flushes any data waiting to be sent, ensuring that the send buffer is cleared.\r
                         *\r
+                        *  \note This function must only be called when the Host state machine is in the HOST_STATE_Configured state or the\r
+                        *        call will fail.\r
+                        *\r
                         *  \param[in,out] CDCInterfaceInfo  Pointer to a structure containing a CDC Class host configuration and state\r
                         *\r
                         *  \return A value from the \ref Pipe_WaitUntilReady_ErrorCodes_t enum\r
                         *  \param[in,out] CDCInterfaceInfo  Pointer to a structure containing a CDC Class host configuration and state\r
                         *\r
                         *  \return A value from the \ref Pipe_WaitUntilReady_ErrorCodes_t enum\r