Skip to content
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

Update NimBLEAdvertising.cpp #134

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

davidlehrian
Copy link
Contributor

Null terminate the m_name vector because for some reason if you shorten the advertising name it will keep the length the same as the longest name that has been set until the uP is restarted. This means that if you set the name to "longest" and then set it to "short" it will advertise as "shortst" (note two letters from the end of "longest".

Null terminate the m_name vector because for some reason if you shorten the advertising name it will keep the length the same as the longest name that has been set until the uP is restarted. This means that if you set the name to "longest" and then set it to "short" it will advertise as "shortst" (note two letters from the end of "longest".
Apparently a name length of 19 is a magic number because if it is longer than this then adding the null at the end isn't necessary, shortening the name works. Furthermore, adding the null appears to step on something and cause the uP to reboot. However if the name is shorter than 19 then adding a null at the end allows the name to be shortened without having the end of the previous longer name tacked onto the end of the shorter name AND it doesn't seem to step on anything as the uP appears to continue to operate fine.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant