<?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>BLE L2CAP Test with PTS</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/25019/ble-l2cap-test-with-pts</link><description>Hi,
I have used nRF52840-PDK.
And I want to test profile and protocol with PTS.
I succeeded in GATT-based service test and GATT test with PTS. 
 But when I try to L2CAP test,
PTS makes message and doesn&amp;#39;t conduct a test. 
 The message is below.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 23 Oct 2017 09:42:42 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/25019/ble-l2cap-test-with-pts" /><item><title>RE: BLE L2CAP Test with PTS</title><link>https://devzone.nordicsemi.com/thread/98532?ContentTypeID=1</link><pubDate>Mon, 23 Oct 2017 09:42:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0dd0fb87-6810-4f93-9b20-2741fb1e7c1f</guid><dc:creator>Ulrich Myhre</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Just establishing a normal connection will establish the required L2CAP signaling channel. For the Connection Oriented Channels test, you need to establish the channels yourself. We are passing these tests internally, and I can share our general test procedures for each of the test cases you list:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;TP/LE/CPU/BV-01-C&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Advertise and wait for connection.&lt;/li&gt;
&lt;li&gt;Call &lt;code&gt;sd_ble_gap_conn_param_update()&lt;/code&gt; with some new parameters.&lt;/li&gt;
&lt;li&gt;Wait for disconnection to occur, ignoring &lt;code&gt;BLE_GAP_EVT_CONN_PARAM_UPDATE&lt;/code&gt;, as PTS sometimes disconnect before this is triggered.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;TP/LE/REJ/BI-01-C&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Advertise and wait for connection.&lt;/li&gt;
&lt;li&gt;Wait for disconnection. (L2CAP will autonomously reject unknown commands)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;TP/LE/CFC/BV-01-C&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Advertise and wait for connection.&lt;/li&gt;
&lt;li&gt;Wait a bit and call &lt;code&gt;sd_ble_l2cap_ch_setup()&lt;/code&gt; to setup a L2CAP data channel.&lt;/li&gt;
&lt;li&gt;Wait for SDU buffer to be released and channel setup to be refused.&lt;/li&gt;
&lt;li&gt;Note: In automated runs, PTS will disconnect before the reject has gone over the air.&lt;/li&gt;
&lt;li&gt;Wait for disconnection.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;TP/LE/CID/BV-02-C&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This test should not be run with current Nordic Softdevices. If it is active in the test plan, that might be a mistake. From what I can see, it requires GAP 44/1, 44/2 or 45/31, all being features for simultaneous BR/EDR and LE transports.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For TP/LE/CFC/BV-01-C specifically, here is the initialization code we use (with replaced constants etc.):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define L2CAP_MTU_DEFAULT 1280
#define TSPX_LE_PSM 0x0025

static uint8_t m_sdu_data_rx[L2CAP_MTU_DEFAULT] = {0};
ble_data_t sdu_buf_rx = { .len = sizeof(m_sdu_data_rx), .p_data = m_sdu_data_rx };
uint16_t local_cid = BLE_L2CAP_CID_INVALID;

// Connect here and get a valid connection handle

ble_l2cap_ch_setup_params_t ch_setup_params = {.le_psm = TSPX_LE_PSM, .rx_mtu = L2CAP_MTU_DEFAULT, .rx_mps = BLE_L2CAP_MPS_MIN, .sdu_buf = &amp;amp;sdu_buf_rx);
sd_ble_l2cap_ch_setup(m_conn_handle, &amp;amp;local_cid, &amp;amp;ch_setup_params);

// Expect BLE_L2CAP_EVT_CH_SDU_BUF_RELEASED
// Expect BLE_L2CAP_EVT_CH_SETUP_REFUSED
// Expect BLE_GAP_EVT_DISCONNECTED
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE L2CAP Test with PTS</title><link>https://devzone.nordicsemi.com/thread/98531?ContentTypeID=1</link><pubDate>Thu, 21 Sep 2017 16:47:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c5baca1-e36f-45ec-b035-88cdea47cced</guid><dc:creator>Greg Lund</dc:creator><description>&lt;p&gt;I am also wondering about this.  Does anyone at Nordic have any information on setting up a Unit under Test for the L2CAP and SM tests for Bluetooth Certification?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>