summaryrefslogtreecommitdiff
path: root/digital
diff options
context:
space:
mode:
authorFlorent Duchon2012-04-24 19:22:50 +0200
committerFlorent Duchon2012-05-04 00:06:28 +0200
commit62ff41db2e63dd116ae5398fb99b84ff00400dd3 (patch)
tree838c52bd4f409de20e14072081818a89abe5f0ac /digital
parent4be8616f91676c12cb015f18e4eb0c4101986f67 (diff)
digital/beacon: add network LQI & RSSI request functions
Diffstat (limited to 'digital')
-rw-r--r--digital/beacon/src/network.c20
-rw-r--r--digital/beacon/src/network.h8
2 files changed, 28 insertions, 0 deletions
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