@@ -224,19 +224,14 @@ lorawan_status_t LoRaWANStack::send_compliance_test_frame_to_mac()
224
224
{
225
225
loramac_mcps_req_t mcps_req;
226
226
227
- get_phy_params_t phy_params;
228
- phy_param_t default_datarate;
229
- phy_params.attribute = PHY_DEF_TX_DR;
230
- default_datarate = _lora_phy.get_phy_params (&phy_params);
231
-
232
227
prepare_special_tx_frame (_compliance_test.app_port );
233
228
234
229
if (!_compliance_test.is_tx_confirmed ) {
235
230
mcps_req.type = MCPS_UNCONFIRMED;
236
231
mcps_req.req .unconfirmed .fport = _compliance_test.app_port ;
237
232
mcps_req.f_buffer = _tx_msg.f_buffer ;
238
233
mcps_req.f_buffer_size = _tx_msg.f_buffer_size ;
239
- mcps_req.req .unconfirmed .data_rate = default_datarate. value ;
234
+ mcps_req.req .unconfirmed .data_rate = _lora_phy. get_default_tx_datarate () ;
240
235
241
236
tr_info (" Transmit unconfirmed compliance test frame %d bytes." , mcps_req.f_buffer_size );
242
237
@@ -249,7 +244,7 @@ lorawan_status_t LoRaWANStack::send_compliance_test_frame_to_mac()
249
244
mcps_req.f_buffer = _tx_msg.f_buffer ;
250
245
mcps_req.f_buffer_size = _tx_msg.f_buffer_size ;
251
246
mcps_req.req .confirmed .nb_trials = _num_retry;
252
- mcps_req.req .confirmed .data_rate = default_datarate. value ;
247
+ mcps_req.req .confirmed .data_rate = _lora_phy. get_default_tx_datarate () ;
253
248
254
249
tr_info (" Transmit confirmed compliance test frame %d bytes." , mcps_req.f_buffer_size );
255
250
@@ -286,11 +281,6 @@ lorawan_status_t LoRaWANStack::send_frame_to_mac()
286
281
lorawan_status_t status;
287
282
loramac_mib_req_confirm_t mib_get_params;
288
283
289
- get_phy_params_t phy_params;
290
- phy_param_t default_datarate;
291
- phy_params.attribute = PHY_DEF_TX_DR;
292
- default_datarate = _lora_phy.get_phy_params (&phy_params);
293
-
294
284
mcps_req.type = _tx_msg.type ;
295
285
296
286
if (MCPS_UNCONFIRMED == mcps_req.type ) {
@@ -302,7 +292,7 @@ lorawan_status_t LoRaWANStack::send_frame_to_mac()
302
292
mib_get_params.type = MIB_CHANNELS_DATARATE;
303
293
if (mib_get_request (&mib_get_params) != LORAWAN_STATUS_OK) {
304
294
tr_debug (" Couldn't get MIB parameters: Using default data rate" );
305
- mcps_req.req .unconfirmed .data_rate = default_datarate. value ;
295
+ mcps_req.req .unconfirmed .data_rate = _lora_phy. get_default_tx_datarate () ;
306
296
} else {
307
297
mcps_req.req .unconfirmed .data_rate = mib_get_params.param .channel_data_rate ;
308
298
}
@@ -316,7 +306,7 @@ lorawan_status_t LoRaWANStack::send_frame_to_mac()
316
306
mib_get_params.type = MIB_CHANNELS_DATARATE;
317
307
if (mib_get_request (&mib_get_params) != LORAWAN_STATUS_OK) {
318
308
tr_debug (" Couldn't get MIB parameters: Using default data rate" );
319
- mcps_req.req .confirmed .data_rate = default_datarate. value ;
309
+ mcps_req.req .confirmed .data_rate = _lora_phy. get_default_tx_datarate () ;
320
310
} else {
321
311
mcps_req.req .confirmed .data_rate = mib_get_params.param .channel_data_rate ;
322
312
}
@@ -328,7 +318,7 @@ lorawan_status_t LoRaWANStack::send_frame_to_mac()
328
318
mib_get_params.type = MIB_CHANNELS_DATARATE;
329
319
if (mib_get_request (&mib_get_params) != LORAWAN_STATUS_OK) {
330
320
tr_debug (" Couldn't get MIB parameters: Using default data rate" );
331
- mcps_req.req .proprietary .data_rate = default_datarate. value ;
321
+ mcps_req.req .proprietary .data_rate = _lora_phy. get_default_tx_datarate () ;
332
322
} else {
333
323
mcps_req.req .proprietary .data_rate = mib_get_params.param .channel_data_rate ;
334
324
}
0 commit comments