<?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>DFU master from central</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/35394/dfu-master-from-central</link><description>Hello, i&amp;#39;m trying to updade my firmaware using the DFU. I manage to do it with nRF Connect and nrfutil but i&amp;#39;m trying to a custom central to flash the software without any human interactions. 
 I already checked on the DEV zone and it looks like there</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 15 Jun 2018 08:56:25 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/35394/dfu-master-from-central" /><item><title>RE: DFU master from central</title><link>https://devzone.nordicsemi.com/thread/136301?ContentTypeID=1</link><pubDate>Fri, 15 Jun 2018 08:56:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4fbc66c1-6f93-4487-932d-8a711fbcc1de</guid><dc:creator>Albin</dc:creator><description>&lt;p&gt;That actually was it, wow i can&amp;#39;t belive i made a such stupid mistake...&lt;/p&gt;
&lt;p&gt;Thanks a lot for your help ;) .&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU master from central</title><link>https://devzone.nordicsemi.com/thread/136284?ContentTypeID=1</link><pubDate>Fri, 15 Jun 2018 07:54:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7c967996-59b0-461f-aa1f-945d0bb20dd5</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Are you sure you&amp;#39;ve set the correct base uuid? Note that it is&amp;nbsp;not the same&amp;nbsp;as the one used with the NUS.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    uint8_t uuid_type = BLE_UUID_TYPE_VENDOR_BEGIN;

    ble_uuid128_t const base_uuid128 =
    {
        {
            0x50, 0xEA, 0xDA, 0x30, 0x88, 0x83, 0xB8, 0x9F,
            0x60, 0x4F, 0x15, 0xF3,  0x00, 0x00, 0xC9, 0x8E
        }
    };

    err_code = sd_ble_uuid_vs_add(&amp;amp;base_uuid128, &amp;amp;uuid_type);
    APP_ERROR_CHECK(err_code);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Here is the result from my test (used NUS client example from sdk 15 as starting point):&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-2ae3c54bdfb24bf4a81f1cf3fa3919e1/Capture.PNG" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU master from central</title><link>https://devzone.nordicsemi.com/thread/136222?ContentTypeID=1</link><pubDate>Thu, 14 Jun 2018 15:44:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c9423306-f61d-400d-8461-3b4135b7daf7</guid><dc:creator>Albin</dc:creator><description>&lt;p&gt;UPDATE : i found a other way to discover the service and it&amp;#39;s working fine. I&amp;#39;m back to my first issue where i can&amp;#39;t discover all the characteristics i do the discovery like this :&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;void ble_dfu_c_on_db_disc_evt(ble_dfu_c_t * p_ble_dfu_c, const ble_db_discovery_evt_t * p_evt)
{
	
	ble_dfu_c_evt_t evt;
	 memset(&amp;amp;evt,0,sizeof(evt));
	
	const ble_gatt_db_char_t * p_char = p_evt-&amp;gt;params.discovered_db.charateristics;
	
		
		//check if Thingy environement service was discovered
		if (p_evt-&amp;gt;evt_type == BLE_DB_DISCOVERY_COMPLETE &amp;amp;&amp;amp;
        p_evt-&amp;gt;params.discovered_db.srv_uuid.uuid == BLE_DFU_SERVICE_UUID &amp;amp;&amp;amp;
        p_evt-&amp;gt;params.discovered_db.srv_uuid.type == BLE_UUID_TYPE_BLE)
    {
				

			NRF_LOG_INFO(&amp;quot;nb char dfu %d\r\n&amp;quot;,p_evt-&amp;gt;params.discovered_db.char_count);
			 for (uint32_t i = 0; i &amp;lt; p_evt-&amp;gt;params.discovered_db.char_count; i++)
       {										
					
				 
					switch (p_char[i].characteristic.uuid.uuid)
            {
								case BLE_DFU_CONTROL_POINT_CHAR_UUID:
                    evt.params.peer_db.control_point_handle      = p_char-&amp;gt;characteristic.handle_value;
                    evt.params.peer_db.control_point_cccd_handle = p_char-&amp;gt;cccd_handle;
										NRF_LOG_INFO(&amp;quot;control point handle %d \r\n&amp;quot;, p_char-&amp;gt;characteristic.handle_value);
                    break;
								case BLE_DFU_PACKET_CHAR_UUID:
										evt.params.peer_db.packet_handle      = p_char-&amp;gt;characteristic.handle_value;
										NRF_LOG_INFO(&amp;quot;config handle %d \r\n&amp;quot;, p_char-&amp;gt;characteristic.handle_value);
									  break;
								default:
									NRF_LOG_INFO(&amp;quot;Not found %d \r\n&amp;quot;, p_char[i].characteristic.uuid.uuid);
                    break;
						}
				}
			 

				
				
				 //If the instance has been assigned prior to db_discovery, assign the db_handles
        if (p_ble_dfu_c-&amp;gt;conn_handle != BLE_CONN_HANDLE_INVALID)
        {
					if((p_ble_dfu_c-&amp;gt;peer_dfu_db.control_point_handle				== BLE_GATT_HANDLE_INVALID)&amp;amp;&amp;amp;
						 (p_ble_dfu_c-&amp;gt;peer_dfu_db.control_point_cccd_handle  == BLE_GATT_HANDLE_INVALID)&amp;amp;&amp;amp;
						 (p_ble_dfu_c-&amp;gt;peer_dfu_db.packet_handle							== BLE_GATT_HANDLE_INVALID))
					{
							p_ble_dfu_c-&amp;gt;peer_dfu_db = evt.params.peer_db;
						  NRF_LOG_DEBUG(&amp;quot;ERROR CONN HANDLE DFU.\r\n&amp;quot;);
					}
					
				}
				
				if (p_ble_dfu_c-&amp;gt;evt_handler != NULL)
        {
						evt.evt_type    = BLE_DFU_C_EVT_DISCOVERY_COMPLETE;
						evt.conn_handle = p_evt-&amp;gt;conn_handle;
						p_ble_dfu_c-&amp;gt;evt_handler(p_ble_dfu_c, &amp;amp;evt);
				}
				
		}


}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;unfortunately no characteristics are discovered the switch is going strait to default insted of discovering&amp;nbsp;&lt;/p&gt;
&lt;p&gt;the DFU without bound&lt;span&gt;&amp;nbsp;&lt;/span&gt;characteristics (0x0003). I still get the right number of&amp;nbsp;&lt;span&gt;characteristics but the wrong UUID.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/7838.UUID.PNG" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU master from central</title><link>https://devzone.nordicsemi.com/thread/136184?ContentTypeID=1</link><pubDate>Thu, 14 Jun 2018 13:06:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cc8526b2-2ab9-4db7-a604-edd25af85577</guid><dc:creator>Albin</dc:creator><description>&lt;p&gt;I did several checks and the error actually comes from the discovering part i&amp;#39;m checking if the type is BLE_DB_DISCOVERY_COMPLETE and the type found is&amp;nbsp;BLE_DB_DISCOVERY_SRV_NOT_FOUND.&lt;/p&gt;
&lt;p&gt;This error happened even though the uuid has been found correcly.&lt;/p&gt;
&lt;p&gt;I tried to add the UUID to the softdevice but i still get the same error.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;uint32_t ble_dfu_c_init(ble_dfu_c_t * p_ble_dfu_c)&lt;br /&gt;{&lt;br /&gt; uint32_t err_code;&lt;/p&gt;
&lt;p&gt;ble_uuid_t dfu_uuid;&lt;br /&gt; ble_uuid128_t dfu_base_uuid = DFU_UUID_BASE;&lt;br /&gt; &lt;br /&gt; uint8_t nordic_base_uuid_type;&lt;/p&gt;
&lt;p&gt;VERIFY_PARAM_NOT_NULL(p_ble_dfu_c);&lt;br /&gt; &lt;br /&gt; err_code = sd_ble_uuid_vs_add(&amp;amp;dfu_base_uuid, &amp;amp;nordic_base_uuid_type);&lt;br /&gt; VERIFY_SUCCESS(err_code);&lt;br /&gt; &lt;br /&gt; dfu_uuid.type = nordic_base_uuid_type;&lt;br /&gt; dfu_uuid.uuid = BLE_DFU_SERVICE_UUID;&lt;br /&gt; &lt;br /&gt; err_code = sd_ble_gatts_service_add(BLE_GATTS_SRVC_TYPE_PRIMARY,&lt;br /&gt; &amp;amp;dfu_uuid,&lt;br /&gt; &amp;amp;(p_ble_dfu_c-&amp;gt;conn_handle));&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; return ble_db_discovery_evt_register(&amp;amp;dfu_uuid);&lt;br /&gt; &lt;br /&gt;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU master from central</title><link>https://devzone.nordicsemi.com/thread/136180?ContentTypeID=1</link><pubDate>Thu, 14 Jun 2018 12:57:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae5087ed-236a-43c9-978d-8c6ab633bd85</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Do you do any filtering of the discovered database before you check the characteristic count? I&amp;#39;m wondering if there could be UUID/ UUID type mismatch that makes your callback ignore the discovered characteristics. Could you place a breakpoint at the beginning of your &amp;quot;ble_nus_c_on_db_disc_evt&amp;quot; callback and check if&amp;nbsp;p_evt-&amp;gt;params.discovered_db.char_count is 0 after the DFU service have been discovered?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>