1 /* This tests the case where the device connected to the hub is disconnected.
2    The specific test case is in ux_host_class_hub_port_change_connection_process.c. */
3 
4 #include "usbx_ux_test_hub.h"
5 
6 /* Define what the initial system looks like.  */
7 
8 #ifdef CTEST
test_application_define(void * first_unused_memory)9 void test_application_define(void *first_unused_memory)
10 #else
11 void usbx_hub_hub_device_disconnect_test_application_define(void *first_unused_memory)
12 #endif
13 {
14 
15     /* Inform user.  */
16     printf("Running Hub Device Disconnect Test.................................. ");
17 
18     stepinfo("\n");
19 
20     initialize_hub(first_unused_memory);
21 }
22 
post_init_host()23 static void post_init_host()
24 {
25 #if UX_MAX_DEVICES > 1
26     /* Now, let's tell the host that there's a device connection, and wait for host to enumerate it. */
27     connect_device_to_hub();
28     class_dpump_get();
29 
30     /* Now we need to disconnect the device. */
31     disconnect_device_from_hub();
32     UX_TEST_CHECK_SUCCESS(ux_test_wait_for_null((VOID**)&g_dpump_host_from_system_change_function));
33     ux_test_wait_for_enum_thread_completion();
34 #endif
35 }
36 
post_init_device()37 static void post_init_device()
38 {
39 }