<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>How to use sd_rand_application ?? or use Random number with NRF51 ?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/20660/how-to-use-sd_rand_application-or-use-random-number-with-nrf51</link><description>I&amp;#39;ve tried to use stdlib&amp;#39;s random generate function. 
 and as usally all of the basic C language&amp;#39;s random generate functions does, I&amp;#39;ve used srand with Seed based random. (And also, used with time(null) argument like this.) 
 #include &amp;lt;stdlib.h&amp;gt;
#include</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 23 Mar 2017 08:05:16 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/20660/how-to-use-sd_rand_application-or-use-random-number-with-nrf51" /><item><title>RE: How to use sd_rand_application ?? or use Random number with NRF51 ?</title><link>https://devzone.nordicsemi.com/thread/80561?ContentTypeID=1</link><pubDate>Thu, 23 Mar 2017 08:05:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c023d475-a57f-486a-9287-dabd1b0befe4</guid><dc:creator>Daniel T. Lee</dc:creator><description>&lt;p&gt;Thanks! really, But It would be really helpful if API Documentation&amp;#39;s explanation gets little bit more specific.&lt;/p&gt;
&lt;p&gt;Such as It would need some time to full random numbers in buffers, so User might to wait little bit before calling &lt;code&gt;sd_rand_application_bytes_available_get(...)&lt;/code&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use sd_rand_application ?? or use Random number with NRF51 ?</title><link>https://devzone.nordicsemi.com/thread/80560?ContentTypeID=1</link><pubDate>Wed, 22 Mar 2017 11:53:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c9642762-11f5-460c-bef8-283e55133df9</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Q1: But Actually I can&amp;#39;t find any appropriate document for this function. Is there any document for this function&amp;#39;s usage?&lt;/p&gt;
&lt;p&gt;A1: You can find the API documentation &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s130.api.v2.0.0%2Fgroup___n_r_f___s_o_c___f_u_n_c_t_i_o_n_s.html&amp;amp;anchor=ga825412a3746ef587c60d221240691dcd"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;Q2: Does this function needs for NRF_RNG_Driver enabled? do I have to include nrf_drv_rng.c to use this function?&lt;/p&gt;
&lt;p&gt;A2: This is a SoftDevice API function, you don’t need to enable NRF_RNG_Driver. And you don’t need to include &lt;code&gt;nrf_drv_rng.c&lt;/code&gt;. You only need to have enabled the SoftDevice.&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;Your code looks correct, but if you call the function very close to the time you enable the SoftDevice, the SoftDevice hasn&amp;#39;t had enough time to fill the buffer of random numbers. It takes some time after the SoftDevice is enabled to the buffer with random numbers is filled. Wait a couple of milliseconds, and call &lt;code&gt;sd_rand_application_bytes_available_get(..)&lt;/code&gt; again until you have available bytes in the pool.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use sd_rand_application ?? or use Random number with NRF51 ?</title><link>https://devzone.nordicsemi.com/thread/80559?ContentTypeID=1</link><pubDate>Tue, 21 Mar 2017 09:27:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:21ae3bb5-ba61-4425-88d2-91256764e8e8</guid><dc:creator>Alex</dc:creator><description>&lt;p&gt;Ah, sorry, you call SD functions directly.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use sd_rand_application ?? or use Random number with NRF51 ?</title><link>https://devzone.nordicsemi.com/thread/80558?ContentTypeID=1</link><pubDate>Tue, 21 Mar 2017 09:22:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2aa2d8fe-b949-4bc5-8098-9463d1c2432f</guid><dc:creator>Daniel T. Lee</dc:creator><description>&lt;p&gt;do I have to use nrf_drv_rng even if I don&amp;#39;t use RNG?&lt;/p&gt;
&lt;p&gt;OR does sd_rand_application is consisted of RNG?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use sd_rand_application ?? or use Random number with NRF51 ?</title><link>https://devzone.nordicsemi.com/thread/80557?ContentTypeID=1</link><pubDate>Tue, 21 Mar 2017 09:19:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:98697867-55c7-4123-a6b7-52442216fde7</guid><dc:creator>Alex</dc:creator><description>&lt;p&gt;Have you called &lt;code&gt;nrf_drv_rng_init(NULL)&lt;/code&gt; before running code above?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>