-
-
Notifications
You must be signed in to change notification settings - Fork 747
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
NRF: getAddress(1)
returns the current BLE address
#2503
NRF: getAddress(1)
returns the current BLE address
#2503
Conversation
fb085c4
to
8c3a58e
Compare
I suppose there's no way to check if this feature exists (except firmware version), perhaps a separate function would be better |
I think this is ok (same function) - you can always check firmware version. However I think it still needs work - it looks like if you call getAddress(1) when you haven't set an address, it returns undefined, when it should fall through and return the default address? |
Good spot, thanks - updated the PR |
Thanks! Looks good - ideally I'd use |
Just FYI, if you search for jswrap_ble_getAddress you'll see it is used in a bunch of places that weren't updated, so it's getting called with random values for I'm honestly not sure why the build didn't fail - maybe I need to look at making warnings about calling functions with incorrect parameters into full on errors. |
Ah yeah, I was relying on the compiler to catch invalid calls to -JsVar *jswrap_ble_getAddress();
+JsVar *jswrap_ble_getAddress(void); There may be similar bugs, to catch them you can use I've done a quick check and
If you were to change to |
Thanks! That's interesting - I always assumed I've just fixed I'd prefer not to have to change to Don't suppose you know if there's a compiler switch to enable the behaviour without having to change it? |
Yeah you've got two options really:
The downsides are that there may be other things which need fixing to align with the standard upgrade, but given that the codebase is already C11 (or the GNU variant), I don't think it's a real issue: Line 238 in 49b8ac8
And this option is very cheap to try out. Or:
|
This allows callers of
NRF.getAddress()
to get the current address, for example whensetAddress()
has been called - such as for Open Haystack