<?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>Sending SAADC data over BLE</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/58897/sending-saadc-data-over-ble</link><description>Hi! 
 I am trying to send over SAADC data from a peripheral device over BLE to a central device. Currectly I have sucsessfully merged the SAADC and BLE_UART peripheral example. 
 I have seen the https://github.com/NordicPlayground/nRF52-ADC-examples/tree</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 11 Mar 2020 12:11:02 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/58897/sending-saadc-data-over-ble" /><item><title>RE: Sending SAADC data over BLE</title><link>https://devzone.nordicsemi.com/thread/239317?ContentTypeID=1</link><pubDate>Wed, 11 Mar 2020 12:11:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a2c15950-8d67-4a34-851f-a27f4a9089ca</guid><dc:creator>Tormod123</dc:creator><description>&lt;p&gt;Simply postponing the samling until a connection was made seemed to do it. I simply set&amp;nbsp;saadc_sampling_event_enable under the ble_evt_handler in the connected case. Do you also think it would be better practice to set the two init functions, saadc_sampling_event_init and saadc_init inside here too?&lt;/p&gt;
&lt;p&gt;So when a central now connects to the periphral device the samling is started and values from the potmeter is getting sent and recieved on the central end. However the central is&amp;nbsp;receiving some wierd values:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1583928185807v3.png" /&gt;&lt;/p&gt;
&lt;p&gt;I would imagine its some kind of formatting issue maybe.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Here is what is I see on the peripheral side:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1583929000926v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;It seems like the values on the left is getting sent.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending SAADC data over BLE</title><link>https://devzone.nordicsemi.com/thread/239017?ContentTypeID=1</link><pubDate>Tue, 10 Mar 2020 09:22:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c87c5aba-4a89-4097-b28c-05b70e970750</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Ok, that makes sense. Error 5 corresponds to &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v7.0.1/group__nrf__error.html#ga349d25ada15be023e0d507f45ada682c"&gt;NRF_ERROR_NOT_FOUND&lt;/a&gt;, and this is returned from ble_nus_data_send() if the connection_handle parameter is not valid:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;if ((conn_handle == BLE_CONN_HANDLE_INVALID) || (p_client == NULL))
{
    return NRF_ERROR_NOT_FOUND;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;You can either filter this error similar to&amp;nbsp;NRF_ERROR_INVALID_STATE, before passing the err_code variable to APP_ERROR_CHECK, or you can postpone starting of the SAADC sampling (calling&amp;nbsp;saadc_sampling_event_enable()) until you are in a connection and have enabled notifications for the NUS service. If the only purpose of sampling the SAADC is to transfer the data over BLE, there is no point in having it running when you are not in a connection. In this case, you should also stop the sampling whenever the device disconnects.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending SAADC data over BLE</title><link>https://devzone.nordicsemi.com/thread/238952?ContentTypeID=1</link><pubDate>Mon, 09 Mar 2020 22:24:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7895b660-76e1-498b-88b7-61aebc6feb89</guid><dc:creator>Tormod123</dc:creator><description>&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1583792405671v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Here is the error code im getting, 0x00000005. I tried to search up what that was but did not find any documentation. So what I think is happening is that the ble_nus_data_send does not work as intended since it catches an error, 0x0000005.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Im guessing im sending some wrong arguments here, though I dont know which one is wrong.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending SAADC data over BLE</title><link>https://devzone.nordicsemi.com/thread/238889?ContentTypeID=1</link><pubDate>Mon, 09 Mar 2020 15:19:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0f55f678-7027-4514-ab78-0c2b508a49f1</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Can you build the application&amp;nbsp;with the DEBUG flag set&amp;nbsp;in the project preprocessor symbols (you can use Debug build configuration if using SES)? You should then get the error code and exact line output on the log.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>