Add device name finder query
authorDaniel Schwyn <schwyda@student.ethz.ch>
Fri, 9 Jun 2017 15:35:19 +0000 (17:35 +0200)
committerDaniel Schwyn <schwyda@student.ethz.ch>
Tue, 13 Jun 2017 12:22:57 +0000 (14:22 +0200)
Signed-off-by: Daniel Schwyn <schwyda@student.ethz.ch>

usr/skb/programs/decodingNetQueries.pl

index 5c0777b..783ee17 100644 (file)
@@ -60,4 +60,9 @@ findSharedMemoryFrame(NodeId,DeviceId) :-
     net(SharedId,node(memory,_,_,_)),
     findRanges(NodeName,SharedName,NodeRange,SharedRange),
     findRanges(DevName,SharedName,DeviceRange,SharedRange),
-    printSharedRanges(NodeRange,SharedRange,DeviceRange).  
\ No newline at end of file
+    printSharedRanges(NodeRange,SharedRange,DeviceRange).
+
+findDeviceId(NodeId,Addr) :-
+    SrcName = name(NodeId,Addr),
+    resolve(SrcName,name(DeviceId,_)),
+    writeln(DeviceId).
\ No newline at end of file