From 50d343bb31ce66bb717476b9a183932d06179004 Mon Sep 17 00:00:00 2001 From: Jacob Rosenthal Date: Mon, 27 Apr 2015 12:06:01 -0700 Subject: [PATCH] add timestamp to PHY_DataInd_t and copy it to NwkFrame_t and NWK_DataInd_t --- src/lwm/nwk/nwkFrame.h | 1 + src/lwm/nwk/nwkRx.c | 2 ++ src/lwm/nwk/nwkRx.h | 1 + 3 files changed, 4 insertions(+) diff --git a/src/lwm/nwk/nwkFrame.h b/src/lwm/nwk/nwkFrame.h index 80623d3..9e5930f 100644 --- a/src/lwm/nwk/nwkFrame.h +++ b/src/lwm/nwk/nwkFrame.h @@ -111,6 +111,7 @@ typedef struct NwkFrame_t { uint8_t lqi; int8_t rssi; + uint32_t timestamp; } rx; struct diff --git a/src/lwm/nwk/nwkRx.c b/src/lwm/nwk/nwkRx.c index 10a221e..71c2ca8 100644 --- a/src/lwm/nwk/nwkRx.c +++ b/src/lwm/nwk/nwkRx.c @@ -124,6 +124,7 @@ void PHY_DataInd(PHY_DataInd_t *ind) if (NULL == (frame = nwkFrameAlloc())) return; + frame->rx.timestamp = ind->timestamp; frame->state = NWK_RX_STATE_RECEIVED; frame->size = ind->size; frame->rx.lqi = ind->lqi; @@ -428,6 +429,7 @@ static bool nwkRxIndicateFrame(NwkFrame_t *frame) if (NULL == nwkIb.endpoint[header->nwkDstEndpoint]) return false; + ind.timestamp = frame->rx.timestamp; ind.srcAddr = header->nwkSrcAddr; ind.dstAddr = header->nwkDstAddr; ind.srcEndpoint = header->nwkSrcEndpoint; diff --git a/src/lwm/nwk/nwkRx.h b/src/lwm/nwk/nwkRx.h index e242acd..cf50d63 100644 --- a/src/lwm/nwk/nwkRx.h +++ b/src/lwm/nwk/nwkRx.h @@ -78,6 +78,7 @@ typedef struct NWK_DataInd_t uint8_t size; uint8_t lqi; int8_t rssi; + uint32_t timestamp; } NWK_DataInd_t; /*- Prototypes -------------------------------------------------------------*/