-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add LQI/RSSI information to ApsFrame
Signed-off-by: Chris Jackson <[email protected]>
- Loading branch information
Showing
9 changed files
with
228 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
...artsystems.zigbee/src/main/java/com/zsmartsystems/zigbee/ZigBeeLinkQualityStatistics.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** | ||
* Copyright (c) 2016-2020 by the respective copyright holders. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
*/ | ||
package com.zsmartsystems.zigbee; | ||
|
||
/** | ||
* An interface that allows clients to retrieve link quality information available from a node | ||
* | ||
* @author Chris Jackson | ||
* | ||
*/ | ||
public interface ZigBeeLinkQualityStatistics { | ||
/** | ||
* Returns the LQI value from the last recieved packet | ||
* | ||
* @return the last received LQI value | ||
*/ | ||
public Integer getLastReceivedLqi(); | ||
|
||
/** | ||
* Returns the RSSI value from the last recieved packet | ||
* | ||
* @return the last received RSSI value in dBm | ||
*/ | ||
public Integer getLastReceivedRssi(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
....zigbee/src/main/java/com/zsmartsystems/zigbee/internal/ZigBeeNodeLinkQualityHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/** | ||
* Copyright (c) 2016-2020 by the respective copyright holders. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
*/ | ||
package com.zsmartsystems.zigbee.internal; | ||
|
||
import com.zsmartsystems.zigbee.ZigBeeLinkQualityStatistics; | ||
|
||
/** | ||
* Handler to record and manage link quality information for a node | ||
* | ||
* @author Chris Jackson | ||
* | ||
*/ | ||
public class ZigBeeNodeLinkQualityHandler implements ZigBeeLinkQualityStatistics { | ||
Integer lastRssi; | ||
Integer lastLqi; | ||
|
||
/** | ||
* Updates the Link Quality Indicator value with the value from the latest received packet | ||
* | ||
* @param lqi the last received LQI value | ||
*/ | ||
public void updateReceivedLqi(Integer lqi) { | ||
if (lqi == null) { | ||
return; | ||
} | ||
lastLqi = lqi; | ||
} | ||
|
||
/** | ||
* Updates the Received Signal Strength Indicator value with the value from the latest received packet | ||
* | ||
* @param rssi the last received RSSI value in dBm | ||
*/ | ||
public void updateReceivedRssi(Integer rssi) { | ||
if (rssi == null) { | ||
return; | ||
} | ||
lastRssi = rssi; | ||
} | ||
|
||
@Override | ||
public Integer getLastReceivedLqi() { | ||
return lastLqi; | ||
} | ||
|
||
@Override | ||
public Integer getLastReceivedRssi() { | ||
return lastRssi; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.