<?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>How to deal with a variable number of elements?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/59786/how-to-deal-with-a-variable-number-of-elements</link><description>Hi, 
 
 as I know from the mesh spec, the number of elements cannot change after a device was provisioned. Nordic even went so far as to define the number of elements during compile time. I have now done a lot of research but could nowhere find an answer</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 29 Apr 2020 09:27:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/59786/how-to-deal-with-a-variable-number-of-elements" /><item><title>RE: How to deal with a variable number of elements?</title><link>https://devzone.nordicsemi.com/thread/247262?ContentTypeID=1</link><pubDate>Wed, 29 Apr 2020 09:27:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5dc25f2d-b69b-42a3-9e4b-419c32117942</guid><dc:creator>Marius Heil</dc:creator><description>&lt;p&gt;Hi, thank you. I thought there might be a standard way to do this as the SIG mesh was mainly targeted at lighting and DALI is one of the standards of todays lighting industry that will not go away in the near future. But this helps to clarify that I have to choose a vendor specific way of dealing with that. Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to deal with a variable number of elements?</title><link>https://devzone.nordicsemi.com/thread/247259?ContentTypeID=1</link><pubDate>Wed, 29 Apr 2020 09:21:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8aad10e1-a040-4939-be93-68f504703d7b</guid><dc:creator>Mttrinh</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;1.&amp;nbsp; Do you mean that the guidelines be presented in the nRF5 Mesh SDK documentation? or somewhere else?&lt;/p&gt;
&lt;p&gt;2.&amp;nbsp; This seems like a very product-specific issue. I understand what you are trying to do here. Given the current framework of things and the mesh specification requirements that the device composition cannot be changed once the device is provisioned, is creating chicken-and-egg situation here.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The aspect of searching for devices on the DALI bus seems to a key thing here. This appears to be fairly vendor-specific. If that is the case, I would solve this problem in the following way:&lt;/p&gt;
&lt;p&gt;Assumption: End-user with a mobile phone is in direct radio range of the unprovisioned device connected to a DALI Bus.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Define an advertising channel PDU with some manufacturer-specific data byte to be sent as a signal to the device to enumerate DALI bus. Let us call this &amp;quot;Special ADV PDU&amp;quot;.&lt;/li&gt;
&lt;li&gt;This PDU can be intercepted by the application running on an unprovisioned device nRF Mesh SDK&amp;#39;s scanner callback API. When the unprovisioned device receives this PDU, it will enumerate DALI bus and determine which models to be initialized by writing some user-defined information in flash, and reboot the device.&lt;/li&gt;
&lt;li&gt;When the device reboots, the application will check this information saved in the flash and initialize the models accordingly.&lt;/li&gt;
&lt;li&gt;The ability to change DALI enumeration related information in the flash should be unlocked only when the device is unprovisioned. Otherwise, the application will ignore all incoming Special ADV PDU.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Note this just an example of how things can be done. You can build on top of this idea to encrypt manufacturer-specific data in these PDUs if required and employ good security practices considering the end-use case of your devices.&lt;/p&gt;
&lt;p&gt;A bit more complex way could be:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Define a custom BLE service that can trigger the DALI enumeration, and use this service for triggering enumeration when the device is unprovisioned. The device can be made to advertise this service only when it boots up as an unprovisioned device.&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to deal with a variable number of elements?</title><link>https://devzone.nordicsemi.com/thread/243947?ContentTypeID=1</link><pubDate>Tue, 07 Apr 2020 17:07:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:49b701af-1ec2-4aaf-b690-4b60ffcaeadd</guid><dc:creator>Marius Heil</dc:creator><description>&lt;p&gt;Hi, thank you. This is one possibility. I wonder why there are no guidelines for that as I expect that different vendors will use a different approach.&lt;/p&gt;
&lt;p&gt;However, there is one crucial problem: For DALI devices, there are typically different search modes that can be triggered (Find only new, Clear and Search, ....). How would the user be able to trigger a search on the device, if it is not provisioned? It looks like it would need to be provisioned, then the search could be started, then it has to be unprovisioned so that the number of elements can be changed. Finally, it has to be provisioned again.&lt;/p&gt;
&lt;p&gt;Is there a better possibility?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to deal with a variable number of elements?</title><link>https://devzone.nordicsemi.com/thread/243936?ContentTypeID=1</link><pubDate>Tue, 07 Apr 2020 15:44:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6d215bef-c74b-4ebc-9bef-686e1400ce57</guid><dc:creator>Mttrinh</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;This is the response from our team:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Having a variable number of elements in a node is not compatible with Mesh Specification v1. Further, the stack does not seamlessly support a dynamic change of device composition data. Even if it could be made possible somehow, having such a node that can instantly change its composition after provisioning can be detrimental for the entire network and can cause functionality breakdown in the network.&amp;nbsp;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;I can think of following way in which customer&amp;#39;s requirement can be satisfied while still observing Mesh Profile and Mesh stack restrictions:&lt;/em&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Pre-allocate a sufficient number of elements, model instances, the total number of virtual/non-virtual addresses, total number of subscription lists, app keys and net keys.&amp;nbsp;&amp;nbsp;&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Then, in an unprovisioned state, when such a mesh device is connected to the DALI bus for the first time this device can enumerate DALI devices and store this information (say, for example, the number of lights present on the bus) in flash as a user application information.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Based on this information, necessary models can be initialized in the model_init_cb() of the main application. You, as a manufacturer of this device, can define the point of frozen composition as - enumeration of DALI devices by the mesh device in an unprovisioned state. If the end-user needs to change the number of attached DALI devices, then he can unprovision the mesh device first, change the number of devices and then re-provision the mesh device.&amp;nbsp;&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;The only pitfall of this method would be, having to bear with empty elements on the device. But this looks like it is unavoidable.&amp;nbsp;&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>