<?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>Error 0x00003002 while sending a notification</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/47525/error-0x00003002-while-sending-a-notification</link><description>Hi, 
 Using nRF52840 with SDK15.0.0. 
 I started my projetc based on BLE tutorial characteristics. 
 I created my service and add 2 characteristics successfully. 
 My module is advertising and i can see its characteristics correctly. 
 One charac is CHARACTERISTIC_READER_RESULT</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 23 May 2019 15:50:16 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/47525/error-0x00003002-while-sending-a-notification" /><item><title>RE: Error 0x00003002 while sending a notification</title><link>https://devzone.nordicsemi.com/thread/188901?ContentTypeID=1</link><pubDate>Thu, 23 May 2019 15:50:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:58a3002e-e2e4-485d-b783-b496be571d77</guid><dc:creator>Geoffroy</dc:creator><description>&lt;p&gt;i add this :&amp;nbsp;&lt;/p&gt;
&lt;p&gt;sd_ble_gatts_sys_attr_set(p_our_service-&amp;gt;conn_handle, NULL, 0, 0)&amp;nbsp;&lt;/p&gt;
&lt;p&gt;at beginning of my notification function to correct &amp;quot;system attribute missing&amp;quot;,&lt;/p&gt;
&lt;p&gt;right now i have err : 0x00000008 for&amp;nbsp;NRF_ERROR_INVALID_STATE.&lt;/p&gt;
&lt;p&gt;EDIT I changed emplacement where i call notification&lt;/p&gt;
&lt;p&gt;NOTIFICATIONS are now working&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error 0x00003002 while sending a notification</title><link>https://devzone.nordicsemi.com/thread/188813?ContentTypeID=1</link><pubDate>Thu, 23 May 2019 12:02:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a3b6b3e-ac28-4f2e-b3ca-21117c82f354</guid><dc:creator>Geoffroy</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I juste used and compile ble_app_blinky (exemple code nothing from me except traces).&lt;/p&gt;
&lt;p&gt;This code is compiling and advertising, i can see characteristics with nRFconnect app.&lt;/p&gt;
&lt;p&gt;but notification don&amp;#39;t work, and i get err_code 0x00003401 ...&lt;/p&gt;
&lt;p&gt;maybe is there a problem in my definitions ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;EDIT in error, 01 stands for system attribute missing&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error 0x00003002 while sending a notification</title><link>https://devzone.nordicsemi.com/thread/188541?ContentTypeID=1</link><pubDate>Wed, 22 May 2019 11:57:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f6bc5f05-2160-4842-8719-038640ca4ded</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;&lt;span&gt;ble_app_blinky&amp;nbsp;support notifications, check out ble_lbs.c&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Your error code is:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;* @retval ::NRF_ERROR_DATA_SIZE Invalid data size(s) supplied.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;br /&gt;Kenneth&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error 0x00003002 while sending a notification</title><link>https://devzone.nordicsemi.com/thread/188539?ContentTypeID=1</link><pubDate>Wed, 22 May 2019 11:49:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cd0f3122-d70f-4ecb-95d9-0a15c2d0a530</guid><dc:creator>Geoffroy</dc:creator><description>&lt;p&gt;i increased len : len = 15; (instead of len = 10).&lt;/p&gt;
&lt;p&gt;right now err_code (from sd_ble_gatts_hvx) is 0x0000000C do you know what does it stand for ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error 0x00003002 while sending a notification</title><link>https://devzone.nordicsemi.com/thread/188493?ContentTypeID=1</link><pubDate>Wed, 22 May 2019 09:33:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:136ceae0-6cc2-418b-a0a5-4c82b1580924</guid><dc:creator>Geoffroy</dc:creator><description>&lt;p&gt;Hum ble_app_blinky seems to don&amp;#39;t use notifications...&lt;/p&gt;
&lt;p&gt;I started from tuto_charac.&lt;/p&gt;
&lt;p&gt;Because i have 2 characteristics, i changed the way i handle char_handles :&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;typedef struct
{
    uint16_t                    conn_handle;    /**&amp;lt; Handle of the current connection (as provided by the BLE stack, is BLE_CONN_HANDLE_INVALID if not in a connection).*/
    uint16_t                    service_handle; /**&amp;lt; Handle of Our Service (as provided by the BLE stack). */
    // OUR_JOB: Step 2.D, Add handles for the characteristic attributes to our struct
    //ble_gatts_char_handles_t char_handles;
    ble_gatts_char_handles_t first_char_handles;
    ble_gatts_char_handles_t second_char_handles;
}ble_os_t;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Then i checked, right now&amp;nbsp;hvx_params.handle that&amp;nbsp;value_handle after&amp;nbsp;sd_ble_gatts_characteristic_add.&lt;/p&gt;
&lt;p&gt;now err_code is 0x00003401.&lt;/p&gt;
&lt;p&gt;here is how i create my charac :&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;ble_uuid_t          char_uuid_2;
	char_uuid_2.uuid      = BLE_UUID_CHARACTERISTIC_READER_RESULT;
	err_code = sd_ble_uuid_vs_add(&amp;amp;base_uuid, &amp;amp;char_uuid_2.type);
	APP_ERROR_CHECK(err_code);
    
    // OUR_JOB: Step 2.F Add read/write properties to our characteristic
    ble_gatts_char_md_t char_md_2;
    memset(&amp;amp;char_md_2, 0, sizeof(char_md_2));
    char_md_2.char_props.read = 1;
    char_md_2.char_props.write = 1;

    
    // OUR_JOB: Step 3.A, Configuring Client Characteristic Configuration Descriptor metadata and add to char_md structure
    ble_gatts_attr_md_t cccd_md_2;
    memset(&amp;amp;cccd_md_2, 0, sizeof(cccd_md_2));
	BLE_GAP_CONN_SEC_MODE_SET_OPEN(&amp;amp;cccd_md_2.read_perm);
	BLE_GAP_CONN_SEC_MODE_SET_OPEN(&amp;amp;cccd_md_2.write_perm);
	cccd_md_2.vloc                = BLE_GATTS_VLOC_STACK;
	char_md_2.p_cccd_md           = &amp;amp;cccd_md_2;
	char_md_2.char_props.notify   = 1;


    
    // OUR_JOB: Step 2.B, Configure the attribute metadata
    ble_gatts_attr_md_t attr_md_2;
    memset(&amp;amp;attr_md_2, 0, sizeof(attr_md_2));  
	attr_md_2.vloc        = BLE_GATTS_VLOC_STACK;
    
    
    // OUR_JOB: Step 2.G, Set read/write security levels to our characteristic
	BLE_GAP_CONN_SEC_MODE_SET_OPEN(&amp;amp;attr_md_2.read_perm);
	BLE_GAP_CONN_SEC_MODE_SET_OPEN(&amp;amp;attr_md_2.write_perm);

    // OUR_JOB: Step 2.C, Configure the characteristic value attribute
    ble_gatts_attr_t    attr_char_value_2;
    memset(&amp;amp;attr_char_value_2, 0, sizeof(attr_char_value_2));
	attr_char_value_2.p_uuid      = &amp;amp;char_uuid_2;
	attr_char_value_2.p_attr_md   = &amp;amp;attr_md_2;


	SEGGER_RTT_printf(0, &amp;quot;value handle dans char_add 1A : 0x%#08x\n&amp;quot;, p_our_service-&amp;gt;second_char_handles.value_handle);
    // OUR_JOB: Step 2.H, Set characteristic length in number of bytes
	attr_char_value_2.max_len     = 10;
	attr_char_value_2.init_len    = 10;
	uint8_t value_2[10]            = {0x44,0x6f,0x6e,0x65,0x44,0x6f,0x6e,0x65,0x44,0x6f};
	//uint8_t value_2[10];
	attr_char_value_2.p_value     = value_2;
    // OUR_JOB: Step 2.E, Add our new characteristic to the service
	err_code = sd_ble_gatts_characteristic_add(p_our_service-&amp;gt;service_handle,
                               &amp;amp;char_md_2,
                               &amp;amp;attr_char_value_2,
                               &amp;amp;p_our_service-&amp;gt;second_char_handles);
	APP_ERROR_CHECK(err_code);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;so it looks like hvx_params.handle is right and i support notification ...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error 0x00003002 while sending a notification</title><link>https://devzone.nordicsemi.com/thread/188434?ContentTypeID=1</link><pubDate>Wed, 22 May 2019 07:50:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c3de816f-abea-4428-86d6-38dfaf775a92</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;&lt;span&gt;You may also find&amp;nbsp;\examples\ble_peripheral\ble_app_blinky useful as reference.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If you call&amp;nbsp;sd_ble_gatts_hvx() and the return error code is:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;* @retval ::BLE_ERROR_GATTS_INVALID_ATTR_TYPE Invalid attribute type(s) supplied, only characteristic values may be notified and indicated.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Then I think either hvx_params.handle is wrong (maybe it&amp;#39;s not the correct handle to the characteristic that can notify values), or the handle you are using is pointing to a characteristic that don&amp;#39;t support notifications (char_props.notify).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error 0x00003002 while sending a notification</title><link>https://devzone.nordicsemi.com/thread/188280?ContentTypeID=1</link><pubDate>Tue, 21 May 2019 13:01:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:43cd2586-d68f-49ed-ba28-8b86f1f67c7a</guid><dc:creator>Geoffroy</dc:creator><description>&lt;p&gt;Thank you Kenneth,&lt;/p&gt;
&lt;p&gt;I tryed to notify before my gatt is connected.&lt;/p&gt;
&lt;p&gt;so right now i call this notification function after connection.&lt;/p&gt;
&lt;p&gt;now i get err_code 0x00003400 which stand for&amp;nbsp;&amp;nbsp;BLE_ERROR_GATTS_INVALID_ATTR_TYPE (with NRF_GATTS_ERR_BASE).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;i don&amp;#39;t know where is the problem, here i have :&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;// Use UUIDs for service(s) used in your application.
static ble_uuid_t m_adv_uuids[] =                                               /**&amp;lt; Universally unique service identifiers. */
{
	{BLE_UUID_OUR_SERVICE_UUID, BLE_UUID_TYPE_BLE}
	{BLE_UUID_OUR_SERVICE_UUID, BLE_UUID_TYPE_VENDOR_BEGIN}//originaly but don&amp;#39;t advertise
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;here if i declare&amp;nbsp;BLE_UUID_TYPE_VENDOR_BEGIN for ble_uuid_t type, my module doesn&amp;#39;t advertise&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error 0x00003002 while sending a notification</title><link>https://devzone.nordicsemi.com/thread/188164?ContentTypeID=1</link><pubDate>Tue, 21 May 2019 09:11:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a981ac90-8119-4d01-9080-ff090f12c653</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;I assume you have updated the connection handle, e.g. somewhere along the lines of:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void ble_evt_handler(ble_evt_t const * p_ble_evt, void * p_context)
{
    ret_code_t err_code;

    switch (p_ble_evt-&amp;gt;header.evt_id)
    {
        case BLE_GAP_EVT_CONNECTED:
            p_our_service-&amp;gt;conn_handle = p_ble_evt-&amp;gt;evt.gap_evt.conn_handle;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Typically the value is 0 on first connection.&lt;/p&gt;
&lt;p&gt;You may also find&amp;nbsp;\examples\ble_peripheral\ble_app_blinky useful as reference.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>