diff --git a/ground-station.py b/ground-station.py index 003adee..66b4122 100644 --- a/ground-station.py +++ b/ground-station.py @@ -59,11 +59,13 @@ async def echoClients(client): async def takeControll(client, boat): global boats + print("DEBUG: " + client['id'] " takes controll of " + boat) if (client['boat'] is not None): boat["state"] = BOAT_STATE_AVAILABLE client["boat"] = None for b in boats: if (b['id'] == boat): + print("DEBUG: boat found") if (boat['state'] == BOAT_STATE_AVAILABLE): boat["state"] = BOAT_STATE_INCTRL print("take controll: " + str(client["id"]) + " -> " + boat["name"]) @@ -72,6 +74,8 @@ async def takeControll(client, boat): else: print("WARN: takeControll: " + boat["name"] + " not available (" + str(client["id"]) + ")") break + else: + print("DEBUG: " boat " != " b['id']) async def freeBoat(boat): global boats, clients