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

bug: NINAFW adaptors broken when acting as peripheral #300

Open
deadprogram opened this issue Oct 28, 2024 · 2 comments
Open

bug: NINAFW adaptors broken when acting as peripheral #300

deadprogram opened this issue Oct 28, 2024 · 2 comments
Labels
bug Something isn't working next-release

Comments

@deadprogram
Copy link
Member

deadprogram commented Oct 28, 2024

Since commit 457af75 is appears that the NINAFW adaptors are broken. They advertise without a problem, however on connecting to them they do not correctly respond. Instead they get into a death spiral of bad messages probably due to losing their place.

@deadprogram deadprogram added the bug Something isn't working label Oct 28, 2024
@deadprogram deadprogram changed the title bug: HCI-based adaptors broken when acting as peripheral bug: NINAFW adaptors broken when acting as peripheral Oct 28, 2024
@jsoriano
Copy link

Hey @deadprogram,

I was trying to use this library with an arduino-nano33 (Arduino Nano 33 IoT), and adapter.Enable() already fails. I can confirm the issue starts happening on 457af75.

This line looks suspicious to me:
457af75#diff-1acd23db7ad68fc2a873aff592c71288609ca6c78895f3c3ac3249791a1e2ae8R19

c := sz + 4 - (sz % 4)

When sz is 4, c will be 8, is this intended? Could it be reading parts of the next event when sz is already a multiple of 4?

I have tried to modify this line so it keeps multiples of 4 as they are, and it seems to work better.

c := sz + (4 - (sz % 4)) % 4

What is the intention of this line? To get the closest multiple of 4, or the next one?

Would it make sense to revert to the previous code based on ReadByte()?

@deadprogram
Copy link
Member Author

Hi @jsoriano thanks for the correction, I added it to PR #304 just now.

colececil added a commit to colececil/automatic-soil-monitor that referenced this issue Nov 18, 2024
There is an open bug for this at tinygo-org/bluetooth#300. Fortunately, there is also an open pull request with a fix, so I'm updating to that specific commit for now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working next-release
Projects
None yet
Development

No branches or pull requests

2 participants