<?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>Data file transfer over BLE from nRF52832 device to iOS/Android device</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/98450/data-file-transfer-over-ble-from-nrf52832-device-to-ios-android-device</link><description>I&amp;#39;m currently working with the nRF52832 and NCS V2.2.0, and in my application, I store a log file of activity on the nRF52 device, and when someone connects to it with an iOS or Android device, I want to be able to send that log file to them in JSON format</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 17 May 2023 07:11:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/98450/data-file-transfer-over-ble-from-nrf52832-device-to-ios-android-device" /><item><title>RE: Data file transfer over BLE from nRF52832 device to iOS/Android device</title><link>https://devzone.nordicsemi.com/thread/426041?ContentTypeID=1</link><pubDate>Wed, 17 May 2023 07:11:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a2ee1fe8-d26a-43aa-84c7-ee8755819129</guid><dc:creator>Mike Austin (LPI)</dc:creator><description>&lt;p&gt;The hard fault issue was because I had set:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;struct bt_gatt_notify_params params = {0};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This needs to be static.&amp;nbsp; Otherwise when the .destroy function goes to get called, the pointer to it no longer exists and it goes off to some random point in memory.&lt;/p&gt;
&lt;p&gt;But there was also an issue with the way I defined the .len parameter as well.&amp;nbsp; I&amp;#39;ve corrected that as well, so now I pass the actual length, rather than trying to calculate it via sizeof(data)&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Mike&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Data file transfer over BLE from nRF52832 device to iOS/Android device</title><link>https://devzone.nordicsemi.com/thread/425590?ContentTypeID=1</link><pubDate>Mon, 15 May 2023 11:38:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0923f2d4-4978-424d-8e99-36ffdfe85729</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Two things,&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;I do not think you need to set the UUID here&amp;nbsp;&amp;nbsp;params.uuid = BT_UUID_REMOTE_BUTTON_CHRC;for indication as you are giving the attr details here.&lt;/li&gt;
&lt;li&gt;If you are getting a hardfault with the same code snippet that you provided then I think it is not the issue of params initialization but I think it is the issue of the context in which you are calling this. I did not get the hardfault for the exact same code snippet you have.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I do not see anything wrong in the code snippet for initializing&amp;nbsp;&lt;i&gt;bt_gatt_indicate_params&lt;/i&gt;&lt;span&gt;&amp;nbsp;other than&amp;nbsp;params.len= sizeof(data) can be set wrong. What value does this translate to on your end?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Data file transfer over BLE from nRF52832 device to iOS/Android device</title><link>https://devzone.nordicsemi.com/thread/425431?ContentTypeID=1</link><pubDate>Fri, 12 May 2023 22:33:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c2fbb18-b185-40c1-864a-94f2bcb969b6</guid><dc:creator>Mike Austin (LPI)</dc:creator><description>&lt;p&gt;Hi Susheel,&lt;/p&gt;
&lt;p&gt;My issue is a hard fault that I think it related to how I am setting up the &lt;i&gt;bt_gatt_indicate_params&lt;/i&gt; for the &lt;i&gt;bt_gatt_indicate&lt;/i&gt; API call.&lt;/p&gt;
&lt;p&gt;Specifically, I don&amp;rsquo;t think I fully understand how to correctly set the .&lt;i&gt;attr&lt;/i&gt; and/or .&lt;i&gt;uuid&lt;/i&gt; values.&lt;/p&gt;
&lt;p&gt;if you could give me some assistance with that, I suspect I&amp;rsquo;ll be able to get it working.&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Mike&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Data file transfer over BLE from nRF52832 device to iOS/Android device</title><link>https://devzone.nordicsemi.com/thread/425296?ContentTypeID=1</link><pubDate>Fri, 12 May 2023 10:54:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1fe858d5-ccd4-48be-b4d7-1bf9aa1acc25</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi Mike,&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Simon is away, so I tried to debug using your code snippets.&lt;/p&gt;
&lt;p&gt;I used your code snippet to send an indication and see that I am getting -128 error (&lt;span&gt;ENOTCONN&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;128). Saying that the indication cannot be sent due to lack of connected peer looking for this indication. I enabled the indications correctly but seems like there is some issue here. I was not able to debug this further but hoping to get to the bottom of this on Monday. Is this the same issue you are seeing or are you seeing some other behavior when you say that it is not working?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If you are seeing a crash or hardfault, then I do not have the same setup or behavior as yours.&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Data file transfer over BLE from nRF52832 device to iOS/Android device</title><link>https://devzone.nordicsemi.com/thread/424678?ContentTypeID=1</link><pubDate>Tue, 09 May 2023 23:16:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:72755c64-6496-49e7-9b08-e021fcaae098</guid><dc:creator>Mike Austin (LPI)</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m using the nRF Connect App on my phone and/or the nRF Connect for Desktop with another nRF52-DK as my Central, and I just have to press a button on either of those to enable the indications.&amp;nbsp; That part seems to work, as I have a callback function that gets called when the CCCD is changed, and that is informing me that indications has been enabled by the client (I check for BT_GATT_CCC_INDICATE)&lt;/p&gt;
&lt;p&gt;The issue is occuring when I actually try and write new data to the characteristic that the client has subscribed to for indications.&amp;nbsp; I think its because I&amp;#39;m not calling the correct API.&lt;/p&gt;
&lt;p&gt;With notifications, I call&amp;nbsp;bt_gatt_notify_cb(conn, &amp;amp;params) and things seem to work.&amp;nbsp; With indications, I have been calling bt_gatt_indicate(conn, &amp;amp;params), and its at this point that things fall over.&lt;/p&gt;
&lt;p&gt;So, its the part of the process where I am trying to update the characteristic value after indications have been enabled that things aren&amp;#39;t working.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Mike&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Data file transfer over BLE from nRF52832 device to iOS/Android device</title><link>https://devzone.nordicsemi.com/thread/424490?ContentTypeID=1</link><pubDate>Tue, 09 May 2023 11:24:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7cda629c-0b3c-48ea-a73c-e6857a8392f7</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Mike&lt;/p&gt;
&lt;p&gt;In order for indications to work the client side need to enable indications by writing to CCCD, how are you doing that on your end, as this only seems to be snippets from the peripheral side.&lt;/p&gt;
&lt;p&gt;In general it&amp;#39;s enough to set the indicate bit and a writable CCCD for the characteristic in question. My colleague Edvin explains it very thoroughly in &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/71069/how-to-enable-indication-and-get-cccd-value-to-check"&gt;this ticket&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Data file transfer over BLE from nRF52832 device to iOS/Android device</title><link>https://devzone.nordicsemi.com/thread/424114?ContentTypeID=1</link><pubDate>Sun, 07 May 2023 01:42:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ef8751b4-2712-485b-a625-aa370aaad462</guid><dc:creator>Mike Austin (LPI)</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;I did a deep dive into the gatt.h header to try and understand how things all work.&amp;nbsp; I&amp;#39;m sort of there, but am clearly doing something wrong as whenever I try and process a write from the server with indications, I&amp;#39;m crashing my DK (must be writing or reading to somewhere I shouldn&amp;#39;t)&lt;/p&gt;
&lt;p&gt;This is is how I&amp;#39;ve approached it:&lt;/p&gt;
&lt;p&gt;My service/characteristic definition:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;BT_GATT_SERVICE_DEFINE(remote_srv,
BT_GATT_PRIMARY_SERVICE(BT_UUID_REMOTE_SERVICE),
    BT_GATT_CHARACTERISTIC(BT_UUID_REMOTE_BUTTON_CHRC,
                    BT_GATT_CHRC_READ | BT_GATT_CHRC_INDICATE,
                    BT_GATT_PERM_READ,
                    read_button_characteristic_cb, NULL, NULL),
    BT_GATT_CCC(on_cccd_changed, BT_GATT_PERM_READ | BT_GATT_PERM_WRITE),
);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;In my main.c I make this function call to update the data (the actual data is just a five element array I have pre-defined at this stage).&amp;nbsp; The way I&amp;#39;ve defined the data worked when I was just using notifications.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;err = send_data_indication(current_conn, button_pressed_data);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This is my definition of send_data_indication():&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;int send_data_indication(struct bt_conn *conn, uint8_t *data)
{
    int err = 0;

    struct bt_gatt_indicate_params params = {0};
    const struct bt_gatt_attr *attr = &amp;amp;remote_srv.attrs[2];

    params.uuid = BT_UUID_REMOTE_BUTTON_CHRC;
    params.attr = attr;
    params.func = on_indication;
    params.destroy = indication_destroy;
    params.data = data;
    params.len = sizeof(data);

    err = bt_gatt_indicate(conn, &amp;amp;params);

    return err;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;And these are my two callbacks:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;void on_indication(struct bt_conn *conn, struct bt_gatt_indicate_params *params, uint8_t err)
{
    LOG_INF(&amp;quot;Indication sent on connection %p&amp;quot;, (void *)conn);
    LOG_INF(&amp;quot;err: %d&amp;quot;, err);
}

void indication_destroy(struct bt_gatt_indicate_params *params)
{
    LOG_INF(&amp;quot;Indication received&amp;quot;);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;When I run the debugger, it looks like things crash when I make the call to:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;err = bt_gatt_indicate(conn, &amp;amp;params);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Any ideas what I&amp;#39;m doing wrong?&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Mike&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Data file transfer over BLE from nRF52832 device to iOS/Android device</title><link>https://devzone.nordicsemi.com/thread/423895?ContentTypeID=1</link><pubDate>Fri, 05 May 2023 06:58:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:36fa422a-afec-4ec6-94e9-d21b647a677c</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Mike&lt;/p&gt;
&lt;p&gt;There aren&amp;#39;t any specific samples in the NCS enabling notifications as far as I know, but there have been multiple cases asking about indications and how to enable them in the past. Check out &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/72786/thingy91-lte-ble-sample-how-to-use-ble-indicate-am-able-to-get-indication-from-server-in-on_received-function-how-do-and-what-do-i-send-as-confirmation-to-the-indication"&gt;this case&lt;/a&gt; where I explained how to enable and what parameters are necessary to use it, and potentially &lt;a href="https://devzone.nordicsemi.com/search?q=indication"&gt;search the DevZone&lt;/a&gt; for some more information if necessary. If you&amp;#39;re still struggling to figure out what to do, let me know and I&amp;#39;ll try to help out with any specific questions you have.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Data file transfer over BLE from nRF52832 device to iOS/Android device</title><link>https://devzone.nordicsemi.com/thread/423651?ContentTypeID=1</link><pubDate>Thu, 04 May 2023 05:20:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f34e2a10-e9b0-49c1-9e10-947b2b68ad35</guid><dc:creator>Mike Austin (LPI)</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;Thanks for your reply.&amp;nbsp; I ended up deciding to go down the path of a custom characteristic, as it gives me the most flexibility longer term, and I thought it was probably worth diving into learning how to do it for future benefit.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve been playing around with the remote_controller example that &lt;a href="https://devzone.nordicsemi.com/members/edvin-holmseth"&gt;Edvin&lt;/a&gt;&amp;nbsp;put together&amp;nbsp;&lt;a href="https://github.com/edvinand/OmegaV_BLE_Course"&gt;on Github&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve got it so I can press a button and then transmit an array of data to the client (I&amp;#39;m using an nRF52-DK as the server and nRF Connect for Desktop with a second nRF52-DK as the client).&amp;nbsp; The example uses notifications, but my end goal is to set things up to use Indications, so that the server gets some feedback that the most recent set of data was received and read by the Client, prior to it sending the next set of data.&lt;/p&gt;
&lt;p&gt;But I&amp;#39;m struggling a bit to understand how to configure things so I&amp;#39;m getting Indications working, and also to understand how the Server receives the indication from the Client (I&amp;#39;m assuming I need some sort of callback function that the BLE Stack will trigger) so I can process that and then send more data.&lt;/p&gt;
&lt;p&gt;Are there any existing examples that show how to implement Indications on characteristic and then how to process this at the server side?&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Mike&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Data file transfer over BLE from nRF52832 device to iOS/Android device</title><link>https://devzone.nordicsemi.com/thread/419191?ContentTypeID=1</link><pubDate>Wed, 05 Apr 2023 09:16:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:397d2de2-aeb1-4252-b876-73ceca408c26</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Mike&lt;/p&gt;
&lt;p&gt;Due to the Easter vacation period, we&amp;#39;re short on staff this week, and delayed replies must be expected until 11th of April. You can check out the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/samples/bluetooth/peripheral_ots/README.html"&gt;Object Transfer Service sample project &lt;/a&gt;available in the Zephyr tree for a service to transfer files to a central device.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>