@@ -2317,4 +2317,142 @@ mod get_log_page {
23172317 . await
23182318 } ) ;
23192319 }
2320+
2321+ #[ test]
2322+ fn feature_identifiers_supported_and_effects_short ( ) {
2323+ setup ( ) ;
2324+
2325+ let ( mut mep, mut subsys) = new_device ( DeviceType :: P1p1tC1aN0a0a ) ;
2326+
2327+ #[ rustfmt:: skip]
2328+ const REQ : [ u8 ; 67 ] = [
2329+ 0x10 , 0x00 , 0x00 ,
2330+ 0x02 , 0x00 , 0x00 , 0x00 ,
2331+
2332+ // SQE DWORD 1
2333+ 0x00 , 0x00 , 0x00 , 0x00 ,
2334+ 0x00 , 0x00 , 0x00 , 0x00 ,
2335+ 0x00 , 0x00 , 0x00 , 0x00 ,
2336+ 0x00 , 0x00 , 0x00 , 0x00 ,
2337+ 0x00 , 0x00 , 0x00 , 0x00 ,
2338+
2339+ // DOFST
2340+ 0x00 , 0x00 , 0x00 , 0x00 ,
2341+ 0x00 , 0x04 , 0x00 , 0x00 ,
2342+
2343+ // Reserved
2344+ 0x00 , 0x00 , 0x00 , 0x00 ,
2345+ 0x00 , 0x00 , 0x00 , 0x00 ,
2346+
2347+ // SQE DWORD 10
2348+ 0x12 , 0x00 , 0xff , 0x00 ,
2349+ 0x00 , 0x00 , 0x00 , 0x00 ,
2350+ 0x00 , 0x00 , 0x00 , 0x00 ,
2351+ 0x00 , 0x00 , 0x00 , 0x00 ,
2352+ 0x00 , 0x00 , 0x00 , 0x00 ,
2353+ // Missing SQE DWORD 15
2354+
2355+ // MIC
2356+ 0xfa , 0x21 , 0x62 , 0x5f
2357+ ] ;
2358+
2359+ let resp = ExpectedRespChannel :: new ( & RESP_INVALID_COMMAND_SIZE ) ;
2360+ smol:: block_on ( async {
2361+ mep. handle_async ( & mut subsys, & REQ , MsgIC ( true ) , resp, async |_| Ok ( ( ) ) )
2362+ . await
2363+ } ) ;
2364+ }
2365+
2366+ #[ test]
2367+ fn feature_identifiers_supported_and_effects_long ( ) {
2368+ setup ( ) ;
2369+
2370+ let ( mut mep, mut subsys) = new_device ( DeviceType :: P1p1tC1aN0a0a ) ;
2371+
2372+ #[ rustfmt:: skip]
2373+ const REQ : [ u8 ; 75 ] = [
2374+ 0x10 , 0x00 , 0x00 ,
2375+ 0x02 , 0x00 , 0x00 , 0x00 ,
2376+
2377+ // SQE DWORD 1
2378+ 0x00 , 0x00 , 0x00 , 0x00 ,
2379+ 0x00 , 0x00 , 0x00 , 0x00 ,
2380+ 0x00 , 0x00 , 0x00 , 0x00 ,
2381+ 0x00 , 0x00 , 0x00 , 0x00 ,
2382+ 0x00 , 0x00 , 0x00 , 0x00 ,
2383+
2384+ // DOFST
2385+ 0x00 , 0x00 , 0x00 , 0x00 ,
2386+ 0x00 , 0x04 , 0x00 , 0x00 ,
2387+
2388+ // Reserved
2389+ 0x00 , 0x00 , 0x00 , 0x00 ,
2390+ 0x00 , 0x00 , 0x00 , 0x00 ,
2391+
2392+ // SQE DWORD 10
2393+ 0x12 , 0x00 , 0xff , 0x00 ,
2394+ 0x00 , 0x00 , 0x00 , 0x00 ,
2395+ 0x00 , 0x00 , 0x00 , 0x00 ,
2396+ 0x00 , 0x00 , 0x00 , 0x00 ,
2397+ 0x00 , 0x00 , 0x00 , 0x00 ,
2398+ 0x00 , 0x00 , 0x00 , 0x00 ,
2399+ 0x00 , 0x00 , 0x00 , 0x00 ,
2400+
2401+ // MIC
2402+ 0x1d , 0x31 , 0x5a , 0x2b
2403+ ] ;
2404+
2405+ let resp = ExpectedRespChannel :: new ( & RESP_INVALID_COMMAND_SIZE ) ;
2406+ smol:: block_on ( async {
2407+ mep. handle_async ( & mut subsys, & REQ , MsgIC ( true ) , resp, async |_| Ok ( ( ) ) )
2408+ . await
2409+ } ) ;
2410+ }
2411+
2412+ #[ test]
2413+ fn feature_identifiers_supported_and_effects ( ) {
2414+ setup ( ) ;
2415+
2416+ let ( mut mep, mut subsys) = new_device ( DeviceType :: P1p1tC1aN0a0a ) ;
2417+
2418+ #[ rustfmt:: skip]
2419+ const REQ : [ u8 ; 71 ] = [
2420+ 0x10 , 0x00 , 0x00 ,
2421+ 0x02 , 0x00 , 0x00 , 0x00 ,
2422+
2423+ // SQE DWORD 1
2424+ 0x00 , 0x00 , 0x00 , 0x00 ,
2425+ 0x00 , 0x00 , 0x00 , 0x00 ,
2426+ 0x00 , 0x00 , 0x00 , 0x00 ,
2427+ 0x00 , 0x00 , 0x00 , 0x00 ,
2428+ 0x00 , 0x00 , 0x00 , 0x00 ,
2429+
2430+ // DOFST
2431+ 0x00 , 0x00 , 0x00 , 0x00 ,
2432+ 0x00 , 0x04 , 0x00 , 0x00 ,
2433+
2434+ // Reserved
2435+ 0x00 , 0x00 , 0x00 , 0x00 ,
2436+ 0x00 , 0x00 , 0x00 , 0x00 ,
2437+
2438+ // SQE DWORD 10
2439+ 0x12 , 0x00 , 0xff , 0x00 ,
2440+ 0x00 , 0x00 , 0x00 , 0x00 ,
2441+ 0x00 , 0x00 , 0x00 , 0x00 ,
2442+ 0x00 , 0x00 , 0x00 , 0x00 ,
2443+ 0x00 , 0x00 , 0x00 , 0x00 ,
2444+ 0x00 , 0x00 , 0x00 , 0x00 ,
2445+
2446+ // MIC
2447+ 0xbb , 0xa2 , 0xe9 , 0x2a
2448+ ] ;
2449+
2450+ let resp_fields: Vec < ExpectedField > = vec ! [ ( 0 , & [ 0x90 ] ) , ( 15 , & [ 0x00 , 0x00 , 0x01 , 0x00 ] ) ] ;
2451+
2452+ let resp = RelaxedRespChannel :: new ( resp_fields) ;
2453+ smol:: block_on ( async {
2454+ mep. handle_async ( & mut subsys, & REQ , MsgIC ( true ) , resp, async |_| Ok ( ( ) ) )
2455+ . await
2456+ } ) ;
2457+ }
23202458}
0 commit comments