<?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>Data transmission method by &amp;quot;Write&amp;quot; from central to multi-role</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/53149/data-transmission-method-by-write-from-central-to-multi-role</link><description>Hello. I am developing with reference to multi-roll and central sample projects. One of the functions I want to implement is to send data from central to multi-role. 
 
 How to send data ・ Notify ・ Read ・ Write I think that there are three, but because</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 24 Oct 2019 15:43:09 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/53149/data-transmission-method-by-write-from-central-to-multi-role" /><item><title>RE: Data transmission method by "Write" from central to multi-role</title><link>https://devzone.nordicsemi.com/thread/216680?ContentTypeID=1</link><pubDate>Thu, 24 Oct 2019 15:43:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:28580d8b-5cb5-4bfc-b863-daa7b435a828</guid><dc:creator>Simon</dc:creator><description>[quote user="Kova"]3. Select some of the device information received on the central module side and execute “Write” to the multi-roll module[/quote]
&lt;p&gt;There are different ways of achieving this, one way is to simply create one service with two characteristics on the multirole side. Call&amp;nbsp;&lt;em&gt;sd_ble_gatts_service_add(..)&lt;/em&gt; only once, and call&amp;nbsp;&lt;em&gt;characteristic_add(..&lt;/em&gt;) two times after that, using the service handle. For&amp;nbsp;the first&amp;nbsp;characteristic, you enable notifications (for sending data from multirole to central). For the other characteristic, you only enable the write property (for sending data from central to multirole). Then you end up with something like this:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/1280x960/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-bb5fdc42e07d41ef9d841d1d9fa375ec/pastedimage1571931383842v2.png" /&gt;&lt;/p&gt;
&lt;p&gt;You can also create a service with only one characteristic, like endnode is arguing for &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/22246/best-way-to-send-data-from-many-sensors"&gt;here&lt;/a&gt;.&amp;nbsp;Then you use&amp;nbsp;that characteristic&amp;nbsp;to transfer data both ways, which require you to add both the notify and&amp;nbsp;the write property to that characteristic.&lt;/p&gt;
&lt;p&gt;I think this you are&amp;nbsp;trying to implement the last approach. But you should &lt;strong&gt;&lt;span style="text-decoration:underline;"&gt;NOT&lt;/span&gt;&lt;/strong&gt;&lt;span style="text-decoration:underline;"&gt;&lt;/span&gt; use the CCCD to transfer data from the central (client) to the multirole (server).&amp;nbsp; You should &lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;ONLY&lt;/strong&gt;&lt;/span&gt;&amp;nbsp;write to the CCCD if you want to enable/disable notifications/indications for a characteristic. Which will enable/disable a server to notify/indicate the associated characteristic value to the client. If you are only using one characterstics (with notify and write property) you should &lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;use the characteristic handle&lt;/strong&gt;&lt;/span&gt; when sending data (WRITE) from the central to the multirole, and &lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;NOT&lt;/strong&gt;&lt;/span&gt; the cccd handle. I would recommend you to read through the &lt;a href="https://devzone.nordicsemi.com/nordic/short-range-guides/b/bluetooth-low-energy/posts/ble-characteristics-a-beginners-tutorial"&gt;BLE Characteristic Tutorial&lt;/a&gt;, which explains this in more detail.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;
&lt;div style="left:463px;top:657.667px;"&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Data transmission method by "Write" from central to multi-role</title><link>https://devzone.nordicsemi.com/thread/216546?ContentTypeID=1</link><pubDate>Thu, 24 Oct 2019 09:18:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51a0071f-5974-4a1b-a36d-1e52025e039b</guid><dc:creator>Kova</dc:creator><description>&lt;p&gt;Hello, Simon.&lt;br /&gt;Sorry for the late reply.&lt;br /&gt;I was doing another task in parallel. It has not been solved yet.&lt;br /&gt;What I want to do is:&lt;br /&gt;1. Multi-roll module scans peripheral module&lt;br /&gt;2. Send device information of the scanned peripheral module to the central module.&lt;br /&gt;3. Select some of the device information received on the central module side and execute &amp;ldquo;Write&amp;rdquo; to the multi-roll module&lt;br /&gt;4. The received multi-role module connects to the peripheral module that matches the received data.&lt;br /&gt;is.&lt;/p&gt;
&lt;p&gt;This time I want to implement the contents of No.3.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Data transmission method by "Write" from central to multi-role</title><link>https://devzone.nordicsemi.com/thread/215917?ContentTypeID=1</link><pubDate>Mon, 21 Oct 2019 12:21:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:516d3f1e-b405-42c0-b115-7083f6c1ec2b</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;I am not able to recreate your error. Could you explain how to&amp;nbsp;recreate your error or upload a minimal example? However, as mention earlier, it is not the intention to send any other values than 0x00,&amp;nbsp;&lt;span&gt;0x01 or&amp;nbsp;0x02 to the CCCD. Can you explain what your goal is? What are you trying to achieve with this?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Simon&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Data transmission method by "Write" from central to multi-role</title><link>https://devzone.nordicsemi.com/thread/215021?ContentTypeID=1</link><pubDate>Tue, 15 Oct 2019 10:13:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:31343d75-7dd3-4ba4-81ea-17d4b889c016</guid><dc:creator>Kova</dc:creator><description>&lt;p&gt;Hello Simon.&lt;br /&gt;When I tried debugging, it was a problem before &amp;quot;sd_ble_gattc_write (..)&amp;quot;. The place that is frozen is &amp;quot;BLE_GATTC_EVT_READ_RSP&amp;quot; in &amp;quot;gatt_cache_manager.c&amp;quot;. The cause of the exception was &amp;quot;HardFault&amp;quot;.&lt;br /&gt;In addition to the length specification, this phenomenon may have occurred in the contents of 2-character text data. For example.&lt;br /&gt;len = 2, p_value = &amp;quot;es&amp;quot; &amp;rArr;success&lt;br /&gt;len = 2, p_value = &amp;quot;ts&amp;quot; &amp;rArr;failure&lt;br /&gt;We are currently investigating the cause. If you have any advice, thank you.&lt;br /&gt;Also, what is the configuration of &amp;ldquo;ble_app_uart_c&amp;rdquo; that Mr. Simon tried?&lt;br /&gt;central&amp;rArr;ble_app_uart_c&lt;br /&gt;peripheral&amp;rArr;ble_app_uart&lt;/p&gt;
&lt;p&gt;Also, please tell us what content you changed and tested.&lt;br /&gt;Thank you.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/write_F8664D30BC8F7F30C730FC30BF3077959758A0524266D530EA30FC30BA30_7.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Data transmission method by "Write" from central to multi-role</title><link>https://devzone.nordicsemi.com/thread/214886?ContentTypeID=1</link><pubDate>Mon, 14 Oct 2019 14:13:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:30382c0d-2731-42bb-bcc5-ce03d41304ea</guid><dc:creator>Simon</dc:creator><description>[quote user=""]How to send 3 bytes or more data by Write?[/quote]
&lt;p&gt;You can do this by simply setting&amp;nbsp;write_params.len = 3. But I am curious to why the central device stops when you set len=4 and value=&amp;quot;test&amp;quot;. I tested this with the ble_app_uart_c example, and it worked fine. However, the CCCD value is supposed to be either&amp;nbsp;0x01 (notification) or&amp;nbsp;0x02 (indication), not &amp;quot;test&amp;quot;.&lt;/p&gt;
&lt;p&gt;Could you try to &lt;a href="https://www.youtube.com/watch?v=uP8RYgYGRvI&amp;amp;t=7s"&gt;debug your project&lt;/a&gt; and figure out why the project stops. What is the return value of&amp;nbsp;&lt;em&gt;sd_ble_gattc_write(..)&lt;/em&gt;?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]When using BLE_GATT_OP_WRITE_CMD as the method, which event is called on the multi-roll side (reception side)?&lt;br /&gt;please teach me. Thank you.[/quote]
&lt;p&gt;&amp;nbsp;Check out the message sequence charts for the server side (reception), where you will see what events will be generated after an &amp;quot;ATT Write Command&amp;quot;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s132.api.v7.0.1%2Fgroup___b_l_e___g_a_t_t_s___w_r_i_t_e___c_m_d___n_o___a_u_t_h___m_s_c.html"&gt;https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s132.api.v7.0.1%2Fgroup___b_l_e___g_a_t_t_s___w_r_i_t_e___c_m_d___n_o___a_u_t_h___m_s_c.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s132.api.v7.0.1%2Fgroup___b_l_e___g_a_t_t_s___w_r_i_t_e___r_e_q___a_u_t_h___m_s_c.html"&gt;https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s132.api.v7.0.1%2Fgroup___b_l_e___g_a_t_t_s___w_r_i_t_e___r_e_q___a_u_t_h___m_s_c.html&lt;/a&gt;&lt;/li&gt;
&lt;/ul&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>