<?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>enable LE Ping with pc-driver-ble-py</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/55506/enable-le-ping-with-pc-driver-ble-py</link><description>HIi 
 I am using the pc-driver-ble_py library to build a central in order to test a peripheral. At this point, I am interested in starting a LE ping and I saw that I should use the function sd_ble_opt_set. 
 I am trying to add the necessary code in the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 07 Jan 2020 12:39:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/55506/enable-le-ping-with-pc-driver-ble-py" /><item><title>RE: enable LE Ping with pc-driver-ble-py</title><link>https://devzone.nordicsemi.com/thread/227880?ContentTypeID=1</link><pubDate>Tue, 07 Jan 2020 12:39:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e69a48fe-e46c-4844-acfb-1e9903eeb9ae</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;What softdevice so you use in your connectivity nRF52832 DK? Or What SDK version does that SoftDevice come from? S132v_X.Y.Z.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: enable LE Ping with pc-driver-ble-py</title><link>https://devzone.nordicsemi.com/thread/226610?ContentTypeID=1</link><pubDate>Fri, 20 Dec 2019 14:41:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7444c77c-933b-4a41-b1b2-4fc0222f00c2</guid><dc:creator>Imen</dc:creator><description>&lt;p&gt;The debug stops at the function ble_opt_get, there is no going further as it is a softdevice function, I suggest you take a closer look to the code I&amp;#39;ve sent&amp;nbsp; and maybe try to test it if possible so that you can tell me if you encounter the same problem, thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: enable LE Ping with pc-driver-ble-py</title><link>https://devzone.nordicsemi.com/thread/226587?ContentTypeID=1</link><pubDate>Fri, 20 Dec 2019 13:56:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7dfb9a45-66db-449d-acb5-46b656169f85</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Can you try to step inside the function returning 0x3002? You can add &amp;quot;breakpoint()&amp;quot; in the project, which makes it possible to stop there with command line debugging.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: enable LE Ping with pc-driver-ble-py</title><link>https://devzone.nordicsemi.com/thread/226569?ContentTypeID=1</link><pubDate>Fri, 20 Dec 2019 13:14:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:368e2441-d586-4368-82b6-68d3d1e80aa2</guid><dc:creator>Imen</dc:creator><description>&lt;p&gt;That is exactly the problem. The softdevice returns the error 0x3002 as I mentioned above (isn&amp;#39;t it a conn_handle error for the function ble_opt_get? Did I say something that confused you about the problem?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: enable LE Ping with pc-driver-ble-py</title><link>https://devzone.nordicsemi.com/thread/226542?ContentTypeID=1</link><pubDate>Fri, 20 Dec 2019 11:49:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:18002fe7-af28-435b-a0ac-84f5ed19507d</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;For some reason I thought the issue was that the function returned something saying that the conn_handle was invalid, but it isn&amp;#39;t right? Is this a compiler error?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: enable LE Ping with pc-driver-ble-py</title><link>https://devzone.nordicsemi.com/thread/226098?ContentTypeID=1</link><pubDate>Wed, 18 Dec 2019 10:18:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a60a59d-aa45-4996-93c1-99870e7f3f8e</guid><dc:creator>Imen</dc:creator><description>&lt;p&gt;Here&amp;#39;s how I implement the function and where the conn_handle comes from&lt;/p&gt;
