<?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 make advertising timeout variable</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/27423/how-to-make-advertising-timeout-variable</link><description>I want nrf51822 to switch between 2 different advertising timeout. One will set advertising timeout with 20s, another will keep advertising. 
 Currently, I use following code to set advertising timeout. It can&amp;#39;t be changed. 
 &amp;quot;#define APP_ADV_TIMEOUT_IN_SECONDS</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 29 Nov 2017 01:44:13 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/27423/how-to-make-advertising-timeout-variable" /><item><title>RE: How to make advertising timeout variable</title><link>https://devzone.nordicsemi.com/thread/108305?ContentTypeID=1</link><pubDate>Wed, 29 Nov 2017 01:44:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4e5743e2-fa1b-4810-aa60-3337643624d4</guid><dc:creator>Frank. H</dc:creator><description>&lt;p&gt;Dear all, thank you for your notice.
I had solved this issue, using &amp;quot;uint32_t APP_ADV_TIMEOUT_IN_SECONDS=20&amp;quot; is OK.
The issue is my bootloader get some problem after I modifying this definition.
And that&amp;#39;s why I can&amp;#39;t enter main().
The code running well after removing bootloader. FYR.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to make advertising timeout variable</title><link>https://devzone.nordicsemi.com/thread/108304?ContentTypeID=1</link><pubDate>Wed, 22 Nov 2017 09:51:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca44e1f5-512e-4d45-8031-cf783f90cca6</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi Frank,&lt;/p&gt;
&lt;p&gt;Could you upload or post your code here ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to make advertising timeout variable</title><link>https://devzone.nordicsemi.com/thread/108303?ContentTypeID=1</link><pubDate>Tue, 21 Nov 2017 21:39:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:538013da-3cdc-400a-b7d7-5e445759cab8</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;of course it&amp;#39;s possible to make the advertising timeout a variable. Personally I wouldn&amp;#39;t name it the same as the old #define because that&amp;#39;s just asking for trouble, but a trivial modification like this should take all of 5 seconds. It&amp;#39;s really impossible to even start to guess what you might be doing wrong, do you have any C coding experience?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to make advertising timeout variable</title><link>https://devzone.nordicsemi.com/thread/108302?ContentTypeID=1</link><pubDate>Tue, 21 Nov 2017 21:35:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fe3a5ce6-3316-44e7-9509-c73f85af452c</guid><dc:creator>Frank. H</dc:creator><description>&lt;p&gt;Yes，if I change the definition back,  it works normally. And I just want to know that it is possible to make APP_ADV_TIMEOUT_IN_SECONDS to be a variable parameter. I have try many method but fail.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to make advertising timeout variable</title><link>https://devzone.nordicsemi.com/thread/108301?ContentTypeID=1</link><pubDate>Tue, 21 Nov 2017 11:34:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c61a3d9-57a2-460f-8122-aec1b008cb82</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Does it work if you change it back to &lt;em&gt;#define APP_ADV_TIMEOUT_IN_SECONDS 20&lt;/em&gt;  ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to make advertising timeout variable</title><link>https://devzone.nordicsemi.com/thread/108300?ContentTypeID=1</link><pubDate>Tue, 21 Nov 2017 04:33:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:be9b463f-8d46-47a7-bbc6-994032311abb</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;That sounds strange, I would bet it either won&amp;#39;t compile/link/load to the chip or it runs at least through start-up code up to your initial calls in &lt;code&gt;main()&lt;/code&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to make advertising timeout variable</title><link>https://devzone.nordicsemi.com/thread/108298?ContentTypeID=1</link><pubDate>Tue, 21 Nov 2017 00:04:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f8990b0-3ca7-4b52-8398-26785ac6547f</guid><dc:creator>Frank. H</dc:creator><description>&lt;p&gt;The compiler process is OK. Get in debug mode. The failure is that the process didn&amp;#39;t run main() after modify APP_ADV_TIMEOUT_IN_SECONDS to uint32_t.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to make advertising timeout variable</title><link>https://devzone.nordicsemi.com/thread/108299?ContentTypeID=1</link><pubDate>Mon, 20 Nov 2017 19:51:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51d6f26f-9a76-4356-857f-7f8e8e22c220</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Be more specific about &lt;em&gt;&amp;quot;but it fails&amp;quot;&lt;/em&gt;. What are the changes to some baseline example project (and which you use)? What error code and where you get? Or how do you detect the failure?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>