-
Notifications
You must be signed in to change notification settings - Fork 10
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
Added option to use task PID for EUI seed under native POSIX #49
Conversation
Thanks for the PR. Under some circumstances it may be desirable to have a "predictable" random generator, e.g. for tests in CI, which is why such a generator is used by default in Otherwise you can also alter the seed value on the command line:
Would that be sufficient? If not, I'd be fine with your proposed change, but I'd like it to be selectable via Kconfig (defaulting to no), as I prefer having always the same ID when I do some debugging (as this is more like an actual device which is switched off and on). |
Thanks Martin, I was not aware that I could update the seed in this way and that'll probably work for my needs. I still think the changes may be useful so I'll add your Kconfig suggestions shortly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Added a tiny improvement to make sure the Kconfig is only displayed when building for native_posix
.
Gonna merge as soon as CI is green.
…t#49) * Changed EUI seed to use task PID for native POSIX * Use Kconfig to switch between RNG and PID based EUI generation * Add BOARD_NATIVE_POSIX dependency to Kconfig Co-authored-by: Simon Gilbert <[email protected]>
…t#49) * Changed EUI seed to use task PID for native POSIX * Use Kconfig to switch between RNG and PID based EUI generation * Add BOARD_NATIVE_POSIX dependency to Kconfig Co-authored-by: Simon Gilbert <[email protected]>
sys_rand32_get() seems to return the same sequence when spooling up multiple thingset duplicate POSIX applications. This uses the task PID instead.