<?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>the pc-ble-driver - adapter question</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/61059/the-pc-ble-driver---adapter-question</link><description>Hi, 
 I&amp;#39;m using the the pc-ble-driver together with the nrf-ble-driver-4.1.1-win_x86_32 library and two nRF52840 dongles on two different COM ports.I&amp;#39;d like to clarify on how to properly use the library with two dongles. My assumtion is to use &amp;quot;adapter</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 12 May 2020 16:37:58 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/61059/the-pc-ble-driver---adapter-question" /><item><title>RE: the pc-ble-driver - adapter question</title><link>https://devzone.nordicsemi.com/thread/249551?ContentTypeID=1</link><pubDate>Tue, 12 May 2020 16:37:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:03f2091e-d197-4e12-b542-71ef9a4c22d9</guid><dc:creator>oneguy</dc:creator><description>&lt;p&gt;Perfect, thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: the pc-ble-driver - adapter question</title><link>https://devzone.nordicsemi.com/thread/249536?ContentTypeID=1</link><pubDate>Tue, 12 May 2020 15:04:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:339d1cf1-2d91-4c06-9a76-f28bbda2507f</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;adapter_t::internal is just a &lt;a href="https://github.com/NordicSemiconductor/pc-ble-driver/blob/master/include/common/adapter.h#L45-L48"&gt;void pointer&lt;/a&gt;, so technically you can assign whatever you want to it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: the pc-ble-driver - adapter question</title><link>https://devzone.nordicsemi.com/thread/249522?ContentTypeID=1</link><pubDate>Tue, 12 May 2020 14:27:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8ce11b5c-2829-4d57-9fa3-0b3fb7e6d340</guid><dc:creator>oneguy</dc:creator><description>&lt;p&gt;Thanks. Can I assign whatever I want to &amp;quot;internal&amp;quot;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: the pc-ble-driver - adapter question</title><link>https://devzone.nordicsemi.com/thread/249502?ContentTypeID=1</link><pubDate>Tue, 12 May 2020 13:39:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1276204a-010b-4943-885e-635df187deb4</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;adapter_t is just a temporary wrapper which is instantiated at the callback, you must use adapter-&amp;gt;internal to separate the different adapters. It will always point at the same address and should work for your use-case.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: the pc-ble-driver - adapter question</title><link>https://devzone.nordicsemi.com/thread/248844?ContentTypeID=1</link><pubDate>Fri, 08 May 2020 05:04:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3ee00391-d4b7-4b7a-be76-7a3ef98aaddd</guid><dc:creator>oneguy</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;J&amp;oslash;rgen,&lt;/p&gt;
&lt;p&gt;Thank you for your reply. The fact that one can use multiple adapters is already great news. The examples are a good starting point, however they use two separate functions (see below) instead of only one (my case).&amp;nbsp;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;strong&gt;c-&amp;gt;&lt;/strong&gt;setGapEventCallback([&amp;amp;](const uint16_t eventId, const ble_gap_evt_t *gapEvent) -&amp;gt; bool {&lt;br /&gt; switch (eventId)&lt;br /&gt; {&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;br /&gt; &lt;strong&gt;p-&amp;gt;&lt;/strong&gt;setGapEventCallback([&amp;amp;](const uint16_t eventId, const ble_gap_evt_t *gapEvent) {&lt;br /&gt; switch (eventId)&lt;br /&gt; {&lt;/p&gt;
&lt;p&gt;In my case I&amp;#39;d like to distinguish between &amp;quot;&lt;strong&gt;c&lt;/strong&gt;&amp;quot; and &amp;quot;&lt;strong&gt;p&lt;/strong&gt;&amp;quot; based on the function&amp;#39;s &amp;quot;&lt;strong&gt;*adapte&lt;/strong&gt;r&amp;quot; argument.&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;static void ble_evt_dispatch (adapter_t &lt;strong&gt;*adapter&lt;/strong&gt;, ble_evt_t *p_ble_evt)&lt;br /&gt;{&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;nbsp; &amp;nbsp; if (&lt;strong&gt;adapter == c&lt;/strong&gt;) ...&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&amp;nbsp; &amp;nbsp; if (&lt;strong&gt;adapter == p&lt;/strong&gt;) ...&lt;/p&gt;
&lt;p&gt;I find that the statement &amp;quot;if (&lt;strong&gt;adapter == c&lt;/strong&gt;)&amp;quot; won&amp;#39;t work and that I need to use &amp;quot;if (&lt;strong&gt;adapter-&amp;gt;internal == adapter-&amp;gt;internal&lt;/strong&gt;)&amp;quot; instead. Based on code in &amp;quot;test_util_adapter_wrapper.cpp&amp;quot; it even seems that I could use &amp;quot;&lt;span&gt;m_adapter-&amp;gt;&lt;/span&gt;&lt;span class="pl-smi"&gt;internal&amp;quot; for whatever I want...&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;From this discussion I&amp;#39;d like to find out how to do this properly.&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
&lt;p&gt;M&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: the pc-ble-driver - adapter question</title><link>https://devzone.nordicsemi.com/thread/248778?ContentTypeID=1</link><pubDate>Thu, 07 May 2020 14:51:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da4a0c85-5c54-49b5-8e7a-e338882a9d18</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Yes, it is correct that you can use multiple adapters with one pc-ble-driver application. We have this implemented in the &lt;a href="https://github.com/NordicSemiconductor/pc-ble-driver/tree/master/test"&gt;tests in pc-ble-driver repository&lt;/a&gt;, for instance, &lt;a href="https://github.com/NordicSemiconductor/pc-ble-driver/blob/master/test/softdevice_api/testcase_advertising.cpp#L63"&gt;this test&lt;/a&gt; uses two different adapters. It is a bit hidden in different util functions.&lt;/p&gt;
[quote user=""]In reality I find that &lt;code&gt;adapter&lt;/code&gt; and &lt;code&gt;m_adapter&lt;/code&gt; is not the same.[/quote]
&lt;p&gt;How often do you see this? What is it when it is not the same?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>