<?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>Changing Advertising periodically</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/12476/changing-advertising-periodically</link><description>Hello, 
 I need to change my advertising Message periodically. In detail message (A) is sent in every 100ms and message (B) ist sent every 3000ms. 
 I defined 2 timer: 
 static void advertising_100ms_handler(void * p_context)
{ 
 uint32_t err_code;</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 10 Mar 2016 14:13:23 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/12476/changing-advertising-periodically" /><item><title>RE: Changing Advertising periodically</title><link>https://devzone.nordicsemi.com/thread/47262?ContentTypeID=1</link><pubDate>Thu, 10 Mar 2016 14:13:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:08b16ed5-192d-484a-9d42-fb2304398c12</guid><dc:creator>ketil</dc:creator><description>&lt;p&gt;Try starting your advertising with message B and see if that works. Might be something wrong with the way you initialize it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Changing Advertising periodically</title><link>https://devzone.nordicsemi.com/thread/47258?ContentTypeID=1</link><pubDate>Thu, 10 Mar 2016 13:27:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c79f453c-06bc-48c9-928f-8baa4a557d3a</guid><dc:creator>SKo</dc:creator><description>&lt;p&gt;This i only the array size. 16bytes was a comment for me, this is the space for my uuid.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Changing Advertising periodically</title><link>https://devzone.nordicsemi.com/thread/47260?ContentTypeID=1</link><pubDate>Thu, 10 Mar 2016 13:26:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:23b457b2-3818-4311-a597-7d6ad6378e03</guid><dc:creator>Anders Strand</dc:creator><description>&lt;ol&gt;
&lt;li&gt;You are creating an array of length 15.&lt;/li&gt;
&lt;li&gt;You write to index 4-22 of this 15 byte array on the for loop.&lt;/li&gt;
&lt;li&gt;You put a 15 byte array into sd_ble_gap_adv_data_set, but the length parameter laenge is 18.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;pt 2 and 3 could lead to hardfault, since you are reading and writing on non-allocated memory.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Changing Advertising periodically</title><link>https://devzone.nordicsemi.com/thread/47259?ContentTypeID=1</link><pubDate>Thu, 10 Mar 2016 13:24:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:00387145-8904-43cc-a104-57c9ec98b147</guid><dc:creator>ketil</dc:creator><description>&lt;p&gt;Your comment says 16 byte payload but your for loop adds 19?&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;for(i = 0; i &amp;lt;= 18; i++)                 //16 Byte Payload  
m_addl_adv_manuf_data[i+4] = 0xff;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Also braces are always recommended.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;for(i = 0; i &amp;lt;= 18; i++)                 //16 Byte Payload  
{  
    m_addl_adv_manuf_data[i+4] = 0xff; 
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Changing Advertising periodically</title><link>https://devzone.nordicsemi.com/thread/47263?ContentTypeID=1</link><pubDate>Thu, 10 Mar 2016 13:24:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cf5e6ede-a9c1-431b-9d2c-ddab362d3a2d</guid><dc:creator>SKo</dc:creator><description>&lt;p&gt;This was my first idea. I got the Radio Notification working. But the advertising message isn´t changing.
while advertising the funktion sd_ble_gap_adv_data_set(m_addl_adv_manuf_data, laenge, NULL, 0); isn´t able to chnage my advertising message.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Changing Advertising periodically</title><link>https://devzone.nordicsemi.com/thread/47261?ContentTypeID=1</link><pubDate>Thu, 10 Mar 2016 13:12:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:121c4e3e-222b-4161-8c4e-9f1c762ed499</guid><dc:creator>ketil</dc:creator><description>&lt;p&gt;Another possible solution, which does not rely on timers, is to use the &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v11.0.0%2Fgroup__ble__radio__notification.html&amp;amp;cp=4_0_0_6_2_6"&gt;Radio Notification Event Handler&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Start your message A as you normally would with a 100ms advertising interval. Every time the radio goes low you can increase a counter in the event handler. When the counter reaches 30 (100ms * 30 = 3000ms) you change the content of the advertisement packet to message B.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/tutorials/14/"&gt;Radio Notification Tutorial&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Changing Advertising periodically</title><link>https://devzone.nordicsemi.com/thread/47264?ContentTypeID=1</link><pubDate>Thu, 10 Mar 2016 10:23:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:722a193f-8fdd-45c0-8c2b-8b3c89c2c9f0</guid><dc:creator>SKo</dc:creator><description>&lt;p&gt;This is my timer init:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;	app_timer_create(&amp;amp;advertising_100ms, APP_TIMER_MODE_REPEATED, advertising_100ms_handler);
	app_timer_start(advertising_100ms, MEASURE_INTERVAL_100, NULL);

	app_timer_create(&amp;amp;advertising_3000ms, APP_TIMER_MODE_REPEATED, advertising_3000ms_handler);
	app_timer_start(advertising_3000ms, MEASURE_INTERVAL_3000, NULL);    
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The first change of my advertising Data works. The first message is created in main.c before
power_mange(); is started. The second message is the message generated every 100 ms. But the nthird message won´t come .&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/6114.Unbenannt.PNG" alt="image description" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Changing Advertising periodically</title><link>https://devzone.nordicsemi.com/thread/47265?ContentTypeID=1</link><pubDate>Thu, 10 Mar 2016 10:13:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:814654c1-8c7a-47ee-a589-e3a61b3685b8</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;What&amp;#39;s the priority of your TIMER interrupts? If it&amp;#39;s app high (ie 1) then it&amp;#39;s higher priority than the SVC call which sd_* functions make and that&amp;#39;s a hardfault.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>