<?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>Passing context pointer to NRF_SDH_BLE_OBSERVER</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/33107/passing-context-pointer-to-nrf_sdh_ble_observer</link><description>Hi, 
 I&amp;#39;m using nRF5 SDK v. 14.0.0. I&amp;#39;m trying to pass a context pointer to the NRF_SDH_BLE_OBSERVER macro, but am running into compilation errors. I want to do something like: 
 
 
 but this fails to compile with errors like: 
 
 
 
 Is this intentional</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 20 Apr 2018 12:56:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/33107/passing-context-pointer-to-nrf_sdh_ble_observer" /><item><title>RE: Passing context pointer to NRF_SDH_BLE_OBSERVER</title><link>https://devzone.nordicsemi.com/thread/129151?ContentTypeID=1</link><pubDate>Fri, 20 Apr 2018 12:56:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2d75a7c9-46d3-4855-9c82-b7d4df186570</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Unfortunately, I do not have any alternative solutions other than what have been allready suggested.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Passing context pointer to NRF_SDH_BLE_OBSERVER</title><link>https://devzone.nordicsemi.com/thread/129036?ContentTypeID=1</link><pubDate>Thu, 19 Apr 2018 17:42:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a0840876-d90f-4a6d-bc3b-1225a4cd068a</guid><dc:creator>charles</dc:creator><description>&lt;p&gt;I&amp;#39;m Robbie&amp;#39;s colleague: the reason we want it is so that we can set a pointer to a dynamically-computed location in RAM. Or, at least, an address that isn&amp;#39;t known to the compiler when compiling the module that calls NRF_SDH_BLE_OBSERVER.&lt;/p&gt;
&lt;p&gt;The alternative is that we have to make a file-scope variable that acts as a trampoline. Sprinking these kinds of trampoline pointers throughout our codebase makes it very hard to protect them using the MWU in case they get scribbled over&amp;nbsp;by a bug.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Passing context pointer to NRF_SDH_BLE_OBSERVER</title><link>https://devzone.nordicsemi.com/thread/127636?ContentTypeID=1</link><pubDate>Tue, 10 Apr 2018 13:28:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a794d793-14dd-440d-9e03-7a729150cb59</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure I understand what you are trying to achieve. How is this different from passing the address of a static variable?&lt;/p&gt;
&lt;p&gt;If you look at the definition of&amp;nbsp;NRF_SDH_BLE_OBSERVER, you see that the _context parameter is&amp;nbsp;used as initializer for the static variable created. The parameter cannot be variable as you try to do.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>