<?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>nrf_ble_scan_connect_with_target , where &amp;quot;sd_ble_gap_connect function&amp;quot; returns error code 18</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/56594/nrf_ble_scan_connect_with_target-where-sd_ble_gap_connect-function-returns-error-code-18</link><description>Hello Nordic Team, 
 I am creating application to connect with specific device using Name filter, 
 control is going to nrf_ble_scan_connect_with_target , where &amp;quot;sd_ble_gap_connect function&amp;quot; returns error code 18, 
 please help in resolve this issue.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 16 Jan 2020 08:47:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/56594/nrf_ble_scan_connect_with_target-where-sd_ble_gap_connect-function-returns-error-code-18" /><item><title>RE: nrf_ble_scan_connect_with_target , where "sd_ble_gap_connect function" returns error code 18</title><link>https://devzone.nordicsemi.com/thread/229348?ContentTypeID=1</link><pubDate>Thu, 16 Jan 2020 08:47:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e2b68c21-aac8-4276-a00c-84fe58f2e1b3</guid><dc:creator>awneil</dc:creator><description>[quote userid="86452" url="~/f/nordic-q-a/56594/nrf_ble_scan_connect_with_target-where-sd_ble_gap_connect-function-returns-error-code-18/229327"]point me the error code file where the error code is declared[/quote]
&lt;p&gt;The possible error codes for each file are listed in documentation.&lt;/p&gt;
&lt;p&gt;You can easily find the definitions by using the browse or search facilities in your IDE ...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_ble_scan_connect_with_target , where "sd_ble_gap_connect function" returns error code 18</title><link>https://devzone.nordicsemi.com/thread/229346?ContentTypeID=1</link><pubDate>Thu, 16 Jan 2020 08:45:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d3464f8d-173e-40f0-a09f-7397eda0c72b</guid><dc:creator>awneil</dc:creator><description>[quote userid="86452" url="~/f/nordic-q-a/56594/nrf_ble_scan_connect_with_target-where-sd_ble_gap_connect-function-returns-error-code-18/229326"]Also this error is occurring when the peripheral device is not yet connected[/quote]
&lt;p&gt;That happens when you have already reached the maximum connection count, and start scanning again.&lt;/p&gt;
&lt;p&gt;This makes sense: there is no point in starting scanning when you are already at&amp;nbsp;&lt;span&gt;the maximum connection count; ie, you will not be able to make any more connections.&lt;/span&gt;&lt;/p&gt;
[quote userid="86452" url="~/f/nordic-q-a/56594/nrf_ble_scan_connect_with_target-where-sd_ble_gap_connect-function-returns-error-code-18/229326"]Please help to resolve this issue[/quote]
&lt;p&gt;&lt;span&gt;Think about it - you have 2 options:&lt;/span&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span&gt;Increase your&amp;nbsp;maximum connection count (it&amp;#39;s in the sdk_config);&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Don&amp;#39;t try to connect&amp;nbsp;when you are already at&amp;nbsp;the maximum connection count&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_ble_scan_connect_with_target , where "sd_ble_gap_connect function" returns error code 18</title><link>https://devzone.nordicsemi.com/thread/229327?ContentTypeID=1</link><pubDate>Thu, 16 Jan 2020 07:23:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:46027923-6320-4ce6-b4c0-7c17785ce1fa</guid><dc:creator>patil_akash</dc:creator><description>&lt;p&gt;does sd_ble_gap_connect function returns NRF_ errors or some other error code.&lt;br /&gt;please point me the error code file where the error code is declared.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_ble_scan_connect_with_target , where "sd_ble_gap_connect function" returns error code 18</title><link>https://devzone.nordicsemi.com/thread/229326?ContentTypeID=1</link><pubDate>Thu, 16 Jan 2020 07:14:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:22b221de-3819-4de3-8acc-54d7cc3e0289</guid><dc:creator>patil_akash</dc:creator><description>&lt;p&gt;Hello Nordic Team,&lt;/p&gt;
&lt;p&gt;I would like to add to the above question&amp;nbsp; by Hitesh that the error code 18 means that the &amp;quot;Maximum connection count exceeded&amp;quot;.&amp;nbsp; Also this error is occurring when the peripheral device is not yet connected. Please help to resolve this issue as soon as possible.&lt;/p&gt;
&lt;p&gt;Thanks &amp;amp; Regards,&lt;/p&gt;
&lt;p&gt;Aswati&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf_ble_scan_connect_with_target , where "sd_ble_gap_connect function" returns error code 18</title><link>https://devzone.nordicsemi.com/thread/229276?ContentTypeID=1</link><pubDate>Wed, 15 Jan 2020 18:22:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5cdade80-6d73-4f5c-bfc5-8894afbe2dbd</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;Same question:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/56592/getting-error-code-18"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/56592/getting-error-code-18&lt;/a&gt;&amp;nbsp;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>