<?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>Bluetooth value reading and writing problem.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/52906/bluetooth-value-reading-and-writing-problem</link><description>I managed to set the UUID section on my own, but I&amp;#39;m having trouble reading and writing some data. I&amp;#39;m changing the on_write function in Ble_nus.c, but I can&amp;#39;t get results. Tell me where I&amp;#39;m wrong. 
 ble_nus.c 
 
 
 NORDIC HM-10 
 
 I want to make a UUID</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 08 Oct 2019 13:51:46 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/52906/bluetooth-value-reading-and-writing-problem" /><item><title>RE: Bluetooth value reading and writing problem.</title><link>https://devzone.nordicsemi.com/thread/213952?ContentTypeID=1</link><pubDate>Tue, 08 Oct 2019 13:51:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4b64c88f-44b6-4f9d-9a12-f80d6ab0860a</guid><dc:creator>aliyolcu28</dc:creator><description>&lt;p&gt;i will try and return. thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth value reading and writing problem.</title><link>https://devzone.nordicsemi.com/thread/213938?ContentTypeID=1</link><pubDate>Tue, 08 Oct 2019 13:24:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:50bb7b51-4238-4673-851c-7f4c7e6024ff</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I modified the ble &lt;em&gt;ble_nus_init(..)&lt;/em&gt; function in the ble_nus.c library in the following manner:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;memset(&amp;amp;add_char_params, 0, sizeof(add_char_params));
    add_char_params.uuid                     = BLE_UUID_NUS_RX_CHARACTERISTIC;
    add_char_params.uuid_type                = p_nus-&amp;gt;uuid_type;
    add_char_params.max_len                  = BLE_NUS_MAX_RX_CHAR_LEN;
    add_char_params.init_len                 = sizeof(uint8_t);
    add_char_params.is_var_len               = true;
    add_char_params.char_props.write         = 1;
    add_char_params.char_props.write_wo_resp = 1;

    add_char_params.char_props.read         = 1; //Added
    add_char_params.char_props.notify = 1;       //Added


    add_char_params.read_access  = SEC_OPEN;
    add_char_params.write_access = SEC_OPEN;
    add_char_params.cccd_write_access = SEC_OPEN; //Added

    err_code = characteristic_add(p_nus-&amp;gt;service_handle, &amp;amp;add_char_params, &amp;amp;p_nus-&amp;gt;rx_handles);
&lt;/pre&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I modified the RX characterstics, but you can change to UUID to whatever you would like&lt;/li&gt;
&lt;li&gt;Now you are able to read from it and write to it (with and without response)&lt;/li&gt;
&lt;li&gt;In order to notify the characteristic value to a central device, you need to use the function&amp;nbsp;&lt;em&gt;sd_ble_gatts_hvx(..)&lt;/em&gt;
&lt;ul&gt;
&lt;li&gt;Tell me if you want to elaborate more on this function&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;I would recommend you to not modify the ble_nus.c library directly, but instead create a copy (e.g. ble_nus2.c) since you may want to use this library with other projects, then you include the copied library in the Project Explorer window as shown below:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/800x600/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-9a970cbff60143869d4c2e8c95c20c1f/pastedimage1570541060656v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth value reading and writing problem.</title><link>https://devzone.nordicsemi.com/thread/213779?ContentTypeID=1</link><pubDate>Tue, 08 Oct 2019 05:38:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c974e69b-f8aa-45e6-8cb1-b87ad9ba3bce</guid><dc:creator>aliyolcu28</dc:creator><description>&lt;p&gt;Yes,&amp;nbsp;I want to create a UUID that contains exactly NOTIFY, READ, WRITE &lt;span&gt;&amp;nbsp;and WRITE NO RESPONSE&lt;/span&gt;, and send and receive data over this ID.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth value reading and writing problem.</title><link>https://devzone.nordicsemi.com/thread/213647?ContentTypeID=1</link><pubDate>Mon, 07 Oct 2019 12:26:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d6b27c70-a1c0-443b-918e-6d01c406703c</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Do I understand you correctly? You want to create a single characteristic with the properties NOTIFY, READ, WRITE and WRITE NO RESPONSE?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>