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

Indicate Support for Linux #58

Closed
mikeholler opened this issue Aug 5, 2014 · 5 comments
Closed

Indicate Support for Linux #58

mikeholler opened this issue Aug 5, 2014 · 5 comments

Comments

@mikeholler
Copy link

I'm curious when support for the indicate property is scheduled for Linux. I have an application that requires this functionality so I was reading through the source code to see how to make it work. indicate is implemented on Mac already, and as far I can tell the following code block is all that was needed to make indicate work on OS X:

if (characteristic.properties.indexOf('indicate') !== -1) {
    if (characteristic.secure.indexOf('indicate') !== -1) {
        properties |= 0x200;
    } else {
        properties |= 0x20;
    }
}

When browsing through the Linux code, I found this block that looks very similar to the one above:

 if (characteristic.properties.indexOf('notify') !== -1) {
    properties |= 0x10;

    if (characteristic.secure.indexOf('notify') !== -1) {
        secure |= 0x10;
    }
}

If I added the following to l2cap-ble.js, is this all that is necessary to support Linux?

 if (characteristic.properties.indexOf('indicate') !== -1) {
    properties |= 0x200;

    if (characteristic.secure.indexOf('indicate') !== -1) {
        secure |= 0x20;
    }
}

And of course, there is always the possibility indicate support is already on the way. Does anybody know anything about this? I really could use it for some projects I'm working on.

If there is more to do, what is it? I could find few mentions of the word indicate in the repository, so I would guess that this would provide support, but I am very new to both Node and BLE and am not versed enough to know for sure. Thanks for taking the time to read this.

@sandeepmistry
Copy link
Collaborator

@apotheos nothing scheduled, but I could add it to my TODO list. However a pull request would be great if you have time :)

That's one piece, you'll also have to

@mikeholler
Copy link
Author

Thanks for your response! It turns out that the particular device I'm working with at the moment does not support indicate, even though previous documentation suggested that it did. If I do start working with a device that supports indications, I'll definitely try to improve the Linux half of this library.

@rowanc
Copy link

rowanc commented Apr 11, 2015

@sandeepmistry, thanks for this awesome lib. I need indicate support in linux, and am m happy to submit a pull request. Is there anything else that I should be looking at than what you listed above? I've worked with BLE minimally.

@sandeepmistry
Copy link
Collaborator

@rowanc that would be sweet!

It would be great to make sure the behaviour is the same as OS X. We'll need to confirm the characteristic onNotify method is called when a ATT_OP_HANDLE_CNF message is received. If OS X doesn't call it now, maybe we should introduce a new onIndicate method?

sandeepmistry added a commit that referenced this issue Apr 27, 2015
- add onIndicate method to characteristic.js
- update test.js with IndicateOnlyCharacteristic
@sandeepmistry
Copy link
Collaborator

732d83a adds support for this!

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

No branches or pull requests

3 participants