1 /* This tests the case where the host sends a request to the hub itself and 2 not a port. */ 3 4 #include "usbx_ux_test_hub.h" 5 6 #ifdef CTEST test_application_define(void * first_unused_memory)7void test_application_define(void *first_unused_memory) 8 #else 9 void usbx_hub_request_to_hub_itself_test_application_define(void *first_unused_memory) 10 #endif 11 { 12 13 /* Inform user. */ 14 printf("Running Hub Request To Hub Itself Test.............................. "); 15 16 stepinfo("\n"); 17 18 initialize_hub(first_unused_memory); 19 } 20 post_init_host()21static void post_init_host() 22 { 23 24 /* We perform this test by creating an action match the hub device request. 25 If it matches, then the request USBX sends is correct. */ 26 27 UINT command = UX_SET_FEATURE; 28 UINT function = UX_HOST_CLASS_HUB_PORT_POWER; 29 30 UX_TEST_SETUP setup = {0}; 31 setup.ux_test_setup_request = command; 32 setup.ux_test_setup_type = UX_REQUEST_OUT | UX_REQUEST_TYPE_CLASS | UX_REQUEST_TARGET_DEVICE; 33 34 UX_TEST_ACTION action = {0}; 35 action.usbx_function = UX_TEST_OVERRIDE_UX_HCD_SIM_HOST_ENTRY; 36 action.function = UX_HCD_TRANSFER_REQUEST; 37 action.req_action = UX_TEST_SETUP_MATCH_REQUEST; 38 action.req_setup = &setup; 39 action.no_return = 0; 40 action.status = UX_SUCCESS; 41 ux_test_add_action_to_main_list(action); 42 43 UX_TEST_CHECK_SUCCESS(_ux_host_class_hub_feature(g_hub_host, 0, command, function)); 44 45 UX_TEST_ASSERT(ux_test_check_actions_empty() == UX_TRUE); 46 } 47 post_init_device()48static void post_init_device() 49 { 50 }