Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS subscribe not work #346

Open
jinbaekho opened this issue Nov 29, 2024 · 0 comments
Open

macOS subscribe not work #346

jinbaekho opened this issue Nov 29, 2024 · 0 comments

Comments

@jinbaekho
Copy link

jinbaekho commented Nov 29, 2024

async function cubeNotify(characteristic) {
    console.log(`notifyID:${characteristic.uuid}`);

    await characteristic.subscribe((error) => {
        if (error) {
            console.error(`subscribe fail: ${error}`);
        } else {
            console.log('subscribe success');
        }
    });

    characteristic.on('data', (data) => {
        if (data.length === 0) {
            return;
        }
        console.log(data);
    });
}

This code works fine on Windows. It doesn't work on MacOS. The subscription success message is printed. But no data is received. What did I miss?. I need help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant