<?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>Separating code concerns for bluetooth mesh models</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/114188/separating-code-concerns-for-bluetooth-mesh-models</link><description>Hi, 
 I&amp;#39;m wondering if I&amp;#39;m missing something. I&amp;#39;ve been creating a bluetooth mesh light with hue, saturation, brightness, on/off, etc. models. However, my model_handler.c file is becoming huge!! I&amp;#39;ve based it on the nrf examples here , but since 
 the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 27 Aug 2024 16:22:35 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/114188/separating-code-concerns-for-bluetooth-mesh-models" /><item><title>RE: Separating code concerns for bluetooth mesh models</title><link>https://devzone.nordicsemi.com/thread/500053?ContentTypeID=1</link><pubDate>Tue, 27 Aug 2024 16:22:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:143eceb4-302f-431f-b1f1-f66574d65d04</guid><dc:creator>parksj10</dc:creator><description>&lt;p&gt;Thanks a lot &lt;a href="https://devzone.nordicsemi.com/members/amanda"&gt;Amanda Hsieh&lt;/a&gt;&amp;nbsp;, I&amp;#39;ll give it a go and report back if there are any road blocks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Separating code concerns for bluetooth mesh models</title><link>https://devzone.nordicsemi.com/thread/500044?ContentTypeID=1</link><pubDate>Tue, 27 Aug 2024 15:44:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f118fc19-cd72-4d7d-aaac-d9574ad829fb</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;struct led_ctx&lt;/code&gt; is specific to this sample, created for convenience, and does not require the use of Mesh APIs at all. If it doesn&amp;#39;t fit&amp;nbsp;your&amp;nbsp;use case, you&amp;#39;ll have to replace it with something else you wrote&amp;nbsp;to fit your use case. The sample is, as the word suggests, a sample, not meant to be a drop-in application.&lt;/p&gt;
&lt;p&gt;The only thing&amp;nbsp;you are required to do to accomplish &amp;quot;a Bluetooth mesh light with hue, saturation, brightness, on/off, etc.&amp;quot;, is to have implementations for the relevant handler functions for the Hue Server, Saturation Server and Lightness Server, and then pass these handlers to &lt;code&gt;BT_MESH_LIGHTNESS_SRV_INIT&lt;/code&gt; and &lt;code&gt;BT_MESH_LIGHT_HSL_SRV_INIT&lt;/code&gt;. What these handlers do is completely up to the application author, and depends on the specific use-case. In this case, where they would like to handle hue logic in one file, onoff in another, etc., and don&amp;#39;t like to have a huge &lt;code&gt;model_handler.c&lt;/code&gt;, I&amp;#39;d suggest to keep the handler implementations in &lt;code&gt;model_handler.c&lt;/code&gt; short, just containing calls to application-specific functions in other files exposed in application-specific headers.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Amanda H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>