Skip to content

Commit 50aed3b

Browse files
committed
samples: peripheral: 802154_phy_test: Add API migration code
The transmit functions will return an error code, instead of a boolean value. To prepare for this, the API calls are temporarily implemented in two variants, for old and new API declarations. The presence of new API will be detected by the use of NRF_802154_TX_FUNCTIONS_RETURN_ERROR_CODE macro, which will be unconditionally defined by a newer nrf-802154 driver. Signed-off-by: Rafał Kuźnia <[email protected]>
1 parent 2eda5e7 commit 50aed3b

File tree

1 file changed

+4
-0
lines changed
  • samples/peripheral/802154_phy_test/src

1 file changed

+4
-0
lines changed

samples/peripheral/802154_phy_test/src/rf_proc.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,11 @@ bool ptt_rf_send_packet_ext(const uint8_t *pkt, ptt_pkt_len_t len, bool cca)
480480
.frame_props = NRF_802154_TRANSMITTED_FRAME_PROPS_DEFAULT_INIT,
481481
.cca = cca
482482
};
483+
#ifdef NRF_802154_TX_FUNCTIONS_RETURN_ERROR_CODE
484+
ret = nrf_802154_transmit_raw(temp_tx_pkt, &metadata) == NRF_802154_TX_ERROR_NONE;
485+
#else
483486
ret = nrf_802154_transmit_raw(temp_tx_pkt, &metadata);
487+
#endif
484488
}
485489

486490
return ret;

0 commit comments

Comments
 (0)