GithubHelp home page GithubHelp logo

Handle bootloader connection issue about muse-js HOT 5 OPEN

urish avatar urish commented on July 29, 2024
Handle bootloader connection issue

from muse-js.

Comments (5)

urish avatar urish commented on July 29, 2024

Thanks! PR?

from muse-js.

jdpigeon avatar jdpigeon commented on July 29, 2024

Can confirm that client.sendCommand("*1") kicks the headband out of bootloader and into headset mode.

Will make a PR sometime this week. Do you agree with the addition of a deviceInfo check to the connect function?

from muse-js.

urish avatar urish commented on July 29, 2024

Awesome. Yes, sound good - this should be transparent for the user.

deviceInfo is using async/await, which is a new feature in JavaScript which add syntactic sugar on top of promises:

    async deviceInfo() {
        const resultListener = this.controlResponses.pipe(filter((r) => !!r.fw), take(1)).toPromise();
        await this.sendCommand('v1');
        return resultListener as Promise<MuseDeviceInfo>;
    }

This is equivalent to writing:

    deviceInfo() {
        const resultListener = this.controlResponses.pipe(filter((r) => !!r.fw), take(1)).toPromise();
        return this.sendCommand('v1').then(() => {
            return resultListener as Promise<MuseDeviceInfo>;
        });
    }

from muse-js.

jdpigeon avatar jdpigeon commented on July 29, 2024

Ah thanks man, I'll get on it.

Turned out I just forgot to execute it. deviceInfo sounds like a property to me, not a function. Maybe I should rename it to getDeviceInfo?

from muse-js.

urish avatar urish commented on July 29, 2024

Perhaps it'd make more sense, but that would also break the API. I'd rather keep it this way...

from muse-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.