<?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>How to send some data from multilink peripheral to multilink central?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/8630/how-to-send-some-data-from-multilink-peripheral-to-multilink-central</link><description>I have three pca10001 boards. One is programmed as multilink central and other is programmed as multilink peripheral. when both peripherals are connected to central, the central detects them both seperately but shows the same device id of both the peripherals</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 17 Aug 2015 11:58:04 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/8630/how-to-send-some-data-from-multilink-peripheral-to-multilink-central" /><item><title>RE: How to send some data from multilink peripheral to multilink central?</title><link>https://devzone.nordicsemi.com/thread/31575?ContentTypeID=1</link><pubDate>Mon, 17 Aug 2015 11:58:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d383bd4-851f-4833-b2ae-7c2f938ca348</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Great! Then I would appreciate if you could accept my answer by clicking the grey circle with a check mark in it, next to my answer. For more information, please take our &lt;a href="https://devzone.nordicsemi.com/tour/"&gt;tour&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to send some data from multilink peripheral to multilink central?</title><link>https://devzone.nordicsemi.com/thread/31574?ContentTypeID=1</link><pubDate>Sat, 15 Aug 2015 06:04:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:35ef77e9-9863-4e37-a511-3b0d009d019e</guid><dc:creator>Hamza</dc:creator><description>&lt;p&gt;okay somehow petter from your help, i have managed to accomplish my task.. Thanks alot Petter :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to send some data from multilink peripheral to multilink central?</title><link>https://devzone.nordicsemi.com/thread/31573?ContentTypeID=1</link><pubDate>Fri, 14 Aug 2015 10:35:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:959efc2e-3c59-4237-9ba5-c697e963cb17</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;When you get BLE_GAP_EVT_CONNECTED the connection handle is in p_ble_evt-&amp;gt;evt.gap_evt.conn_handle when you get the BLE_GATTC_EVT_HVX event the connection handle is in p_ble_evt-&amp;gt;evt.gattc_evt.conn_handle&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to send some data from multilink peripheral to multilink central?</title><link>https://devzone.nordicsemi.com/thread/31572?ContentTypeID=1</link><pubDate>Thu, 13 Aug 2015 15:49:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3206f221-b3cd-47de-8e6c-48c91fc125ee</guid><dc:creator>Hamza</dc:creator><description>&lt;p&gt;and I also I am so much thankful for your long positive response..&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to send some data from multilink peripheral to multilink central?</title><link>https://devzone.nordicsemi.com/thread/31571?ContentTypeID=1</link><pubDate>Thu, 13 Aug 2015 15:49:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6854a2df-9a91-4376-9e02-8064228efebf</guid><dc:creator>Hamza</dc:creator><description>&lt;p&gt;please tell me, how to compare connection handles in on_evt_hvx() in client_handling.c ??&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to send some data from multilink peripheral to multilink central?</title><link>https://devzone.nordicsemi.com/thread/31570?ContentTypeID=1</link><pubDate>Wed, 12 Aug 2015 09:42:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:67dd2080-c560-41f3-800e-e2a80e41a091</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Ok. So device ID is the address. You have only defined one set of variables in main.c. You will get the DM_EVT_CONNECTION twice. Once on connection with the first device, its address will be set to your set of variables. Second on connection with the second device, its address will overwrite your set of variables. You need two sets of variables if you have two devices and set one address to each of them. As you have understood the address is not included in the BLE_GATTC_EVT_HVX event, so you need some other way of identifying which device address the event belongs to. As you can see in client_handling_ble_evt_handler() it uses client_find(p_ble_evt-&amp;gt;evt.gattc_evt.conn_handle) to find the index, i.e. which device/client the event comes from. It accomplishes this by comparing the connection handle of the event with the connection handles in m_client[i].srv_db.conn_handle. Connection handle is what you should use to identify which device the event belongs to, so you should also tie the connection handles to the devices addresses.&lt;/p&gt;
&lt;p&gt;You could:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Declare a struct with a set of variables to store the address and one variable to store the connection handle. Or use some other way to tie the connection handle to the device address.&lt;/li&gt;
&lt;li&gt;Add two defines of this struct. When you get the first DM_EVT_CONNECTION you add the address and the connection handle to one of them, when you get the second you add the address and the connection handle to the other.&lt;/li&gt;
&lt;li&gt;Then in on_evt_hvx() or somewhere else, you compare the connection handle of the event to the connection handles in your two structs. If you get a match you print out the address, and the status of the LED contained in p_ble_evt-&amp;gt;evt.gattc_evt.params.hvx.data[0].&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;You don&amp;#39;t have to this through client_handling_ble_evt_handler() you can add your own event handler in ble_evt_dispatch() in main.c and then do everything there, or do it directly in ble_evt_dispatch(). The events from the SoftDevice are sent to all the events handlers in ble_evt_dispatch().&lt;/p&gt;
&lt;p&gt;Many ways of solving this, but the main point is that you need to use the connection handle to identify the client/device.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to send some data from multilink peripheral to multilink central?</title><link>https://devzone.nordicsemi.com/thread/31569?ContentTypeID=1</link><pubDate>Tue, 11 Aug 2015 15:16:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:788abd74-bbdd-4659-af45-2ba73f45ef71</guid><dc:creator>Hamza</dc:creator><description>&lt;p&gt;I hope you will get it now.. I want the different device ids.. or something unique data which distinguish both the peripherals.. please help&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to send some data from multilink peripheral to multilink central?</title><link>https://devzone.nordicsemi.com/thread/31568?ContentTypeID=1</link><pubDate>Tue, 11 Aug 2015 15:09:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d1c2bee1-007b-4fb8-9d68-6d382ddbc604</guid><dc:creator>Hamza</dc:creator><description>&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/3704.1.png" alt="image description" /&gt;
In main.c file of multilink_Cenral. first i defined global variables..&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/7462.2.png" alt="image description" /&gt;
then i assigned my global variables values of p_peer_addrs.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/5327.3.png" alt="image description" /&gt;
now i am in the file of client_handling.c .. i defined those variables as extern in it.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/2630.4.png" alt="image description" /&gt;
finally i printed the variables which contain the device id.. with 1 and 0. if led is on, the output is something like this, 5BE4=1 , and when LED is off, the output is 5BE4=0. for one board as a peripheral it is perfect.&lt;/p&gt;
&lt;p&gt;the problem is when I connect the two boards as peripheral, i get the same device id of both which is not I want.. I want different device id of both..&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to send some data from multilink peripheral to multilink central?</title><link>https://devzone.nordicsemi.com/thread/31567?ContentTypeID=1</link><pubDate>Tue, 11 Aug 2015 11:17:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3a40dc87-2134-413c-a2b4-9dc797a8be8a</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;I&amp;#39;m having trouble understanding you. Could you include some code that shows what you are doing? By device id, do you mean the index in m_client? And by status do you mean if the LED number index is on or off? Or the state?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to send some data from multilink peripheral to multilink central?</title><link>https://devzone.nordicsemi.com/thread/31566?ContentTypeID=1</link><pubDate>Mon, 10 Aug 2015 18:14:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fef82334-e34e-4797-a9ac-a09fbe487683</guid><dc:creator>Hamza</dc:creator><description>&lt;p&gt;okay i am telling you current situation now.. in main.c of multilink central program, when both the peripherals are connected , it shows the different device ids of both peripherals. but what i want is the status of led of peripheral as well which is handled in client_handling.c &amp;quot;on_evt_hvx&amp;quot; function. I want both the device id and status of peripherals. So what i did I made extern variable and used the device id which is showing in main.c in client_handling.c. then I am getting the same device ids of both peripherals which is not i want. please help me. I shall be thankful to you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to send some data from multilink peripheral to multilink central?</title><link>https://devzone.nordicsemi.com/thread/31565?ContentTypeID=1</link><pubDate>Mon, 10 Aug 2015 18:07:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ef6a1242-787b-4e13-91bc-f5571bc1fbb9</guid><dc:creator>Hamza</dc:creator><description>&lt;p&gt;I apologise I misunderstood..
i am using V6.x.x&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to send some data from multilink peripheral to multilink central?</title><link>https://devzone.nordicsemi.com/thread/31564?ContentTypeID=1</link><pubDate>Mon, 10 Aug 2015 12:35:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c48eec87-5a83-46e0-b0c4-3f46a7be202a</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Keil is not a SDK. Which of &lt;a href="http://developer.nordicsemi.com/nRF51_SDK/"&gt;these&lt;/a&gt; SDKs are you using?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to send some data from multilink peripheral to multilink central?</title><link>https://devzone.nordicsemi.com/thread/31563?ContentTypeID=1</link><pubDate>Mon, 10 Aug 2015 12:22:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ac23f127-5b86-43d8-a5df-b08327160172</guid><dc:creator>Hamza</dc:creator><description>&lt;p&gt;i am using keil&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to send some data from multilink peripheral to multilink central?</title><link>https://devzone.nordicsemi.com/thread/31562?ContentTypeID=1</link><pubDate>Mon, 10 Aug 2015 11:29:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0b4a3b90-657e-40f4-a6bf-ab47db2b5f03</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;What SDK version are you using?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>