1 /* This tests the case where the hub reports a device disconnection even though
2    no device was previously on that port. This can happen if the device is connected
3    then quickly disconnected, before USBX processes the connection. The specific
4    test case is in ux_host_class_hub_port_change_connection_process.c. */
5 
6 #include "usbx_ux_test_hub.h"
7 
8 /* Define what the initial system looks like.  */
9 
10 #ifdef CTEST
test_application_define(void * first_unused_memory)11 void test_application_define(void *first_unused_memory)
12 #else
13 void usbx_hub_quick_hub_device_disconnection_test_application_define(void *first_unused_memory)
14 #endif
15 {
16 
17     /* Inform user.  */
18     printf("Running Hub Quick Hub Device Disconnection Test..................... ");
19 
20     stepinfo("\n");
21 
22     initialize_hub(first_unused_memory);
23 }
24 
post_init_host()25 static void post_init_host()
26 {
27 
28     /* We test this by just reporting a disconnection when no device has been
29        connected - USBX won't know the difference! */
30 
31     disconnect_device_from_hub();
32     /* Wait for enum thread to detect it. */
33     tx_thread_sleep(100);
34     ux_test_wait_for_enum_thread_completion();
35 }
36 
post_init_device()37 static void post_init_device()
38 {
39 }