@@ -51,7 +51,6 @@ struct pdu_data_llctrl_conn_update_ind conn_update_ind = { .win_size = 1U,
51
51
.timeout = TIMEOUT ,
52
52
.instant = 6U };
53
53
54
- #if defined(CONFIG_BT_CTLR_CONN_PARAM_REQ )
55
54
/* Default conn_param_req PDU */
56
55
struct pdu_data_llctrl_conn_param_req conn_param_req = { .interval_min = INTVL_MIN ,
57
56
.interval_max = INTVL_MAX ,
@@ -66,6 +65,7 @@ struct pdu_data_llctrl_conn_param_req conn_param_req = { .interval_min = INTVL_M
66
65
.offset4 = 0xffffU ,
67
66
.offset5 = 0xffffU };
68
67
68
+ #if defined(CONFIG_BT_CTLR_CONN_PARAM_REQ )
69
69
/* Default conn_param_rsp PDU */
70
70
struct pdu_data_llctrl_conn_param_rsp conn_param_rsp = { .interval_min = INTVL_MIN ,
71
71
.interval_max = INTVL_MAX ,
@@ -1276,28 +1276,6 @@ void test_conn_update_central_rem_reject(void)
1276
1276
"Free CTX buffers %d" , ctx_buffers_free ());
1277
1277
}
1278
1278
1279
- /* Peripheral-initiated Connection Parameters Request procedure.
1280
- * Peripheral requests change in LE connection parameters, central’s Controller do not
1281
- * support Connection Parameters Request procedure.
1282
- *
1283
- * +-----+ +-------+ +-----+
1284
- * | UT | | LL_C | | LT |
1285
- * +-----+ +-------+ +-----+
1286
- * | | |
1287
- * | | LL_CONNECTION_PARAM_REQ |
1288
- * | |<--------------------------|
1289
- * | | |
1290
- * | | LL_UNKNOWN_RSP |
1291
- * | |-------------------------->|
1292
- * | | |
1293
- */
1294
- void test_conn_update_central_rem_unsupp_feat (void )
1295
- {
1296
- /* TODO(thoh): Implement when Remote Request machine has feature
1297
- * checking
1298
- */
1299
- }
1300
-
1301
1279
/*
1302
1280
* (A)
1303
1281
* Peripheral-initiated Connection Parameters Request procedure.
@@ -2525,29 +2503,6 @@ void test_conn_update_periph_rem_reject(void)
2525
2503
"Free CTX buffers %d" , ctx_buffers_free ());
2526
2504
}
2527
2505
2528
- /*
2529
- * Central-initiated Connection Parameters Request procedure.
2530
- * Central requests change in LE connection parameters, peripheral’s Controller do not
2531
- * support Connection Parameters Request procedure.
2532
- *
2533
- * +-----+ +-------+ +-----+
2534
- * | UT | | LL_P | | LT |
2535
- * +-----+ +-------+ +-----+
2536
- * | | |
2537
- * | | LL_CONNECTION_PARAM_REQ |
2538
- * | |<--------------------------|
2539
- * | | |
2540
- * | | LL_UNKNOWN_RSP |
2541
- * | |-------------------------->|
2542
- * | | |
2543
- */
2544
- void test_conn_update_periph_rem_unsupp_feat (void )
2545
- {
2546
- /* TODO(thoh): Implement when Remote Request machine has feature
2547
- * checking
2548
- */
2549
- }
2550
-
2551
2506
/*
2552
2507
* (A)
2553
2508
* Central-initiated Connection Parameters Request procedure.
@@ -2890,7 +2845,7 @@ void test_conn_update_central_loc_accept_no_param_req(void)
2890
2845
2891
2846
/*
2892
2847
* Parameter Request Procedure not supported.
2893
- * Peripheral-initiated Connection Update procedure.
2848
+ * Peripheral-initiated Connection Update/Connection Parameter Request procedure
2894
2849
* Central receives Connection Update parameters.
2895
2850
*
2896
2851
* +-----+ +-------+ +-----+
@@ -2904,8 +2859,15 @@ void test_conn_update_central_loc_accept_no_param_req(void)
2904
2859
* | |-------------------------->|
2905
2860
* | | |
2906
2861
* | | |
2862
+ * | | LL_CONNECTION_PARAM_REQ |
2863
+ * | |<--------------------------|
2864
+ * | | |
2865
+ * | | LL_UNKNOWN_RSP |
2866
+ * | |-------------------------->|
2867
+ * | | |
2868
+ * | | |
2907
2869
*/
2908
- void test_conn_update_central_rem_accept_no_param_req (void )
2870
+ void test_conn_update_central_rem_unknown_no_param_req (void )
2909
2871
{
2910
2872
struct node_tx * tx ;
2911
2873
@@ -2943,6 +2905,93 @@ void test_conn_update_central_rem_accept_no_param_req(void)
2943
2905
2944
2906
zassert_equal (ctx_buffers_free (), test_ctx_buffers_cnt (),
2945
2907
"Free CTX buffers %d" , ctx_buffers_free ());
2908
+
2909
+ /* Check UNKNOWN_RSP on Connection Parameter Request */
2910
+ unknown_rsp .type = PDU_DATA_LLCTRL_TYPE_CONN_PARAM_REQ ;
2911
+ /* Prepare */
2912
+ event_prepare (& conn );
2913
+
2914
+ /* Rx */
2915
+ lt_tx (LL_CONNECTION_PARAM_REQ , & conn , & conn_param_req );
2916
+
2917
+ /* Done */
2918
+ event_done (& conn );
2919
+
2920
+ /* Prepare */
2921
+ event_prepare (& conn );
2922
+
2923
+ /* Tx Queue should have one LL Control PDU */
2924
+ lt_rx (LL_UNKNOWN_RSP , & conn , & tx , & unknown_rsp );
2925
+ lt_rx_q_is_empty (& conn );
2926
+
2927
+ /* Done */
2928
+ event_done (& conn );
2929
+
2930
+ /* There should NOT be a host notification */
2931
+ ut_rx_q_is_empty ();
2932
+
2933
+ zassert_equal (ctx_buffers_free (), test_ctx_buffers_cnt (),
2934
+ "Free CTX buffers %d" , ctx_buffers_free ());
2935
+
2936
+ }
2937
+
2938
+ /*
2939
+ * Parameter Request Procedure not supported.
2940
+ * Peripheral-initiated Connection Update/Connection Parameter Request procedure
2941
+ * Central receives Connection Update parameters.
2942
+ *
2943
+ * +-----+ +-------+ +-----+
2944
+ * | UT | | LL_M | | LT |
2945
+ * +-----+ +-------+ +-----+
2946
+ * | | |
2947
+ * | | |
2948
+ * | | LL_CONNECTION_PARAM_REQ |
2949
+ * | |<--------------------------|
2950
+ * | | |
2951
+ * | | LL_UNKNOWN_RSP |
2952
+ * | |-------------------------->|
2953
+ * | | |
2954
+ * | | |
2955
+ */
2956
+ void test_conn_update_periph_rem_unknown_no_param_req (void )
2957
+ {
2958
+ struct node_tx * tx ;
2959
+
2960
+ struct pdu_data_llctrl_unknown_rsp unknown_rsp = {
2961
+ .type = PDU_DATA_LLCTRL_TYPE_CONN_PARAM_REQ
2962
+ };
2963
+
2964
+ /* Role */
2965
+ test_set_role (& conn , BT_HCI_ROLE_PERIPHERAL );
2966
+
2967
+ /* Connect */
2968
+ ull_cp_state_set (& conn , ULL_CP_CONNECTED );
2969
+
2970
+ /* Prepare */
2971
+ event_prepare (& conn );
2972
+
2973
+ /* Rx */
2974
+ lt_tx (LL_CONNECTION_PARAM_REQ , & conn , & conn_param_req );
2975
+
2976
+ /* Done */
2977
+ event_done (& conn );
2978
+
2979
+ /* Prepare */
2980
+ event_prepare (& conn );
2981
+
2982
+ /* Tx Queue should have one LL Control PDU */
2983
+ lt_rx (LL_UNKNOWN_RSP , & conn , & tx , & unknown_rsp );
2984
+ lt_rx_q_is_empty (& conn );
2985
+
2986
+ /* Done */
2987
+ event_done (& conn );
2988
+
2989
+ /* There should NOT be a host notification */
2990
+ ut_rx_q_is_empty ();
2991
+
2992
+ zassert_equal (ctx_buffers_free (), test_ctx_buffers_cnt (),
2993
+ "Free CTX buffers %d" , ctx_buffers_free ());
2994
+
2946
2995
}
2947
2996
2948
2997
/*
@@ -3110,8 +3159,6 @@ void test_main(void)
3110
3159
setup , unit_test_noop ),
3111
3160
ztest_unit_test_setup_teardown (test_conn_update_central_rem_reject ,
3112
3161
setup , unit_test_noop ),
3113
- ztest_unit_test_setup_teardown (test_conn_update_central_rem_unsupp_feat ,
3114
- setup , unit_test_noop ),
3115
3162
ztest_unit_test_setup_teardown (test_conn_update_central_rem_collision ,
3116
3163
setup , unit_test_noop ));
3117
3164
@@ -3137,8 +3184,6 @@ void test_main(void)
3137
3184
setup , unit_test_noop ),
3138
3185
ztest_unit_test_setup_teardown (test_conn_update_periph_rem_reject ,
3139
3186
setup , unit_test_noop ),
3140
- ztest_unit_test_setup_teardown (test_conn_update_periph_rem_unsupp_feat ,
3141
- setup , unit_test_noop ),
3142
3187
ztest_unit_test_setup_teardown (test_conn_update_periph_rem_collision ,
3143
3188
setup , unit_test_noop ));
3144
3189
@@ -3154,16 +3199,20 @@ void test_main(void)
3154
3199
setup , unit_test_noop ));
3155
3200
3156
3201
ztest_test_suite (central_rem_no_param_req , ztest_unit_test_setup_teardown (
3157
- test_conn_update_central_rem_accept_no_param_req ,
3202
+ test_conn_update_central_rem_unknown_no_param_req ,
3158
3203
setup , unit_test_noop ));
3159
3204
3160
3205
ztest_test_suite (
3161
3206
periph_loc_no_param_req ,
3162
3207
ztest_unit_test_setup_teardown (test_conn_update_periph_loc_disallowed_no_param_req ,
3163
3208
setup , unit_test_noop ));
3164
3209
3165
- ztest_test_suite (periph_rem_no_param_req , ztest_unit_test_setup_teardown (
3210
+ ztest_test_suite (periph_rem_no_param_req ,
3211
+ ztest_unit_test_setup_teardown (
3166
3212
test_conn_update_periph_rem_accept_no_param_req ,
3213
+ setup , unit_test_noop ),
3214
+ ztest_unit_test_setup_teardown (
3215
+ test_conn_update_periph_rem_unknown_no_param_req ,
3167
3216
setup , unit_test_noop ));
3168
3217
3169
3218
ztest_run_test_suite (central_loc_no_param_req );
0 commit comments