&lt;p&gt;self.conn_handle = conn_handle (during on_gap_evt_connected(&amp;hellip;) function added in our program)&lt;/p&gt;
&lt;p&gt;self.conn_handle = None (during on_gap_evt_disconnected (&amp;hellip;) function added in our program)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Output debug on our program:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;table&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;Nom&lt;/strong&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;Valeur&lt;/strong&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&lt;strong&gt;Type&lt;/strong&gt;&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p&gt;◢&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;opt&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;&amp;lt;lib.pc_ble_driver_py.ble_driver.BLEOptGapChMap object at 0x00000000031D7D68&amp;gt;&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;BLEOptGapChMap&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
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lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;conn_handle&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;0x0&lt;/p&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;p&gt;int&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Function in our program&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;def GetChannelMapUpdate(self):&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(self.conn_handle == None):&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; opt = BLEOptGapChMap()&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; opt.conn_handle = self.conn_handle&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; opt.ch_map = [0x00, 0x00, 0x00, 0x00, 0x00]&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;self.driver.ble_opt_get(BLEOpt.gap_ch_map, opt)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;New classes add in ble_driver.py:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;class BLEOptGapChMap(object):&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; def __init__(self, conn_handle=1, ch_map=[0xFF, 0xFF, 0xFF, 0xFF, 0xFF]):&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.conn_handle = conn_handle&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.ch_map = ch_map&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; def to_c(self):&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; opt = driver.ble_opt_t()&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; opt.gap_opt.ch_map.conn_handle = self.conn_handle&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ch_map_array = util.list_to_uint8_array(self.ch_map[::])&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; opt.gap_opt.ch_map.ch_map = ch_map_array.cast()&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return opt&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;class BLEOpt(Enum):&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; common_pa_lna = driver.BLE_COMMON_OPT_PA_LNA&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;common_conn_evt_ext = driver.BLE_COMMON_OPT_CONN_EVT_EXT&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;gap_ch_map = driver.BLE_GAP_OPT_CH_MAP&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;gap_local_conn_latency = driver.BLE_GAP_OPT_LOCAL_CONN_LATENCY&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;gap_passkey = driver.BLE_GAP_OPT_PASSKEY&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;gap_scan_req_report = driver.BLE_GAP_OPT_SCAN_REQ_REPORT&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;gap_compat_mode_1 = driver.BLE_GAP_OPT_COMPAT_MODE_1&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;gap_auth_payload_timeout = driver.BLE_GAP_OPT_AUTH_PAYLOAD_TIMEOUT&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;gap_slave_latency_disable = driver.BLE_GAP_OPT_SLAVE_LATENCY_DISABLE&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;New function added in ble_driver.py:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;def ble_opt_get(self, opt_id, opt):&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; err_code = driver.sd_ble_opt_get(&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;self.rpc_adapter, opt_id.value, opt.to_c()&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return err_code&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: enable LE Ping with pc-driver-ble-py</title><link>https://devzone.nordicsemi.com/thread/225959?ContentTypeID=1</link><pubDate>Tue, 17 Dec 2019 16:42:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4a4e0147-fe29-4d14-9029-c16a5be8e430</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Can you show me the function where you call this? I need to know what context you use it in, and how you pass the connection handle into the function.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: enable LE Ping with pc-driver-ble-py</title><link>https://devzone.nordicsemi.com/thread/225935?ContentTypeID=1</link><pubDate>Tue, 17 Dec 2019 14:37:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:89b4cf40-d6c9-4479-926b-ef018068ed8e</guid><dc:creator>Imen</dc:creator><description>&lt;p&gt;No i can continue other tests that require the connexion and they work just fine (no disconnection event received either) I wonder if it is possible for you to test this with the library pc-ble-driver_py and see what you get as an answer.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: enable LE Ping with pc-driver-ble-py</title><link>https://devzone.nordicsemi.com/thread/225931?ContentTypeID=1</link><pubDate>Tue, 17 Dec 2019 14:31:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9f94ae3e-4082-437b-a648-f45e6110e863</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;do you happen to get the disconnect event right after this call?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: enable LE Ping with pc-driver-ble-py</title><link>https://devzone.nordicsemi.com/thread/225913?ContentTypeID=1</link><pubDate>Tue, 17 Dec 2019 14:10:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b22d144a-243c-4b76-8f63-c3a83bb691eb</guid><dc:creator>Imen</dc:creator><description>&lt;p&gt;Yes I am using the variable holding the conn_handle value and i can see it in debug mode, the value is correct and of course I don&amp;#39;t call the opt_get after a disconnection&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: enable LE Ping with pc-driver-ble-py</title><link>https://devzone.nordicsemi.com/thread/225906?ContentTypeID=1</link><pubDate>Tue, 17 Dec 2019 13:48:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d3cf39dc-2c66-4820-a0d0-df57e3bcd444</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;How do you pass the conn_handle into the opt_get()?&lt;/p&gt;
&lt;p&gt;Are you sure you don&amp;#39;t call this right after a disconnect? You should use the variable holding the conn_handle, to ensure that it is updated at all times.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: enable LE Ping with pc-driver-ble-py</title><link>https://devzone.nordicsemi.com/thread/225416?ContentTypeID=1</link><pubDate>Fri, 13 Dec 2019 14:46:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0cf2063e-fad1-4ea3-9672-d797fcf57ec0</guid><dc:creator>Imen</dc:creator><description>&lt;p&gt;Hi thank you for your advice, I managed to do this. I would like to ask you now about the ble_opt_get, in fact, I want to perform an opt get on the channel map but it always return a conn_handle error (error 0x3002) and I don&amp;#39;t understand why ( I am connected to only one device and the conn_handle value is 0) do you have any idea what to do? the opt_get works fine on a devkit peripheral but not on my tool using the pc-driver-ble-py library.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: enable LE Ping with pc-driver-ble-py</title><link>https://devzone.nordicsemi.com/thread/225336?ContentTypeID=1</link><pubDate>Fri, 13 Dec 2019 11:29:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0b492efc-d55e-4a08-a205-795999ffa52c</guid><dc:creator>Mttrinh</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Like you said, you are trying to add a function to pc-ble-driver-py that isn&amp;#39;t already supported. I suggest you use the ble_cfg_set as a template and go from there, it has a similiar structur.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/NordicSemiconductor/pc-ble-driver-py/blob/master/pc_ble_driver_py/ble_driver.py#L1677"&gt;https://github.com/NordicSemiconductor/pc-ble-driver-py/blob/master/pc_ble_driver_py/ble_driver.py#L1677&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>