<?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>why indication callback not called</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/11824/why-indication-callback-not-called</link><description>I have an issue with indications. I try to send the first chunk of data and wait for indication callback, but my code freeze on while loop.
I activated indications on phone side (nRF master control). to my understanding, each time the central successfully</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 11 Feb 2016 10:55:36 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/11824/why-indication-callback-not-called" /><item><title>RE: why indication callback not called</title><link>https://devzone.nordicsemi.com/thread/44726?ContentTypeID=1</link><pubDate>Thu, 11 Feb 2016 10:55:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5b64391b-69a8-407e-9974-857f8862347e</guid><dc:creator>Wojtek</dc:creator><description>&lt;p&gt;I don&amp;#39;t think this is wise way to send many indications. Do you want to have high throughput? If not, maybe call that ble_digitsole_param_update() periodically (app_timer?) OR just only after receiving HVC- that will save you some power because cpu can sleep more. If you want to have high throughput, I would go back to using notifications and just wait for TX_COMPLETE events to fill all available buffers.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: why indication callback not called</title><link>https://devzone.nordicsemi.com/thread/44725?ContentTypeID=1</link><pubDate>Thu, 11 Feb 2016 10:42:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a081ca84-1ce7-4ced-b3f2-26d0221c4508</guid><dc:creator>makouda</dc:creator><description>&lt;p&gt;i used this code to bypass the problem. do you think it&amp;#39;s wise way? can this generate any issue by putting &lt;code&gt;app_sched_execute&lt;/code&gt; many times on the main lopp&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;				indication_pending = true;
				do {
					err_code = ble_digitsole_param_update(&amp;amp;m_digitsole, FLASH_DATA, NULL, steps_store_characteristic_value);//update data on BLE
					app_sched_execute();
				} while (indication_pending);
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: why indication callback not called</title><link>https://devzone.nordicsemi.com/thread/44724?ContentTypeID=1</link><pubDate>Thu, 11 Feb 2016 10:25:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e4628a40-43bd-4eb0-8450-7ae045416b9d</guid><dc:creator>makouda</dc:creator><description>&lt;p&gt;so for my understanding :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;indication_pending = true;
do {
		err_code = ble_digitsole_param_update(&amp;amp;m_digitsole, FLASH_DATA, NULL, steps_store_characteristic_value);//update data on BLE
	} while (indication_pending);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;this code executed on the main loop would never run because &lt;code&gt;ndication_pending&lt;/code&gt; flag is cleared on &lt;code&gt;BLE_GATTS_EVT_HVC&lt;/code&gt; callback which cannot be run before &lt;code&gt;app_sched_execute&lt;/code&gt; is called. but it working anyway, I can see many packet are sent to phone&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: why indication callback not called</title><link>https://devzone.nordicsemi.com/thread/44723?ContentTypeID=1</link><pubDate>Thu, 11 Feb 2016 10:16:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d1242454-394d-48a7-98bd-c2716bac07d4</guid><dc:creator>Wojtek</dc:creator><description>&lt;p&gt;If you are using scheduler, you have to manually poll for events from it. If you are waiting in while loop, no events will be pulled from softdevice! (they are received by interrupt, but queued by scheduler - not propagated in application. You have to manually take them from there by app_sched_execute();)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: why indication callback not called</title><link>https://devzone.nordicsemi.com/thread/44722?ContentTypeID=1</link><pubDate>Thu, 11 Feb 2016 10:11:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2859e192-8a97-4e0f-bfe7-8c45791d1ff7</guid><dc:creator>makouda</dc:creator><description>&lt;p&gt;im using scheduler . my inidcation is blocking on the main loop. sometimes it works fine, but then I receive  error 8 (0x8) : &lt;code&gt;GATT CONN TIMEOUT&lt;/code&gt; on nrf master control log and the connection is lost&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: why indication callback not called</title><link>https://devzone.nordicsemi.com/thread/44721?ContentTypeID=1</link><pubDate>Thu, 11 Feb 2016 10:05:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:21e093e5-fe78-4c5c-a370-af0454f1c17c</guid><dc:creator>Wojtek</dc:creator><description>&lt;p&gt;I was wrong indeed. I am using scheduler and I automatically assume everyone is using it :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: why indication callback not called</title><link>https://devzone.nordicsemi.com/thread/44720?ContentTypeID=1</link><pubDate>Thu, 11 Feb 2016 09:17:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:675a3ac3-982a-4943-b7dd-d8616323364e</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;any chances of sending me your project? I will come back to you in couple of hours.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: why indication callback not called</title><link>https://devzone.nordicsemi.com/thread/44719?ContentTypeID=1</link><pubDate>Thu, 11 Feb 2016 09:15:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8bd2c983-0ed1-4752-8275-4191730b45c2</guid><dc:creator>makouda</dc:creator><description>&lt;p&gt;im using nrf51822, Softdevice 8.0. SDK 10. nrf Master Control (android on samsung)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: why indication callback not called</title><link>https://devzone.nordicsemi.com/thread/44718?ContentTypeID=1</link><pubDate>Thu, 11 Feb 2016 09:14:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:595cd9ec-c527-42b4-bba6-65922e6e29b8</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;strange, which softdevice, sdk, peer OS versions are you using, i can run a quick test after lunch to see if it has any problems!!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: why indication callback not called</title><link>https://devzone.nordicsemi.com/thread/44717?ContentTypeID=1</link><pubDate>Thu, 11 Feb 2016 08:55:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e69307a1-47df-459c-a555-043b27a078ae</guid><dc:creator>makouda</dc:creator><description>&lt;p&gt;yes the indications are enabled from peer side. and im waiting on main loop. but the indication callback in never called&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: why indication callback not called</title><link>https://devzone.nordicsemi.com/thread/44716?ContentTypeID=1</link><pubDate>Thu, 11 Feb 2016 08:54:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d035b075-a0ea-4d65-a7c7-94f60edfbeef</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Have those indications enabled from the peer side? Waiting in a while loop inside main is not a problem. Main is running in thread 4 priority which is the lowest, so it cannot blocks stack events.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: why indication callback not called</title><link>https://devzone.nordicsemi.com/thread/44715?ContentTypeID=1</link><pubDate>Wed, 10 Feb 2016 20:39:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:755a9742-7212-410b-8176-e57f4fafe558</guid><dc:creator>makouda</dc:creator><description>&lt;p&gt;but how can the indication block indefinitely ???? I thought that after a period of time the data would be finally sent and indication callback is called ???. also BLE handlers can interrupt main loop programs???&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: why indication callback not called</title><link>https://devzone.nordicsemi.com/thread/44714?ContentTypeID=1</link><pubDate>Wed, 10 Feb 2016 18:07:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:42e7785c-10a1-499a-8c56-220e03fd11f0</guid><dc:creator>Wojtek</dc:creator><description>&lt;p&gt;Ok, now i see what is the problem. You canot wait in while loop cause it is blocking the cpu (you don&amp;#39;t pull events from the stack).&lt;/p&gt;
&lt;p&gt;I am not sure what is the flow of your program, but You may try something like that:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;if(!indication_pending)
{
	err_code = param_update(&amp;amp;m_param, FLASH_DATA, NULL, steps_store_characteristic_value);
	if (err_code == NRF_SUCCESS)
		indication_pending = true;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and call it periodically.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: why indication callback not called</title><link>https://devzone.nordicsemi.com/thread/44712?ContentTypeID=1</link><pubDate>Wed, 10 Feb 2016 17:58:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e82d556-fc33-4c29-ada5-1c66ac7121df</guid><dc:creator>makouda</dc:creator><description>&lt;p&gt;im uisng nrf master control on mobile phone (samsung)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: why indication callback not called</title><link>https://devzone.nordicsemi.com/thread/44713?ContentTypeID=1</link><pubDate>Wed, 10 Feb 2016 17:41:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:beb95894-9d09-4fd1-b4fb-389a795772cb</guid><dc:creator>Wojtek</dc:creator><description>&lt;p&gt;what device are you using to receive the data? Mobile phone or central on S120/S130?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>