<?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>Read DFU-Version at runtime</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/52595/read-dfu-version-at-runtime</link><description>Hi, 
 After updating the mesh-devices over DFU, we would like to read the version of the application present on the device. 
 Is there a way, to read this information at runtime? 
 We use Mesh SDK 3.1.0 and SDK 15.2 on a nRF52840 
 Regards 
 Gerry</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 02 Oct 2019 09:14:00 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/52595/read-dfu-version-at-runtime" /><item><title>RE: Read DFU-Version at runtime</title><link>https://devzone.nordicsemi.com/thread/212945?ContentTypeID=1</link><pubDate>Wed, 02 Oct 2019 09:14:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:58df88b3-6ae8-4c47-b2e3-e16ae6b7cb25</guid><dc:creator>Gerry</dc:creator><description>&lt;p&gt;Thanks Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read DFU-Version at runtime</title><link>https://devzone.nordicsemi.com/thread/211997?ContentTypeID=1</link><pubDate>Thu, 26 Sep 2019 09:08:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:913a6a43-bee2-4bb2-8e22-7383e739a7fe</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Gerry,&lt;/p&gt;
&lt;p&gt;If you look at the Mesh SDK_3.1.0\examples\examples\dfu example, this actually checks the current app_version in the&amp;nbsp;fw_updated_event_is_for_me() function.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;case NRF_MESH_DFU_TYPE_APPLICATION:
            return (p_evt-&amp;gt;fw_outdated.current.application.app_id == p_evt-&amp;gt;fw_outdated.transfer.id.application.app_id &amp;amp;&amp;amp;
                    p_evt-&amp;gt;fw_outdated.current.application.company_id == p_evt-&amp;gt;fw_outdated.transfer.id.application.company_id &amp;amp;&amp;amp;
                    p_evt-&amp;gt;fw_outdated.current.application.app_version &amp;lt; p_evt-&amp;gt;fw_outdated.transfer.id.application.app_version);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The last line checks the current app_version vs the app_version in the new update.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;You may want to know the application version outside this event? (I don&amp;#39;t know), but this information is fetched in nrf_mesh_dfu.c, inside the dfu_evt_handler() on line 373.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;        case BL_EVT_TYPE_DFU_NEW_FW:
            {
                __LOG(LOG_SRC_DFU, LOG_LEVEL_INFO, &amp;quot;\tNew firmware!\n&amp;quot;);
                nrf_mesh_evt_t evt;
                evt.type = NRF_MESH_EVT_DFU_FIRMWARE_OUTDATED_NO_AUTH;
                evt.params.dfu.fw_outdated.transfer.dfu_type = p_evt-&amp;gt;params.dfu.new_fw.fw_type;
                evt.params.dfu.fw_outdated.transfer.id       = p_evt-&amp;gt;params.dfu.new_fw.fwid;
                if (get_curr_fwid(
                            p_evt-&amp;gt;params.dfu.new_fw.fw_type,
                            &amp;amp;evt.params.dfu.fw_outdated.current) == NRF_SUCCESS)
                {
                    event_handle(&amp;amp;evt);
                }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;get_curr_fwid() reads out the application_version (and application ID and some other stuff).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>