allow to send commands to boat

This commit is contained in:
FReenen 2025-07-03 20:55:37 +02:00
parent da75d0a2a0
commit a2eb47bc59
2 changed files with 8 additions and 3 deletions

View File

@ -174,7 +174,10 @@
function getBoatLog(e) function getBoatLog(e)
{ {
alert("loggy log"); let cmd = prompt("enter command");
let boat = getDataFomEl(e.target);
console.log("send cmd", boat, cmd);
conn.send(passEl.value + ";sendcmd;" + boat['id'] + ";" + cmd);
} }
function reqBoats() function reqBoats()
@ -307,4 +310,4 @@
} }
</script> </script>
</body> </body>
</html> </html>

View File

@ -134,8 +134,10 @@ async def sendcmd(data):
if b['id'] == data[2]: if b['id'] == data[2]:
del data[0] del data[0]
del data[1] del data[1]
del data[2]
print(data)
data = ";".join(data) data = ";".join(data)
await sendToBoat(b, data) await sendToBoat(b, data + "\n")
return return
async def kick_client(clientId): async def kick_client(clientId):