<?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>send data to different Characteristic</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/68852/send-data-to-different-characteristic</link><description>I have one service two TX Characteristic(not the same name) one RX Characteristic 
 than how to send data to different TX Characteristic?</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 01 Dec 2020 16:29:17 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/68852/send-data-to-different-characteristic" /><item><title>RE: send data to different Characteristic</title><link>https://devzone.nordicsemi.com/thread/282741?ContentTypeID=1</link><pubDate>Tue, 01 Dec 2020 16:29:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f5381a81-41dd-40df-8efc-b75e58b40fba</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Take a look at the tutorial&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/nordic/short-range-guides/b/bluetooth-low-energy/posts/ble-characteristics-a-beginners-tutorial"&gt;Bluetooth low energy Characteristics, a beginner&amp;#39;s tutorial&lt;/a&gt;, which gives a good introduction to characteristics in the nRF5 SDK. Be aware that it was written using SDK 15, and there has been some changes in the API since then.&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;But let&amp;#39;s try to answer your quesiton:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;When you add the characteristics, using&amp;nbsp;characteristic_add(),&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;E.g. take a look at&amp;nbsp;SDK\components\ble\ble_services\ble_nus\ble_nus.c--&amp;gt;ble_nus_init()--&amp;gt;&lt;span&gt;characteristic_add&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;p_nus&lt;/span&gt;&lt;span&gt;-&amp;gt;&lt;/span&gt;&lt;span&gt;service_handle&lt;/span&gt;&lt;span&gt;,&amp;nbsp;&amp;amp;add_char_params,&amp;nbsp;&amp;amp;&lt;/span&gt;&lt;span&gt;p_nus&lt;/span&gt;&lt;span&gt;-&amp;gt;&lt;/span&gt;&lt;span&gt;tx_handles&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;span&gt;you&amp;#39;re providing the characteristic handles as the third argument.&amp;nbsp;You should create two instances of this type (e.g.&amp;nbsp;&lt;/span&gt;&lt;code&gt;&lt;span&gt;ble_gatts_char_handles_t tx_handles_1;&amp;nbsp;ble_gatts_char_handles_t tx_handles_2;&lt;/span&gt;&lt;/code&gt;).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In order to write to the TX characteristic number 1 you should do something like this:&amp;nbsp;&lt;span&gt;sd_ble_gatts_hvx&lt;/span&gt;&lt;span&gt;(conn_handle,&amp;nbsp;&amp;amp;tx_handles_1).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Of course you should set all the fields of the handle before using it. Take a look at the function &lt;em&gt;components\ble\ble_services\ble_nus\ble_nus.c--&amp;gt;&lt;/em&gt;&lt;/span&gt;&lt;em&gt;ble_nus_data_send()--&amp;gt; sd_ble_gatts_hvx()&lt;/em&gt; for guidance how to go about this.&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: send data to different Characteristic</title><link>https://devzone.nordicsemi.com/thread/282369?ContentTypeID=1</link><pubDate>Mon, 30 Nov 2020 05:58:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9b5ae764-83d4-47f3-85cf-012169d62ba4</guid><dc:creator>layson0112</dc:creator><description>&lt;p&gt;&lt;span&gt;Hi I Simon have check, we use&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fstruct_sdk%2Fstruct%2Fsdk_nrf5_latest.html&amp;amp;cp=7_1"&gt;nRF5 SDK&lt;/a&gt;&amp;nbsp;now&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: send data to different Characteristic</title><link>https://devzone.nordicsemi.com/thread/282347?ContentTypeID=1</link><pubDate>Sat, 28 Nov 2020 20:13:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a2bc79df-809d-4bdc-8285-3cbda4a995e4</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;Are you using the&lt;a href="http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/index.html"&gt; nRF Connect SDK&lt;/a&gt; or the &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fstruct_sdk%2Fstruct%2Fsdk_nrf5_latest.html&amp;amp;cp=7_1"&gt;nRF5 SDK&lt;/a&gt;? Once you tell me that I can tell you how to go about this.&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>