<?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>The &amp;#39;HOST&amp;#39; #define in light switch examples</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/26238/the-host-define-in-light-switch-examples</link><description>In the examples I see places where there is conditional code based on the #define HOST. 
 For example in function nrf_mesh_init() i see that the softdevice is only enabled if HOST is undefined. 
 That seems to suggest that I integrate the mesh code</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 26 Oct 2017 15:23:40 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/26238/the-host-define-in-light-switch-examples" /><item><title>RE: The 'HOST' #define in light switch examples</title><link>https://devzone.nordicsemi.com/thread/103305?ContentTypeID=1</link><pubDate>Thu, 26 Oct 2017 15:23:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e91f36a-081e-411e-b563-a87338a60c4a</guid><dc:creator>Mahendra Tailor</dc:creator><description>&lt;p&gt;So I think there is no issue. But only after this discussion is the confusion clarified :-)
Thank you - I have my answer now&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The 'HOST' #define in light switch examples</title><link>https://devzone.nordicsemi.com/thread/103304?ContentTypeID=1</link><pubDate>Thu, 26 Oct 2017 15:22:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63488eea-94ab-43c6-90d8-13f31f91d9cc</guid><dc:creator>Mahendra Tailor</dc:creator><description>&lt;p&gt;Unfortunatly I cannot do that because mesh_softdevice_setup() is called by mesh_core_setup() and that is called by main() In the light_switch_client example app.
But mesh_core_setup() is &lt;strong&gt;never&lt;/strong&gt; called in the light_switch_server example app.&lt;/p&gt;
&lt;p&gt;And just checked that mesh_softdevice_setup() is not directly called either in the server application.&lt;/p&gt;
&lt;p&gt;In fact in the server app, the softdevice is enabled in the function softdevice_setup() which is directly called by nrf_mesh_node_config() which is in turn called in main().&lt;/p&gt;
&lt;p&gt;However I see that nrf_mesh_node_config() only calls softdevice_setup() if the softdevice is currently NOT enabled. So as you say it should just work out.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The 'HOST' #define in light switch examples</title><link>https://devzone.nordicsemi.com/thread/103303?ContentTypeID=1</link><pubDate>Thu, 26 Oct 2017 15:10:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f22a1096-3142-4475-accd-ef702c628e2a</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;I don&amp;#39;t think you should define &amp;quot;HOST&amp;quot; in your project. If it&amp;#39;s only about the initialization of softdevice, why not simply skip calling mesh_softdevice_setup() inside mesh_code_setup() ?
We have an &lt;a href="https://devzone.nordicsemi.com/question/163747/ble-mesh-sdk-along-with-peripheral-mode/"&gt;example&lt;/a&gt; of combined mesh and BLE, and it worked fine.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The 'HOST' #define in light switch examples</title><link>https://devzone.nordicsemi.com/thread/103302?ContentTypeID=1</link><pubDate>Wed, 25 Oct 2017 15:23:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e6fb5ac7-716e-4cb5-9414-cd097c3437a0</guid><dc:creator>Mahendra Tailor</dc:creator><description>&lt;p&gt;Alas defining HOST will mean that it will break the application because in the function nrf_mesh_on_sd_evt() I see that the function timeslot_sd_event_handler() is only called if HOST is not defined.&lt;/p&gt;
&lt;p&gt;I think Nordic needs to add some other #define to be used if the mesh stack is integrated into an existing application&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The 'HOST' #define in light switch examples</title><link>https://devzone.nordicsemi.com/thread/103306?ContentTypeID=1</link><pubDate>Wed, 25 Oct 2017 14:04:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ddb6b6b2-d0b1-430a-a79a-b0b9d7a06884</guid><dc:creator>Mahendra Tailor</dc:creator><description>&lt;p&gt;I note that if the HOST is defined the softdevice initialisation code is not called.
Given I plan to integrate the mesh code into our standard firmware image where we already enable the softdevice I actually do not want that code to be called in the mesh stack.
But now given you mention it is for unit testing I am nervous that I define HOST for my project.&lt;/p&gt;
&lt;p&gt;Can you make any recommendations for my integration use case?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The 'HOST' #define in light switch examples</title><link>https://devzone.nordicsemi.com/thread/103301?ContentTypeID=1</link><pubDate>Wed, 25 Oct 2017 13:35:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e9f3f534-d0ec-40e7-85b2-590faa9b4344</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Mahendra,&lt;/p&gt;
&lt;p&gt;The &amp;quot;HOST&amp;quot; define is used when we do unit test of the modules. We could have used different name to make it clearer.
Don&amp;#39;t think the application need to do anything with that.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>