Browse Source

Update v1.3

master
Evangelos Oulis 5 years ago
parent
commit
9d597f3b90
  1. 3
      gatewayNode/parking.py
  2. BIN
      serverNode/__pycache__/serv.cpython-37.pyc
  3. 2
      serverNode/serv.py

3
gatewayNode/parking.py

@ -46,6 +46,7 @@ if json_data != "" and json_data != None:
try:
# Check if node is Authenticated. "cookie
if data['cookie'] != None:
cookie = data['cookie']
while 1:
# For a while we request to get Parking Status
# witch is a JSON object like [{"no": 1, "status": false}, {"no": 2, "status": true}, ..., {"no": n, "status": true}]
@ -63,7 +64,7 @@ if json_data != "" and json_data != None:
if parkingStatus != prev_status:
# If parking status changed from previous status
# server would informed about this change.
data = """{"no":""" + parkingCode + ""","status":""" + parkingStatus + """}"""
data = """{"no":""" + parkingCode + ""","status":""" + parkingStatus + """, "cookie": \"""" + cookie + """\"}"""
r = s.post(url = API_ENDPOINT, data = data)
# IO : node prints to output the current

BIN
serverNode/__pycache__/serv.cpython-37.pyc

Binary file not shown.

2
serverNode/serv.py

@ -169,7 +169,7 @@ class Authenticate(Resource):
sessions.append(session_key)
return session, 200
else:
return "Not Authenticatiove device", 403
return "Not Authenticative device", 403
else:
return "Error authentication", 403
except (mysql.connector.errors.DatabaseError, mysql.connector.errors.InterfaceError) as e:

Loading…
Cancel
Save