diff --git a/bindings.py b/bindings.py index 43b9440..ffa030c 100755 --- a/bindings.py +++ b/bindings.py @@ -28,7 +28,7 @@ def _SYS_EXIT(system,*args): sys.exit() -_VERBOSE=4 +_VERBOSE=3 nopeF=lambda *x:None def printl(label=""): @@ -167,6 +167,7 @@ _MATCHS={ "GCfra":"FREEZEALL", "GCfrl":"FREEZELAYER", "GCply":"DISPLAYLAYER", + "ISsva":"DETECTED", "E":"ERROR" } @@ -174,11 +175,11 @@ _ALL_MESSAGE_TYPES=[ "CONNECT","DEVICE","VERSION","STATUS","KPALIVE","LAYERINP", "TAKEAVL","TAKE","TAKEALL","LOADMM","QUICKFA","QUICKF", "SCRNUPD","FREEZE","FREEZEALL","FREEZELAYER","DISPLAYLAYER", - "ERROR" + "ERROR","DETECTED", ] _UPDATE_MSG=[ - "LAYERINP","QUICKFA","QUICKF","TAKE","QUICKFA","QUICKF","FREEZE","FREEZEALL","DISPLAYLAYER", + "LAYERINP","QUICKFA","QUICKF","TAKE","QUICKFA","QUICKF","FREEZE","FREEZEALL","DISPLAYLAYER","DETECTED", ] # RELOAD_PROGRAM # FREEZE_SCREEN @@ -227,6 +228,10 @@ class analogController(object): eprint('Hostname could not be resolved. Exiting') sys.exit() + def addFeedbackInterface(self,feedback): + "Add the feedback interface TODO: Several feedback interfaces ?" + self.feedback=feedback + def getAttr(self,attribute,default): "A custom attribute fetcher" try: @@ -332,6 +337,9 @@ class analogController(object): "Returns the layer,screen and status of the freeze" return True + def POSTMATCH_DETECTED(self,match): + "Return the status of the input" + return True # def POSTMATCH_TAKEAVL(self,match): # "Take available answer 1" # if match.group("postargs")[-1]=="1": diff --git a/falseserver.py b/falseserver.py index ce9da56..f580a64 100644 --- a/falseserver.py +++ b/falseserver.py @@ -37,7 +37,7 @@ def parrotanswers(s,addr,seq,delay=_DELAY): match=_MESSAGE_REGEX.match(recv.decode()) msg=match.group("msg")+match.group("preargs") print("[{}] Received : {} | Sending {}".format(addr[1],recv,msg)) - s.sendall(msg.encode()) + s.sendall((msg+"\r\n").encode()) except ConnectionResetError as e: print("[{}] Has stopped the connection".format(addr[1])) print(e) @@ -71,8 +71,8 @@ if __name__ == '__main__': ("*",["VEvar13","#0","VEvar13","*1"]), ("?",['DEV259']), ("VEvar",["VEvar13"]), #Guess - ("#3",["#4","PRinp0,1,7,8","PRinp0,1,1,8","#0"]), #Another guess + ("#3",["ISsva4,3,1","ISsva3,3,1","ISsva1,3,1","PRinp0,1,7,8","PRinp0,1,1,8","#0"]), #Another guess ("1SYpig",["SYpig4294967294"]) #Another guess ] - Main(0.5) + Main(0.05)