@@ -6,16 +6,18 @@ use crate::class_prelude::*;
6
6
use crate :: device:: { UsbDevice , UsbDeviceBuilder , UsbVidPid } ;
7
7
use crate :: descriptor;
8
8
9
- #[ cfg( feature = "test-class-highspeed " ) ]
9
+ #[ cfg( feature = "test-class-high-speed " ) ]
10
10
mod sizes {
11
- pub const BUFFER : usize = 1024 ;
11
+ pub const BUFFER : usize = 2048 ;
12
+ pub const CONTROL_ENDPOINT : u8 = 64 ;
12
13
pub const BULK_ENDPOINT : u16 = 512 ;
13
14
pub const INTERRUPT_ENDPOINT : u16 = 1024 ;
14
15
}
15
16
16
- #[ cfg( not( feature = "test-class-highspeed " ) ) ]
17
+ #[ cfg( not( feature = "test-class-high-speed " ) ) ]
17
18
mod sizes {
18
19
pub const BUFFER : usize = 256 ;
20
+ pub const CONTROL_ENDPOINT : u8 = 8 ;
19
21
pub const BULK_ENDPOINT : u16 = 64 ;
20
22
pub const INTERRUPT_ENDPOINT : u16 = 31 ;
21
23
}
@@ -96,13 +98,16 @@ impl<B: UsbBus> TestClass<'_, B> {
96
98
/// - manufacturer
97
99
/// - product
98
100
/// - serial number
101
+ /// - max_packet_size_0
99
102
///
100
- /// on the returned builder. You should not change these values.
103
+ /// on the returned builder. If you change the manufacturer, product, or serial number fields,
104
+ /// the test host may misbehave.
101
105
pub fn make_device_builder < ' a , ' b > ( & ' a self , usb_bus : & ' b UsbBusAllocator < B > ) -> UsbDeviceBuilder < ' b , B > {
102
106
UsbDeviceBuilder :: new ( & usb_bus, UsbVidPid ( VID , PID ) )
103
107
. manufacturer ( MANUFACTURER )
104
108
. product ( PRODUCT )
105
109
. serial_number ( SERIAL_NUMBER )
110
+ . max_packet_size_0 ( sizes:: CONTROL_ENDPOINT )
106
111
}
107
112
108
113
/// Must be called after polling the UsbDevice.
0 commit comments