Hacker News new | ask | show | jobs
by andy_ppp 984 days ago
One thing I’ve wanted to do for end to end testing purposes is to be able to make pretend Bluetooth devices from my Mac. I’ve not seen much to suggest a simple way to do this, does anyone know of anything that I can use to make my Mac Bluetooth look like a heart rate monitor, for example?
3 comments

My tool of choice for this is LightBlue. It's not fully cross platform, unfortunately, but it works great on Apple devices. (https://apps.apple.com/us/app/lightblue/id557428110)

I've also dabbled with bleno and noble for emulating and/or communicating with peripheral and central devices, respectively. (https://www.npmjs.com/package/@abandonware/bleno)

IIRC, last time I looked at this you needed special permissions to do anything outside the box with bluetooth on Apple.

It's technically straightforward on linux, or using a BBC microbit (there is example code in the Nordic SDK).

BTLE is much simpler than traditional Bluetooth. It’s just a matter of exposing GATT services with well-known IDs. If you search hard enough, you can probably find details for heart rate monitor service definitions. Then you can either programmatically expose services with those IDs or maybe find a helper app to do it for you. I used to use a free app for iPhone that did this but then they decided to start charging a paid subscription, and I can’t remember the name of it anymore.