argument type for setLocalName (appears to be a C string)
Also I am noting that there are interactions between various settings, and these are not documented.
For instance, it seems like setting connectable while already advertising will have no effect. It seems that way. It can be hard to tell. I am testing with nRF Connect, and it doesn't always instantaneously update.
I think someone who really knows the behaviours needs to detail these in the docs. Otherwise its just a pain for everyone to have to figure it out, searching forums and so on.
Just to make things clear for other forum members, I believe @dustystew is referring to this documentation:
@dustystew the people who have the necessary access to act on your suggestions are not likely to see this post. The best way for you to make suggestions for improvements to the content of the Arduino library reference pages is via the contact form: https://www.arduino.cc/en/contact-us
The more specific you can be in your suggestions, the better. URLs of the pages in question are helpful. I will often try to provide the exact text that I am suggesting replace the existing content so my proposal is very clear.
But this isn't to say that it's a bad idea to post proposals for ocumentation improvements to the forum as well. Even if the documentation authors don't see it, the Arduino community may give you valuable feedback on your proposal.
dustystew:
I think someone who really knows the behaviours needs to detail these in the docs. Otherwise its just a pain for everyone to have to figure it out, searching forums and so on.
While I love documentation and datasheets. With open source software the ultimate reference is the source code. Maybe this is something where you/we need a better IDE.
Your example in reply #2 is prove that even source code comments should be avoided as much as possible.
Though I did just look at the header file which had function prototypes and that was helpful.
BLE.setLocalName(const char *name)
If advertising is enabled, setting the name will not take effect until advertising is turned off and back on again.
The name argument must be a constant C string. This can be a string literal eg "my name" or a static char array.
(admittedly some work will be required on how these ideas are expressed, I am just stating the facts that should be present in the docs for the method)
The method could be improved by creating a static char array in the BLE class, then copying in the characters from the string argument. If this were done, the argument could be any char pointer.
Another version of the method that takes the String class as an argument would also help make things easier.