From 62ff41db2e63dd116ae5398fb99b84ff00400dd3 Mon Sep 17 00:00:00 2001 From: Florent Duchon Date: Tue, 24 Apr 2012 19:22:50 +0200 Subject: digital/beacon: add network LQI & RSSI request functions --- digital/beacon/src/network.c | 20 ++++++++++++++++++++ digital/beacon/src/network.h | 8 ++++++++ 2 files changed, 28 insertions(+) diff --git a/digital/beacon/src/network.c b/digital/beacon/src/network.c index 0b8785c1..4721dbf0 100644 --- a/digital/beacon/src/network.c +++ b/digital/beacon/src/network.c @@ -273,7 +273,27 @@ void ZDO_UnbindIndication(ZDO_UnbindInd_t *unbindInd) (void)unbindInd; } +/* This function returns the LQI of the joined network */ +uint8_t network_get_lqi(void) +{ + ZDO_GetLqiRssi_t lqiRssi; + + lqiRssi.nodeAddr = 0; + ZDO_GetLqiRssi(&lqiRssi); + + return lqiRssi.lqi; +} +/* This function returns the RSSI of the joined network */ +int8_t network_get_rssi(void) +{ + ZDO_GetLqiRssi_t lqiRssi; + + lqiRssi.nodeAddr = 0; + ZDO_GetLqiRssi(&lqiRssi); + + return lqiRssi.rssi; +} \ No newline at end of file diff --git a/digital/beacon/src/network.h b/digital/beacon/src/network.h index 004434f0..10673c25 100644 --- a/digital/beacon/src/network.h +++ b/digital/beacon/src/network.h @@ -74,6 +74,14 @@ void network_leave(void); /* Leave network response */ void zdpLeaveResp(ZDO_ZdpResp_t *zdpResp); +/* This function returns the LQI of the joined network */ +uint8_t network_get_lqi(void); + +/* This function returns the RSSI of the joined network */ +int8_t network_get_rssi(void); + + + #endif // ifndef _NETWORK_H // eof network.h -- cgit v1.2.3