diff --git a/gatewayNode/parking.py b/gatewayNode/parking.py index 8a0f778..01d0c98 100644 --- a/gatewayNode/parking.py +++ b/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 diff --git a/serverNode/__pycache__/serv.cpython-37.pyc b/serverNode/__pycache__/serv.cpython-37.pyc index ccaa31c..04c4797 100644 Binary files a/serverNode/__pycache__/serv.cpython-37.pyc and b/serverNode/__pycache__/serv.cpython-37.pyc differ diff --git a/serverNode/serv.py b/serverNode/serv.py index 32057fe..f358075 100644 --- a/serverNode/serv.py +++ b/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: