INNER CODE UNIT · JavaScript

onQuit

ob-f/OpenBot · controller/web-server/client/index.js:31

    const onQuit = () => {
        connection.stop()
    }

    // roomId must match robot app Google account or the server will not relay.
    const sendToBot = (key) => {
        if (!signedInUser?.email) {
            console.error('Cannot send command: sign in with Google first (same account as robot app).')
            return
        }
        const msg = JSON.parse(key)
        const payload =
            msg.driveCmd !== undefined
                ? {driveCmd: msg.driveCmd, roomId: signedInUser.email}
                : {command: msg.command, roomId: signedInUser.email}
        connection.send(JSON.stringify(payload))
    }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…