Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/lwm/nwk/nwkFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ typedef struct NwkFrame_t
{
uint8_t lqi;
int8_t rssi;
uint32_t timestamp;
} rx;

struct
Expand Down
2 changes: 2 additions & 0 deletions src/lwm/nwk/nwkRx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/lwm/nwk/nwkRx.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 -------------------------------------------------------------*/
Expand Down
5 changes: 5 additions & 0 deletions src/lwm/phy/phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,11 @@ void PHY_TaskHandler(void)
for (uint8_t i = 0; i < size + 1/*lqi*/; i++)
phyRxBuffer[i] = TRX_FRAME_BUFFER(i);

ind.timestamp = SCTSRLL;
ind.timestamp |= (uint32_t)SCTSRLH << 8;
ind.timestamp |= (uint32_t)SCTSRHL << 16;
ind.timestamp |= (uint32_t)SCTSRHH << 24;

ind.data = phyRxBuffer;
ind.size = size - PHY_CRC_SIZE;
ind.lqi = phyRxBuffer[size];
Expand Down
1 change: 1 addition & 0 deletions src/lwm/phy/phy.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ typedef struct PHY_DataInd_t
uint8_t size;
uint8_t lqi;
int8_t rssi;
uint32_t timestamp;
} PHY_DataInd_t;

enum
Expand Down