<?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>On the issue of updating some Characteristics value parts</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/102657/on-the-issue-of-updating-some-characteristics-value-parts</link><description>Hi nordic, 
 During the use of the product, the characteristic values of some private services respond to the corresponding service characteristics after being written by the phone, and are processed in the Characteristichandle() processing function.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 10 Aug 2023 08:29:58 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/102657/on-the-issue-of-updating-some-characteristics-value-parts" /><item><title>RE: On the issue of updating some Characteristics value parts</title><link>https://devzone.nordicsemi.com/thread/440659?ContentTypeID=1</link><pubDate>Thu, 10 Aug 2023 08:29:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c4057c25-0040-4cca-97fa-f704d7340283</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please do.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Essentially you have to select your device in the Wireshark interface, connect to it from the phone, and then do the data exchange that will show the problem. Once the sniffer trace is complete you can stop the trace and save it to a file, which you can upload to this ticket.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: On the issue of updating some Characteristics value parts</title><link>https://devzone.nordicsemi.com/thread/440549?ContentTypeID=1</link><pubDate>Wed, 09 Aug 2023 14:55:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:511c53a0-8bdf-4d06-baef-b79dfcac56ef</guid><dc:creator>Mikey</dc:creator><description>&lt;p&gt;I will try using dongle to catch errors.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: On the issue of updating some Characteristics value parts</title><link>https://devzone.nordicsemi.com/thread/440535?ContentTypeID=1</link><pubDate>Wed, 09 Aug 2023 14:14:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0deb41d5-97d1-4425-a111-6ef7a0b9355f</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Would you be able to capture a Bluetooth sniffer trace of the exchange, when you send updates from the phone which are incorrectly processed on the nRF side?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you don&amp;#39;t have access to a professional Bluetooth sniffer it is possible to use a Nordic DK or dongle as a sniffer through the &lt;a href="https://www.nordicsemi.com/Products/Development-tools/nrf-sniffer-for-bluetooth-le"&gt;nRF Sniffer&lt;/a&gt; project.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: On the issue of updating some Characteristics value parts</title><link>https://devzone.nordicsemi.com/thread/440394?ContentTypeID=1</link><pubDate>Wed, 09 Aug 2023 04:10:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2915c954-a147-4eb3-944c-e04b8eaec113</guid><dc:creator>Mikey</dc:creator><description>&lt;p&gt;Hi，&lt;/p&gt;
&lt;p&gt;Thank you for your reply.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void writeAttrCallback(Profile_t *pProfile, ble_evt_t const *pBleEvent)
{
    ble_gatts_evt_write_t const *pEventWrite = &amp;amp;pBleEvent-&amp;gt;evt.gatts_evt.params.write;
    uint8_t characteristicId;

    if ((pEventWrite-&amp;gt;handle == pProfile-&amp;gt;uprequestHandle.cccd_handle) &amp;amp;&amp;amp; (pProfile-&amp;gt;ProfileCharWriteHandler != NULL))
    {
        characteristicId = PROFILE_CHAR_1;
        pProfile-&amp;gt;ProfileCharWriteHandler(pBleEvent-&amp;gt;evt.gap_evt.conn_handle, characteristicId,
                                                pProfile, pEventWrite-&amp;gt;data, pEventWrite-&amp;gt;len);
    }
    else if ((pEventWrite-&amp;gt;handle == pProfile-&amp;gt;pressureHandle.value_handle) &amp;amp;&amp;amp; (pProfile-&amp;gt;ProfileCharWriteHandler != NULL))
    {
        characteristicId = PROFILE_CHAR_2;
        pProfile-&amp;gt;ProfileCharWriteHandler(pBleEvent-&amp;gt;evt.gap_evt.conn_handle, characteristicId,
                                                pProfile, pEventWrite-&amp;gt;data, pEventWrite-&amp;gt;len);
    }
    else if ((pEventWrite-&amp;gt;handle == pProfile-&amp;gt;temperatureHandle.value_handle) &amp;amp;&amp;amp; (pProfile-&amp;gt;ProfileCharWriteHandler != NULL))
    {
        characteristicId = PROFILE_CHAR_3;
        pProfile-&amp;gt;ProfileCharWriteHandler(pBleEvent-&amp;gt;evt.gap_evt.conn_handle, characteristicId,
                                                pProfile, pEventWrite-&amp;gt;data, pEventWrite-&amp;gt;len);
    }
}

void Characteristichandle(ble_evt_t const *pBleEvent, void *pContext)
{
    LwsProfile_t *pProfile = (LwsProfile_t *)pContext;

    switch (pBleEvent-&amp;gt;header.evt_id)
    {
    case BLE_GATTS_EVT_WRITE:
        writeAttrCallback(pProfile, pBleEvent);
        break;

    case BLE_GAP_EVT_CONNECTED:
        lws_on_connect(pProfile, pBleEvent);
        break;

    case BLE_GAP_EVT_DISCONNECTED:
        lws_on_disconnect(pProfile, pBleEvent);
        break;
	
	case BLE_GATTS_EVT_HVN_TX_COMPLETE:
		//DPrintf(&amp;quot;BLE_GATTS_EVT_HVN_TX_COMPLETE\r\n&amp;quot;);
		break;

    default:
        // No implementation needed.
        break;
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Encapsulate our data receiving handle function in the Nordic routine, as shown in the above code.&lt;/p&gt;
&lt;p&gt;And PROFILE_ CHAR_ 1 and PROFILE_ CHAR_ 3 has data, while PROFILE_ CHAR_ 2 has no data, but it will enter the corresponding processing ID.&lt;br /&gt;It&amp;#39;s not always like this, PROFILE_ CHAR_ 2. Occasionally, there is no data available, but the corresponding data can be seen on both nrf connect reads and writes, and the corresponding ID cannot obtain its data.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: On the issue of updating some Characteristics value parts</title><link>https://devzone.nordicsemi.com/thread/440278?ContentTypeID=1</link><pubDate>Tue, 08 Aug 2023 10:34:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:278cb522-91d6-4a25-b5e6-9fa91763244e</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You mean to say the callback is triggered as expected on a write but the data is not available?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t think the Characteristichandle() function is one of the standard functions from our examples?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I assume it is triggered by the&amp;nbsp;BLE_GATTS_EVT_WRITE event from the SoftDevice?&amp;nbsp;&lt;br /&gt;Have you checked the exact contents of the event to see what it includes?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When the BLE_GATTS_EVT_WRITE event occurs you will typically get the event data like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;ble_gatts_evt_write_t const * p_evt_write = &amp;amp;p_ble_evt-&amp;gt;evt.gatts_evt.params.write;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Then you can check the various fields in the p_evt_write struct to process the data.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>