petzval / btferret

Python and C Bluetooth Library
MIT License
127 stars 22 forks source link

Compile for Windows and macOS? #33

Closed ronaaron closed 8 months ago

ronaaron commented 11 months ago

Hello -- I just stumbled across your excellent library, and I'm curious to try to compile as well for macOS and Windows (using mingw).

I think it should be possible, with some tweaks. Has anyone tried either of these?

petzval commented 11 months ago

I have not heard of any attempts to port to mac or Windows. There is one thing to check before attempting it. Linux allows direct access to the Bluetooth adapter via HCI_CHANNEL_USER. See the bind operation at around line 8190 in hcisock() function in btlib.c. If you cannot open a socket and bind to HCI_CHANNEL_USER then btferret cannot work. I think I have tried this on Windows 10 and it failed. If it does work, let me know and I'll think about the linux-specific functions that may cause problems.

ronaaron commented 11 months ago

Thanks, I'll try to look into it. My ultimate goal is to have the same (or mostly same) code across various platforms I support.