mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-31 05:52:55 +08:00
fix bug with rndis overshadow the normal cdc callback
This commit is contained in:
parent
374aea7a11
commit
7345a4515d
@ -104,16 +104,23 @@ rndis_msg_initialize_t msg_init =
|
||||
.max_xfer_size = 0x4000 // TODO mimic windows
|
||||
};
|
||||
|
||||
//void test_rndis_send_initalize_failed(void)
|
||||
//{
|
||||
//
|
||||
//}
|
||||
void test_rndis_send_initalize_failed(void)
|
||||
{
|
||||
usbh_control_xfer_subtask_ExpectWithArrayAndReturn(
|
||||
dev_addr, 0x21, SEND_ENCAPSULATED_COMMAND, 0, p_comm_interface->bInterfaceNumber,
|
||||
sizeof(rndis_msg_initialize_t), (uint8_t*)&msg_init, sizeof(rndis_msg_initialize_t), TUSB_ERROR_OSAL_TIMEOUT);
|
||||
|
||||
tusbh_cdc_mounted_cb_Expect(dev_addr);
|
||||
|
||||
//------------- Code Under Test -------------//
|
||||
TEST_ASSERT_EQUAL( TUSB_ERROR_NONE, cdch_open_subtask(dev_addr, p_comm_interface, &length) );
|
||||
}
|
||||
|
||||
void test_rndis_send_initalize_ok(void)
|
||||
{
|
||||
usbh_control_xfer_subtask_ExpectWithArrayAndReturn(
|
||||
dev_addr, 0x21, SEND_ENCAPSULATED_COMMAND, 0, p_comm_interface->bInterfaceNumber,
|
||||
sizeof(rndis_msg_initialize_t), (uint8_t*)&msg_init, sizeof(rndis_msg_initialize_t), TUSB_ERROR_OSAL_TIMEOUT);
|
||||
sizeof(rndis_msg_initialize_t), (uint8_t*)&msg_init, sizeof(rndis_msg_initialize_t), TUSB_ERROR_NONE);
|
||||
|
||||
|
||||
tusbh_cdc_rndis_mounted_cb_Expect(dev_addr);
|
||||
|
@ -204,8 +204,8 @@ tusb_error_t cdch_open_subtask(uint8_t dev_addr, tusb_descriptor_interface_t con
|
||||
{
|
||||
OSAL_SUBTASK_INVOKED_AND_WAIT( rndish_open_subtask(dev_addr, p_cdc), error );
|
||||
}
|
||||
else
|
||||
// if ( TUSB_ERROR_NONE != error ) // device is not an rndis
|
||||
|
||||
if ( !(0xff == p_cdc->interface_protocol && TUSB_ERROR_NONE == error) ) // device is not an rndis
|
||||
#endif
|
||||
|
||||
// FIXME mounted class flag is not set yet
|
||||
|
@ -116,6 +116,11 @@ tusb_error_t rndish_open_subtask(uint8_t dev_addr, cdch_data_t *p_cdc)
|
||||
error
|
||||
);
|
||||
|
||||
if ( TUSB_ERROR_NONE != error)
|
||||
{
|
||||
SUBTASK_EXIT(error);
|
||||
}
|
||||
|
||||
if ( tusbh_cdc_rndis_mounted_cb )
|
||||
{
|
||||
tusbh_cdc_rndis_mounted_cb(dev_addr);
|
||||
|
Loading…
x
Reference in New Issue
Block a user