Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
JaEd_1453761
Level 1
Level 1
First like received

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.

0 Likes
1 Solution
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

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.

View solution in original post

0 Likes
3 Replies