<?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>File transfer over BLE. OTS or something else?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/79853/file-transfer-over-ble-ots-or-something-else</link><description>Hello. 
 I need to transfer files from a phone to a BLE peripheral device. I have a small FatFS filesystem on an external flash chip on the device, and I&amp;#39;m now trying to decide how to transfer files to and from it. I&amp;#39;m using the nRF5 SDK. 
 I already</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 28 Sep 2021 15:00:35 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/79853/file-transfer-over-ble-ots-or-something-else" /><item><title>RE: File transfer over BLE. OTS or something else?</title><link>https://devzone.nordicsemi.com/thread/331561?ContentTypeID=1</link><pubDate>Tue, 28 Sep 2021 15:00:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1106a4a1-a66e-4691-b4a3-c199c36ca14e</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;You welcome. The best of luck with your project &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: File transfer over BLE. OTS or something else?</title><link>https://devzone.nordicsemi.com/thread/331048?ContentTypeID=1</link><pubDate>Fri, 24 Sep 2021 11:08:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c723cf53-1e7f-44cc-a727-882cdf93bfea</guid><dc:creator>mrono</dc:creator><description>[quote userid="2116" url="~/f/nordic-q-a/79853/file-transfer-over-ble-ots-or-something-else/331029#331029"]the OTS specification is quite complex, and requires much more work to add than a proprietary GATT service[/quote][quote userid="2116" url="~/f/nordic-q-a/79853/file-transfer-over-ble-ots-or-something-else/331029#331029"]for the time being I would have to recommend doing something based on a proprietary GATT service[/quote]
