summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRefik Hadzialic2011-07-25 10:25:52 +0200
committerRefik Hadzialic2011-07-25 10:25:52 +0200
commitde1fbe0223c626c4d0074ac4493abdca51c4b190 (patch)
treed726a5a36a8185776a01198b4551095a9288afcc
parentdeleted some old files (diff)
downloadgsm-selftest-de1fbe0223c626c4d0074ac4493abdca51c4b190.tar.gz
gsm-selftest-de1fbe0223c626c4d0074ac4493abdca51c4b190.tar.xz
gsm-selftest-de1fbe0223c626c4d0074ac4493abdca51c4b190.zip
Tested the code, made some tiny changes to the code (not functional changes but that it looks better)
-rw-r--r--notFinishedCode/clientController.py20
-rw-r--r--notFinishedCode/serverHandler.py11
2 files changed, 16 insertions, 15 deletions
diff --git a/notFinishedCode/clientController.py b/notFinishedCode/clientController.py
index 61488c9..5265643 100644
--- a/notFinishedCode/clientController.py
+++ b/notFinishedCode/clientController.py
@@ -165,13 +165,13 @@ def other():
else:
return 5
-
-print 'I am here'
-if connectToHandlers() == 1:
- print 'connection initialized'
- if initTalk() == 1:
- receiveMessage(5,1)
- receiveMessage(5,1)
- receiveMessage(5,1)
- receiveMessage(5,1)
- lastState = 0
+while 1:
+ # print 'I am here'
+ if connectToHandlers() == 1:
+ print 'connection initialized'
+ if initTalk() == 1:
+ receiveMessage(5,1)
+ receiveMessage(5,1)
+ receiveMessage(5,1)
+ receiveMessage(5,1)
+ lastState = 0
diff --git a/notFinishedCode/serverHandler.py b/notFinishedCode/serverHandler.py
index f1183ee..a042e85 100644
--- a/notFinishedCode/serverHandler.py
+++ b/notFinishedCode/serverHandler.py
@@ -71,7 +71,6 @@ def initSystem():
def receiveMessage(timeout):
message = str(handlerSocket.receiveData(timeout))
-
print 'in receive message', message, lastState
if message == 'HELLO HANDLER' and lastState == 0:
@@ -129,6 +128,9 @@ def receiveMessage(timeout):
outcome = other()
logger.logEvent('other appeared')
+ return 1
+ return 0
+
########INIT TALK PART########
def initTalk():
print 'init talk'
@@ -236,10 +238,9 @@ while 1:
test = initSystem()
if test == 1:
print 'initialized system'
- receiveMessage(5)
- receiveMessage(5)
- receiveMessage(5)
- receiveMessage(5)
+ receivedMessage = 0
+ while receivedMessage < 4:
+ receivedMessage += receiveMessage(5)
del handlerSocket
del gsmDevice