shizzle iets aangepast
authorcharlie <charlie@gerhardus.com>
Mon, 25 Jan 2016 12:51:01 +0000 (13:51 +0100)
committercharlie <charlie@gerhardus.com>
Mon, 25 Jan 2016 12:51:01 +0000 (13:51 +0100)
a4/tcp/adapter/listener.py
a4/tcp/run.sh

index d64503b..a6d8999 100644 (file)
@@ -20,6 +20,8 @@ if __name__ == "__main__":
     seqnr = 0
     response = ''
     data = ''
+    has_error=False
+    did_syn=False
     while True:
         print 'waiting for data'
         done = False
@@ -34,14 +36,25 @@ if __name__ == "__main__":
         print 'received: {}'.format(data)
         if data == 'RES':
             print 'resetting the SUT...'
-            #sender.sendReset()
+            sender.sendReset()
             sender = Sender(serverIP="127.0.0.1", networkInterface="lo", isLocal=True, serverPort=serverPort, waitTime=1, isVerbose=0)
             data = ''
+            has_error = False
+            did_syn = False
             continue
-        elif data == 'SYN':
+        elif has_error:
+               response = 'ERR'
+        elif data == 'SYN' and not did_syn:
             seqnr = 100
             print 'S: {}'.format(seqnr)
             response = sender.sendInput('S', seqnr, seqnr)
+            did_syn = True
+        elif not did_syn:
+               response = 'ERR'
+               has_error = True
+        elif data == 'SYN':
+               response = 'ERR'
+               has_error = True
         elif data == 'ACK':
             response = 'Timeout'
             if sender.lastSeqReceived != None:
index 645b4f8..cbda43f 100755 (executable)
@@ -1,3 +1,3 @@
 #!/bin/bash -x
 #java -cp ":lib/automata-parent.jar:lib/learnlib-parent.jar" learner.Main small
-java -cp ":lib/automata-parent.jar:lib/learnlib-parent.jar" learner.Main partial LStar rand
+java -cp ":lib/automata-parent.jar:lib/learnlib-parent.jar" learner.Main partial TTT wm