@@ -254,6 +254,8 @@ static int nrf5_cca(const struct device *dev)
254
254
{
255
255
struct nrf5_802154_data * nrf5_radio = NRF5_802154_DATA (dev );
256
256
257
+ nrf_802154_channel_set (nrf5_data .channel );
258
+
257
259
if (!nrf_802154_cca ()) {
258
260
LOG_DBG ("CCA failed" );
259
261
return - EBUSY ;
@@ -279,7 +281,7 @@ static int nrf5_set_channel(const struct device *dev, uint16_t channel)
279
281
return channel < 11 ? - ENOTSUP : - EINVAL ;
280
282
}
281
283
282
- nrf_802154_channel_set ( channel ) ;
284
+ nrf5_data . channel = channel ;
283
285
284
286
return 0 ;
285
287
}
@@ -292,6 +294,8 @@ static int nrf5_energy_scan_start(const struct device *dev,
292
294
293
295
ARG_UNUSED (dev );
294
296
297
+ nrf_802154_channel_set (nrf5_data .channel );
298
+
295
299
if (nrf5_data .energy_scan_done == NULL ) {
296
300
nrf5_data .energy_scan_done = done_cb ;
297
301
@@ -457,6 +461,10 @@ static bool nrf5_tx_immediate(struct net_pkt *pkt, uint8_t *payload, bool cca)
457
461
.use_metadata_value = true,
458
462
.power = nrf5_data .txpwr ,
459
463
},
464
+ .tx_channel = {
465
+ .use_metadata_value = true,
466
+ .channel = nrf5_data .channel ,
467
+ },
460
468
};
461
469
462
470
return nrf_802154_transmit_raw (payload , & metadata );
@@ -474,6 +482,10 @@ static bool nrf5_tx_csma_ca(struct net_pkt *pkt, uint8_t *payload)
474
482
.use_metadata_value = true,
475
483
.power = nrf5_data .txpwr ,
476
484
},
485
+ .tx_channel = {
486
+ .use_metadata_value = true,
487
+ .channel = nrf5_data .channel ,
488
+ },
477
489
};
478
490
479
491
return nrf_802154_transmit_csma_ca_raw (payload , & metadata );
@@ -513,7 +525,7 @@ static bool nrf5_tx_at(struct nrf5_802154_data *nrf5_radio, struct net_pkt *pkt,
513
525
.dynamic_data_is_set = net_pkt_ieee802154_mac_hdr_rdy (pkt ),
514
526
},
515
527
.cca = cca ,
516
- .channel = nrf_802154_channel_get () ,
528
+ .channel = nrf5_data . channel ,
517
529
.tx_power = {
518
530
.use_metadata_value = true,
519
531
.power = nrf5_data .txpwr ,
@@ -655,6 +667,7 @@ static int nrf5_start(const struct device *dev)
655
667
ARG_UNUSED (dev );
656
668
657
669
nrf_802154_tx_power_set (nrf5_data .txpwr );
670
+ nrf_802154_channel_set (nrf5_data .channel );
658
671
659
672
if (!nrf_802154_receive ()) {
660
673
LOG_ERR ("Failed to enter receive state" );
@@ -699,6 +712,7 @@ static int nrf5_continuous_carrier(const struct device *dev)
699
712
ARG_UNUSED (dev );
700
713
701
714
nrf_802154_tx_power_set (nrf5_data .txpwr );
715
+ nrf_802154_channel_set (nrf5_data .channel );
702
716
703
717
if (!nrf_802154_continuous_carrier ()) {
704
718
LOG_ERR ("Failed to enter continuous carrier state" );
0 commit comments