&lt;p&gt;Thank you. This was exactly the kind of advice I was hoping for.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: File transfer over BLE. OTS or something else?</title><link>https://devzone.nordicsemi.com/thread/331029?ContentTypeID=1</link><pubDate>Fri, 24 Sep 2021 10:16:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:36ca7d3b-2082-46cf-9a56-3a5950b2eea9</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
[quote user="mrono"]Bandwidth will be shared, that is clear. What I was unsure about was if an L2CAP COC channel has its own equivalent of &amp;quot;empty PDUs&amp;quot; sent all the time to keep the connection open. I&amp;#39;ll need to&amp;nbsp;read some more about it.[/quote]
&lt;p&gt;The link layer&amp;nbsp;already does this, there is no need to have a separate mechanism for each&amp;nbsp;higher level protocol. In other words the L2CAP COC channels will just rely on the standard link layer empty packet mechanism.&amp;nbsp;&lt;/p&gt;
[quote user="mrono"]This device will eventually be certified, so I&amp;#39;d need to add any missing bits to comply with the standard. If I choose to do a fully custom service for file transfer, I&amp;#39;m free to implement as much or as little as I need. But then I do need to implement it all myself.[/quote]
&lt;p&gt;I discussed this some more with the app developer, and while he confirmed that proper OTS support on the mobile side is something they want to add they have a lot of other things to do first, and even if they decide to provide it it could take&amp;nbsp;a year or more before we are able to have something ready.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;He also pointed out the fact that the OTS specification is quite complex, and requires much more work to add than a proprietary GATT service.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In other words, for the time being I would have to recommend doing something based on a proprietary GATT service.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: File transfer over BLE. OTS or something else?</title><link>https://devzone.nordicsemi.com/thread/330754?ContentTypeID=1</link><pubDate>Thu, 23 Sep 2021 07:21:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:de655f5d-001a-4860-bbdb-a3fa4c5c6640</guid><dc:creator>mrono</dc:creator><description>&lt;p&gt;Thank you&lt;/p&gt;
[quote userid="2116" url="~/f/nordic-q-a/79853/file-transfer-over-ble-ots-or-something-else/330707#330707"]In principle you can just treat it as any other service, yes. Total bandwidth will have to be shared between the L2CAP COC channels and any regular GATT services you have running[/quote]
&lt;p&gt;Bandwidth will be shared, that is clear. What I was unsure about was if an L2CAP COC channel has its own equivalent of &amp;quot;empty PDUs&amp;quot; sent all the time to keep the connection open. I&amp;#39;ll need to&amp;nbsp;read some more about it.&lt;/p&gt;
[quote userid="2116" url="~/f/nordic-q-a/79853/file-transfer-over-ble-ots-or-something-else/330707#330707"]&lt;p&gt;Android added support for this in version 8, and&amp;nbsp;you also have support on iOS.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;We don&amp;#39;t have any examples showing how to set this up on the phone side unfortunately, so&amp;nbsp;you would have to implement this on your own.&lt;/p&gt;[/quote]
&lt;p&gt;I was hoping that something like FTP over BLE existed. It seems that OTS could be a base for that, but searching for &amp;quot;OTS file transfer&amp;quot; and similar yields very little results. The search for a file UUID was also in hope that someone had already standardized this type of operation.&lt;/p&gt;
&lt;p&gt;This is the core of my dilemma. I&amp;#39;m not an app developer so it is difficult for me to estimate if implementing OTS helps here. It is a standard service, so it ought to be easier to implement that a fully custom one. But it seems there is still a lot that we&amp;#39;d need to do ourselves. Even on the peripheral side, the infocenter docs say that the Nordic OTS implementation isn&amp;#39;t qualified. I&amp;#39;m guessing it is incomplete. This device will eventually be certified, so I&amp;#39;d need to add any missing bits to comply with the standard. If I choose to do a fully custom service for file transfer, I&amp;#39;m free to implement as much or as little as I need. But then I do need to implement it all myself.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="2116" url="~/f/nordic-q-a/79853/file-transfer-over-ble-ots-or-something-else/330707#330707"]L2CAP COC channels use their own credit based flow control scheme, to ensure that&amp;nbsp;no more data is sent if the buffers are full on the peer side.[/quote]
&lt;p&gt;Thank you, that is clear now.&lt;/p&gt;
[quote userid="2116" url="~/f/nordic-q-a/79853/file-transfer-over-ble-ots-or-something-else/330707#330707"]Do you have a link to the case?[/quote]
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/79226/ots-for-file-upload-download/328097#328097"&gt;This&lt;/a&gt;&amp;nbsp;case is what I meant.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: File transfer over BLE. OTS or something else?</title><link>https://devzone.nordicsemi.com/thread/330707?ContentTypeID=1</link><pubDate>Wed, 22 Sep 2021 14:14:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:909243dd-fd64-43e7-8872-03e36fdd6871</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
[quote user=""]I haven&amp;#39;t worked with L2CAP channels before. How do they coexist with regular GATT services? Can I simply treat it as &amp;quot;just another service&amp;quot;? Or is there a penalty in terms of power consumption or bandwidth usage on having an L2CAP channel open?[/quote]
&lt;p&gt;It is up to the L2CAP module to interface to any L2CAP COC channels you might be using, in addition to the normal GATT data.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In principle you can just treat it as any other service, yes. Total bandwidth will have to be shared between the L2CAP COC channels and any regular GATT services you have running, just as you need to share bandwidth between GATT services normally.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In terms of power consumption and total bandwidth running L2CAP COC channels should be slightly more efficient than GATT, since you have a bit less overhead (every GATT packet requires a 3 byte ATT header, which you don&amp;#39;t need for L2CAP COC data), but the difference is negligible.&amp;nbsp;&lt;/p&gt;
[quote user=""]How good is support for OTS in phones? I mean iOS and Android. If I choose to use OTS will I make life easier or harder for our app developers compared to a custom solution?[/quote]
&lt;p&gt;Android added support for this in version 8, and&amp;nbsp;you also have support on iOS.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;We don&amp;#39;t have any examples showing how to set this up on the phone side unfortunately, so&amp;nbsp;you would have to implement this on your own.&amp;nbsp;&lt;/p&gt;
[quote user=""]How do I handle large files too big to hold in ram temporarily? I&amp;#39;m assuming this isn&amp;#39;t a problem, but do I need a &amp;quot;flow control&amp;quot;-like mechanism to ensure that buffers won&amp;#39;t overflow while waiting for the flash write to finish?[/quote]
&lt;p&gt;The easiest way to handle this is simply to stop calling the&amp;nbsp;&lt;em&gt;sd_ble_l2cap_ch_rx(..)&lt;/em&gt; function when you run out of memory in the application, and then the SoftDevice will automatically hold off on receiving any more updates. L2CAP COC channels use their own credit based flow control scheme, to ensure that&amp;nbsp;no more data is sent if the buffers are full on the peer side.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
[quote user=""]Perhaps a detail at this point, but OTS objects have a type which is a UUID. Is there a generic &amp;quot;file&amp;quot; object type? Or perhaps a binary/text object type?[/quote]
&lt;p&gt;The specification doesn&amp;#39;t say anything about this, other than that &amp;quot;Relevant object types that are to be used for a given application may be specified by a higher-level specification.&amp;quot;&lt;/p&gt;
&lt;p&gt;If you do something proprietary you are free to generate random 128-bit UUID&amp;#39;s that you can use, and associate them with whatever you want.&amp;nbsp;&lt;/p&gt;
[quote user=""]Lastly, an example combining OTS and a file system would be great. But I did see that someone asked for that just a few weeks ago.[/quote]
&lt;p&gt;Do you have a link to the case?&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>