summaryrefslogtreecommitdiffstats
path: root/For Weekly Test/30-07-2011/GSMHandler.py
diff options
context:
space:
mode:
Diffstat (limited to 'For Weekly Test/30-07-2011/GSMHandler.py')
-rw-r--r--For Weekly Test/30-07-2011/GSMHandler.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/For Weekly Test/30-07-2011/GSMHandler.py b/For Weekly Test/30-07-2011/GSMHandler.py
index c07f1ae..2ad46ae 100644
--- a/For Weekly Test/30-07-2011/GSMHandler.py
+++ b/For Weekly Test/30-07-2011/GSMHandler.py
@@ -75,11 +75,8 @@ def initSystem():
logger.logEvent('LISTEN ON PORT: '+str(portListen))
#add this if you need it
-<<<<<<< HEAD
gsmDevice = GSMClass.serialPort(portAddress, baudRate, 60)
-=======
- gsmDevice = GSMClass.serialPort(portAddress, baudRate, 30)
->>>>>>> f14064834f9947ddf184881e72ab50956f163a7b
+
initDevice = gsmDevice.portInit()
########################################################
@@ -93,9 +90,11 @@ def initSystem():
elif anyConnection == 1 and initDevice == 0:
logger.logEvent('$connection established but device not working: ' + str(handlerSocket.connectedTo()))
+ terminateConnection()
return 2
else:
logger.logEvent('$no connection')
+ sys.exit(1)
return 0
def receiveMessage(timeout):
@@ -159,6 +158,8 @@ def receiveMessage(timeout):
else:
outcome = other()
logger.logEvent('other appeared')
+ terminateConnection()
+
return 1
#return 0