diff --git a/drivers/ieee802154/ieee802154_nrf5.c b/drivers/ieee802154/ieee802154_nrf5.c index f49b694f4e..6c2bd653b8 100644 --- a/drivers/ieee802154/ieee802154_nrf5.c +++ b/drivers/ieee802154/ieee802154_nrf5.c @@ -989,7 +989,8 @@ void nrf_802154_received_timestamp_raw(uint8_t *data, int8_t power, uint8_t lqi, nrf5_data.rx_frames[i].lqi = lqi; #if defined(CONFIG_NET_PKT_TIMESTAMP) - nrf5_data.rx_frames[i].time = nrf_802154_mhr_timestamp_get(time, data[0]); + nrf5_data.rx_frames[i].time = + nrf_802154_timestamp_end_to_phr_convert(time, data[0]); #endif if (data[ACK_REQUEST_BYTE] & ACK_REQUEST_BIT) { @@ -1084,9 +1085,8 @@ void nrf_802154_transmitted_raw(uint8_t *frame, nrf5_data.ack_frame.lqi = metadata->data.transmitted.lqi; #if defined(CONFIG_NET_PKT_TIMESTAMP) - nrf5_data.ack_frame.time = - nrf_802154_mhr_timestamp_get( - metadata->data.transmitted.time, nrf5_data.ack_frame.psdu[0]); + nrf5_data.ack_frame.time = nrf_802154_timestamp_end_to_phr_convert( + metadata->data.transmitted.time, nrf5_data.ack_frame.psdu[0]); #endif } diff --git a/modules/openthread/platform/radio.c b/modules/openthread/platform/radio.c index 6fd9bf737c..c96c3c31ad 100644 --- a/modules/openthread/platform/radio.c +++ b/modules/openthread/platform/radio.c @@ -41,7 +41,6 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME, CONFIG_OPENTHREAD_L2_LOG_LEVEL); #define SHORT_ADDRESS_SIZE 2 #define FCS_SIZE 2 -#define PHR_DURATION 32 #if defined(CONFIG_OPENTHREAD_THREAD_VERSION_1_1) #define ACK_PKT_LENGTH 5 #else @@ -189,7 +188,7 @@ enum net_verdict ieee802154_handle_ack(struct net_if *iface, struct net_pkt *pkt /* OpenThread expects the timestamp to point to the end of SFD */ ack_frame.mInfo.mRxInfo.mTimestamp = pkt_time->second * USEC_PER_SEC + - pkt_time->nanosecond / NSEC_PER_USEC - PHR_DURATION; + pkt_time->nanosecond / NSEC_PER_USEC; #endif return NET_OK; @@ -480,8 +479,8 @@ static void openthread_handle_received_frame(otInstance *instance, struct net_ptp_time *pkt_time = net_pkt_timestamp(pkt); /* OpenThread expects the timestamp to point to the end of SFD */ - recv_frame.mInfo.mRxInfo.mTimestamp = pkt_time->second * USEC_PER_SEC + - pkt_time->nanosecond / NSEC_PER_USEC - PHR_DURATION; + recv_frame.mInfo.mRxInfo.mTimestamp = + pkt_time->second * USEC_PER_SEC + pkt_time->nanosecond / NSEC_PER_USEC; #endif if (net_pkt_ieee802154_arb(pkt) && net_pkt_ieee802154_fv2015(pkt)) {