meshtastic / framework-portduino

An Arduino API that sits on top of Linux and other operating systems. This lets you run Arduino code on Raspberry PI, desktops, etc... All as a standard user-space application.
GNU Lesser General Public License v2.1
22 stars 11 forks source link

Get real BT MAC Address from /sys/kernel #6

Closed jp-bennett closed 6 months ago

jp-bennett commented 7 months ago

Portduino isn't returning a valid MAC Address, even though systems like the Raspberry Pi do have Bluetooth MAC we could use.

jp-bennett commented 7 months ago

I know this needs some added error-checking, but could somebody that knows portduino better give it a sanity check? Does this make sense?

jp-bennett commented 7 months ago

Portduino is used on linux in general, not only raspberry type computers. can you provide both means of obtaining the mac address? E.G. only fall back to the raspberry way when the portduino config does not contain a Mac?

OK, so the logic should be that we use the MAC from the config if possible, and if empty we try to pull a Bluetooth MAC? Should be doable. And I think it could work on any machine with a Bluetooth adapter.

caveman99 commented 7 months ago

Yes, if there's a mac in the config, it has priority.