Mar 14, 2016
07:19 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 14, 2016
07:19 AM
I am trying to use the CyBle_GenerateRandomNumber() function and it always returns the same values. This is typical of a random generator function but usually there is a function to provide a seed but I cannot find any such function. How does this function get its seed? I can live with the device producing the same list of random numbers but I need to know that each separate device will be different.
Solved! Go to Solution.
Labels
- Labels:
-
BLE
1 Solution
Mar 14, 2016
01:34 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 14, 2016
01:34 PM
Why not using the rand() library function? You can initialize it via srand(), using the current value of the SysTick timer (see http://www.cypress.com/knowledge-base-article/using-systick-timer-psoc-4-kba91374 ). Call srand when your BLE pairing happens since this is a random point in time.
3 Replies