Skip to content

Commit

Permalink
Add node information frame into saved node XML file
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Jackson <[email protected]>
  • Loading branch information
cdjackson committed Jan 2, 2016
1 parent 302c720 commit 8098264
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ public class ZWaveNode {
private boolean routing;
private String healState;

// Keep the NIF - just used for information and debug in the XML
@SuppressWarnings("unused")
private List<Integer> nodeInformationFrame = null;

private Map<CommandClass, ZWaveCommandClass> supportedCommandClasses = new HashMap<CommandClass, ZWaveCommandClass>();
private List<Integer> nodeNeighbors = new ArrayList<Integer>();
private Date lastSent = null;
Expand Down Expand Up @@ -821,4 +825,8 @@ public boolean getApplicationUpdateReceived() {
public void setApplicationUpdateReceived(boolean received) {
applicationUpdateReceived = received;
}

public void updateNIF(List<Integer> nif) {
nodeInformationFrame = nif;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
*/
package org.openhab.binding.zwave.internal.protocol.serialmessage;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.openhab.binding.zwave.internal.protocol.SerialMessage;
Expand Down Expand Up @@ -77,6 +79,8 @@ public boolean handleRequest(ZWaveController zController, SerialMessage lastSen
}
}
else {
List<Integer> nif = new ArrayList<Integer>();

for (int i = 6; i < length + 3; i++) {
int data = incomingMessage.getMessagePayloadByte(i);
if(data == 0xef) {
Expand All @@ -89,6 +93,8 @@ public boolean handleRequest(ZWaveController zController, SerialMessage lastSen
node.addCommandClass(commandClass);
}
}

node.updateNIF(nif);
}

// Notify we received an info frame
Expand Down

0 comments on commit 8098264

Please sign in to comment.