Code Monkey home page Code Monkey logo

Comments (4)

syoder avatar syoder commented on August 17, 2024

As far as I can tell, something in here is failing: https://github.com/currantlabs/ble/blob/master/linux/hci/hci.go#L187-L198

from ble.

syoder avatar syoder commented on August 17, 2024

I've discovered that after the socket is bound, there is sometimes data to be read on the socket. This is throwing everything off because the code doesn't expect anything yet. When it does start sending commands, it gets confused because the response isn't what it was expecting.

After the socket is bound (https://github.com/currantlabs/ble/blob/master/linux/hci/socket/socket.go#L107) if I add some code to sleep for 50ms and then read from the socket to clear it out, then it works flawlessly. I can submit a PR with this, but I'm still a little unsure if it's just an issue with my particular hardware or what. It may be that after an "hci down" and "hci up", something gets written to the socket when the bluetooth hardware comes back up, which may explain the time delay issue.

Any thoughts?

from ble.

hasty avatar hasty commented on August 17, 2024

Let me try it out on some of our hardware here; we haven't seen that issue, but doesn't seem like this would hurt aside from the (very slight) delay.

from ble.

syoder avatar syoder commented on August 17, 2024

Yeah, it may be something very specific to my hardware. I'm testing this with ubuntu running in VirtualBox on macOS, with a USB bluetooth dongle (you can't get a VM to attach to a Mac's builtin bluetooth). It may be something with the dongle I'm using. I've previously had good success with running bluetooth stuff in linux with this setup though.

from ble.

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.