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

Fix issue-53 by increasing socket filter buffer from 14 bytes to 16 bytes #54

Merged
merged 1 commit into from
Jan 21, 2025

Conversation

agrath
Copy link

@agrath agrath commented Jan 19, 2025

No description provided.

@rzr
Copy link
Collaborator

rzr commented Jan 19, 2025

Please rebase on master branch , i have bypassed failed CI job

lib/hci-socket/gatt.js Outdated Show resolved Hide resolved
@agrath
Copy link
Author

agrath commented Jan 19, 2025

Please rebase on master branch , i have bypassed failed CI job

I think I have done that right?
I added a remote origin "upstream", rebased issue-53 branch using upstream/master, then force pushed issue-53

is there a constant name to be defined for 2902?

That change actually belongs to my other PR which has already been accepted and merged (but wasn't rebased). I've addressed your comment in this PR as a second commit dfbe41d

Can this value computed for existing constants ?

I'm sorry, I am not sure what you mean by this. I will add more detail in the specific conversation for that line

Prior to this fix, The stateChanged powered_on event will not arrive for bleno with an error called from setFilter (EINVAL, Invalid argument). The buffer for the socket filter was 14 bytes and is a constant value of the same length. However, AF_BLUETOOTH setsockopt kernel handler validates the len of the struct hci_filter and expects it to be bit aligned, zero padding (16 bytes), see abandonware/node-bluetooth-hci-socket#60 (comment) for more detail
Additionally, change hardcoded literal '2902' in gatt peripheral initialisation for notify to use a constant string rather than string literal.
@agrath
Copy link
Author

agrath commented Jan 21, 2025

@rzr I have squashed & rebased now

@rzr rzr merged commit 4d72805 into abandonware:master Jan 21, 2025
@agrath agrath deleted the issue-53 branch January 22, 2025 04:13
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

Successfully merging this pull request may close these issues.

3 participants