Fixed bug in RNDISEthernet and DualCDC demos not using the correct USB_ControlRequest...
[pub/USBasp.git] / Demos / Host / KeyboardHostWithParser / ConfigDescriptor.c
index 2c962cb..9b56823 100644 (file)
@@ -52,7 +52,7 @@ uint8_t ProcessConfigurationDescriptor(void)
        uint8_t  ErrorCode;\r
        \r
        /* Get Configuration Descriptor size from the device */\r
        uint8_t  ErrorCode;\r
        \r
        /* Get Configuration Descriptor size from the device */\r
-       if (USB_Host_GetDeviceConfigDescriptor(&ConfigDescriptorSize, NULL) != HOST_SENDCONTROL_Successful)\r
+       if (USB_GetDeviceConfigDescriptor(&ConfigDescriptorSize, NULL) != HOST_SENDCONTROL_Successful)\r
          return ControlError;\r
        \r
        /* Ensure that the Configuration Descriptor isn't too large */\r
          return ControlError;\r
        \r
        /* Ensure that the Configuration Descriptor isn't too large */\r
@@ -63,21 +63,21 @@ uint8_t ProcessConfigurationDescriptor(void)
        ConfigDescriptorData = alloca(ConfigDescriptorSize);\r
 \r
        /* Retrieve the entire configuration descriptor into the allocated buffer */\r
        ConfigDescriptorData = alloca(ConfigDescriptorSize);\r
 \r
        /* Retrieve the entire configuration descriptor into the allocated buffer */\r
-       USB_Host_GetDeviceConfigDescriptor(&ConfigDescriptorSize, ConfigDescriptorData);\r
+       USB_GetDeviceConfigDescriptor(&ConfigDescriptorSize, ConfigDescriptorData);\r
        \r
        /* Validate returned data - ensure first entry is a configuration header descriptor */\r
        if (DESCRIPTOR_TYPE(ConfigDescriptorData) != DTYPE_Configuration)\r
          return InvalidConfigDataReturned;\r
        \r
        /* Get the keyboard interface from the configuration descriptor */\r
        \r
        /* Validate returned data - ensure first entry is a configuration header descriptor */\r
        if (DESCRIPTOR_TYPE(ConfigDescriptorData) != DTYPE_Configuration)\r
          return InvalidConfigDataReturned;\r
        \r
        /* Get the keyboard interface from the configuration descriptor */\r
-       if ((ErrorCode = USB_Host_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, NextKeyboardInterface)))\r
+       if ((ErrorCode = USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, NextKeyboardInterface)))\r
        {\r
                /* Descriptor not found, error out */\r
                return NoHIDInterfaceFound;\r
        }\r
        \r
        /* Get the keyboard interface's HID descriptor */\r
        {\r
                /* Descriptor not found, error out */\r
                return NoHIDInterfaceFound;\r
        }\r
        \r
        /* Get the keyboard interface's HID descriptor */\r
-       if ((ErrorCode = USB_Host_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, NextHID)))\r
+       if ((ErrorCode = USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, NextHID)))\r
        {\r
                /* Descriptor not found, error out */\r
                return NoHIDDescriptorFound;\r
        {\r
                /* Descriptor not found, error out */\r
                return NoHIDDescriptorFound;\r
@@ -87,7 +87,7 @@ uint8_t ProcessConfigurationDescriptor(void)
        HIDReportSize = DESCRIPTOR_CAST(ConfigDescriptorData, USB_Descriptor_HID_t).HIDReportLength;\r
 \r
        /* Get the keyboard interface's data endpoint descriptor */\r
        HIDReportSize = DESCRIPTOR_CAST(ConfigDescriptorData, USB_Descriptor_HID_t).HIDReportLength;\r
 \r
        /* Get the keyboard interface's data endpoint descriptor */\r
-       if ((ErrorCode = USB_Host_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,\r
+       if ((ErrorCode = USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData,\r
                                                        NextInterfaceKeyboardDataEndpoint)))\r
        {\r
                /* Descriptor not found, error out */\r
                                                        NextInterfaceKeyboardDataEndpoint)))\r
        {\r
                /* Descriptor not found, error out */\r
@@ -123,11 +123,11 @@ DESCRIPTOR_COMPARATOR(NextKeyboardInterface)
                if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class    == KEYBOARD_CLASS) &&\r
                    (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == KEYBOARD_PROTOCOL))\r
                {\r
                if ((DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Class    == KEYBOARD_CLASS) &&\r
                    (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Interface_t).Protocol == KEYBOARD_PROTOCOL))\r
                {\r
-                       return Descriptor_Search_Found;\r
+                       return DESCRIPTOR_SEARCH_Found;\r
                }\r
        }\r
        \r
                }\r
        }\r
        \r
-       return Descriptor_Search_NotFound;\r
+       return DESCRIPTOR_SEARCH_NotFound;\r
 }\r
 \r
 /** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's\r
 }\r
 \r
 /** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's\r
@@ -144,14 +144,14 @@ DESCRIPTOR_COMPARATOR(NextInterfaceKeyboardDataEndpoint)
        if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint)\r
        {\r
                if (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Endpoint_t).EndpointAddress & ENDPOINT_DESCRIPTOR_DIR_IN)\r
        if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Endpoint)\r
        {\r
                if (DESCRIPTOR_CAST(CurrentDescriptor, USB_Descriptor_Endpoint_t).EndpointAddress & ENDPOINT_DESCRIPTOR_DIR_IN)\r
-                 return Descriptor_Search_Found;\r
+                 return DESCRIPTOR_SEARCH_Found;\r
        }\r
        else if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)\r
        {\r
        }\r
        else if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_Interface)\r
        {\r
-               return Descriptor_Search_Fail;\r
+               return DESCRIPTOR_SEARCH_Fail;\r
        }\r
 \r
        }\r
 \r
-       return Descriptor_Search_NotFound;\r
+       return DESCRIPTOR_SEARCH_NotFound;\r
 }\r
 \r
 /** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's\r
 }\r
 \r
 /** Descriptor comparator function. This comparator function is can be called while processing an attached USB device's\r
@@ -165,7 +165,7 @@ DESCRIPTOR_COMPARATOR(NextInterfaceKeyboardDataEndpoint)
 DESCRIPTOR_COMPARATOR(NextHID)\r
 {\r
        if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_HID)\r
 DESCRIPTOR_COMPARATOR(NextHID)\r
 {\r
        if (DESCRIPTOR_TYPE(CurrentDescriptor) == DTYPE_HID)\r
-         return Descriptor_Search_Found;\r
+         return DESCRIPTOR_SEARCH_Found;\r
        else\r
        else\r
-         return Descriptor_Search_NotFound;      \r
+         return DESCRIPTOR_SEARCH_NotFound;      \r
 }\r
 }\r