<?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>Pre/Post Advertise Hook</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/2214/pre-post-advertise-hook</link><description>Hi all, 
 My application gathers sensor data and uses the advertisement packet to broadcast the values (much the same as the nordic temp sensor example). Rather than having to have a separate timer which aligns with the advertise interval (which is what</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 03 Jun 2014 10:44:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/2214/pre-post-advertise-hook" /><item><title>RE: Pre/Post Advertise Hook</title><link>https://devzone.nordicsemi.com/thread/9341?ContentTypeID=1</link><pubDate>Tue, 03 Jun 2014 10:44:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:52ef63c2-c0e9-4d64-833b-c79b978f92db</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Comments should be used to get more information or clarification about a question or answer, not to post new questions that are not very relevant to the original question.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pre/Post Advertise Hook</title><link>https://devzone.nordicsemi.com/thread/9336?ContentTypeID=1</link><pubDate>Tue, 03 Jun 2014 10:38:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9f8235fc-c2e7-461d-93d9-c05cf1254f72</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Please don&amp;#39;t post a question as an answer. This should be a separate question(link to this question if it&amp;#39;s relevant).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pre/Post Advertise Hook</title><link>https://devzone.nordicsemi.com/thread/9340?ContentTypeID=1</link><pubDate>Tue, 03 Jun 2014 08:46:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f3c3e573-6ab6-45b5-b1bd-37b5ec8cc5ce</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;Well after a bit of trial and error I got this working. I can tell when I&amp;#39;ve sent a scan response which is great.&lt;/p&gt;
&lt;p&gt;Bad news is I was being scanned all the time so I&amp;#39;ve turned off scan responses to reduce battery life!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pre/Post Advertise Hook</title><link>https://devzone.nordicsemi.com/thread/9339?ContentTypeID=1</link><pubDate>Sat, 31 May 2014 02:36:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:df2e6258-f307-4eec-8b58-064bba9f1921</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;Just re-reading your reply Dan and you mention that you&amp;#39;ll only get them before/after advertising when not connected so perhaps this will work..&lt;/p&gt;
&lt;p&gt;I thought to time it to know how long (roughly) a standard advertisement takes vs a scan response.. Would this be a reasonable approach to determine if we had been scanned (i.e.: we sent a scan response)..&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pre/Post Advertise Hook</title><link>https://devzone.nordicsemi.com/thread/9338?ContentTypeID=1</link><pubDate>Sat, 31 May 2014 01:03:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56d6c331-3bbd-41cc-bcac-8a092a069168</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;Is there anyway to know what the radio is sending...? i.e.: knowing that its an advertising transmission or a scan response that is being sent out..? I guess we could know when we&amp;#39;re in connected state (via the SD ble events) so if we&amp;#39;re not in that state we can assume the radio is doing advertising work...?&lt;/p&gt;
&lt;p&gt;I&amp;#39;m trying to figure out a way to detect when the nordic device was scanned and sent out its scan response..&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pre/Post Advertise Hook</title><link>https://devzone.nordicsemi.com/thread/9337?ContentTypeID=1</link><pubDate>Fri, 30 May 2014 21:51:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:26e89459-709a-4773-960d-0a635f60d8a6</guid><dc:creator>Dan Danknick</dc:creator><description>&lt;p&gt;This is a great question. If you&amp;#39;re not in the connected state then the only radio notifications you&amp;#39;ll get are before and after the SD grabs the CPU to advertise.&lt;/p&gt;
&lt;p&gt;Using the function that Petter mentioned is easy. Invoke it in main():&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ble_radio_notification_init(NRF_APP_PRIORITY_HIGH, NRF_RADIO_NOTIFICATION_DISTANCE_800US, InterruptEvent);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and define the pre/post event function that takes your sensor sample and adjusts the advertising payload:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;void InterruptEvent(bool radio_active)
{
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Dan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pre/Post Advertise Hook</title><link>https://devzone.nordicsemi.com/thread/9335?ContentTypeID=1</link><pubDate>Fri, 30 May 2014 11:29:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e373ce39-6a8d-4b07-927e-3dd7ce5801f1</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;Is there any sample code for this anywhere...?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pre/Post Advertise Hook</title><link>https://devzone.nordicsemi.com/thread/9334?ContentTypeID=1</link><pubDate>Tue, 27 May 2014 14:55:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e1bffd0-1bd6-42b4-ac58-a4db8e33f1c9</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Have you investigated the &lt;a href="https://devzone.nordicsemi.com/documentation/nrf51/5.2.0/html/a00966.html#details"&gt;Radio Notification Event Handler&lt;/a&gt;?&lt;/p&gt;
&lt;p&gt;This is a module for propagating Radio Notification events to the application.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Pre/Post Advertise Hook</title><link>https://devzone.nordicsemi.com/thread/9333?ContentTypeID=1</link><pubDate>Tue, 27 May 2014 14:53:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:54722639-fd3c-403e-8135-931d6565ff70</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Sorry for the late reply.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure what example you are thinking of. We have an example implementing the Health Thermometer Service in our SDK, but the temperature is not included in the advertisment package. It requires you to connect, and turn on indications, to get the temperature.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>