<?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 deal with this race conditon</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/26697/how-to-deal-with-this-race-conditon</link><description>I&amp;#39;m using nRF52832, soft device 2.0, SDK11 and as a central. 
 When it happens I&amp;#39;m scanning for peripheral to connect. Usually it&amp;#39;s a peripheral advertises at very low rate, ie only a few times per second and with very weak RSSI, ie around -90dbm. </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 14 Nov 2017 02:01:21 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/26697/how-to-deal-with-this-race-conditon" /><item><title>RE: how to deal with this race conditon</title><link>https://devzone.nordicsemi.com/thread/104994?ContentTypeID=1</link><pubDate>Tue, 14 Nov 2017 02:01:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c7061bd1-9f2e-4244-af47-556f3325435a</guid><dc:creator>bluebeam</dc:creator><description>&lt;p&gt;thanks for the advise. I think it works a lot better now.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to deal with this race conditon</title><link>https://devzone.nordicsemi.com/thread/104993?ContentTypeID=1</link><pubDate>Wed, 08 Nov 2017 22:43:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:05857e7c-f336-41b7-bcd0-e21709ec99e6</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;just set the scan timeout to whatever time you want to wait for connection. You&amp;#39;ll either get a connection callback or you&amp;#39;ll get a connection/scan timeout callback. Then you can retry or not depending on what it is you&amp;#39;re trying to do. If you always wait for one or other callback, you know you are in a good state all the time, no race condition.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to deal with this race conditon</title><link>https://devzone.nordicsemi.com/thread/104996?ContentTypeID=1</link><pubDate>Wed, 08 Nov 2017 22:22:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3ba70c02-0954-4229-b36a-e46c59c3d453</guid><dc:creator>bluebeam</dc:creator><description>&lt;p&gt;I haven&amp;#39;t thought about that. Then I&amp;#39;ll set my scan timeout to be 1 sec and restart every second?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to deal with this race conditon</title><link>https://devzone.nordicsemi.com/thread/104995?ContentTypeID=1</link><pubDate>Wed, 08 Nov 2017 00:29:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:20fb2443-d31a-44a2-949f-807b915a48a1</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;why don&amp;#39;t you just put the timeout into the scan parameters of the connect call instead of having a separate one and trying to cancel. That&amp;#39;s what that parameter is there for.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>