<?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>nRF51822 BLE - Android and iOS app development</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/2585/nrf51822-ble---android-and-ios-app-development</link><description>Hi Nordic, 
 We are working on Android and iOS apps. Currently using S3 with Android 4.3 and Note to communicate with nRF51822. Baud rate of 19200bps for our serial communication. 
 Reference to Kristin post dated Nov 20, 2013 on topic: 51822 BLUETOOTH</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 22 May 2014 13:06:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/2585/nrf51822-ble---android-and-ios-app-development" /><item><title>RE: nRF51822 BLE - Android and iOS app development</title><link>https://devzone.nordicsemi.com/thread/10243?ContentTypeID=1</link><pubDate>Thu, 22 May 2014 13:06:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fd9ba8b5-d867-46de-bdcb-a257760ca8ac</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;Hi Paul&lt;/p&gt;
&lt;p&gt;What kind of phone are you using? With Android, you should be able to send 4 packets per connection interval. Normally, the connection interval should be 7.5 ms for Android phones, but for Samsung phones, this could be different.&lt;/p&gt;
&lt;p&gt;Are you feeding the android stack with packets fast enough to test the connection?&lt;/p&gt;
&lt;p&gt;I attach an example UART code that tests the throughput from Android to nRF51822. Perhaps you can try it and see what you find out. I also add the nRF51 UART example which should be the same as in the SDK.&lt;/p&gt;
&lt;p&gt;Please be noted that this is a very simple and ugly speed test, just to prove that we can send and receive up to 4 packets per conn interval both way. Sometimes you have to click send on the phone app twice, I don&amp;#39;t know why the call back never arrived. Also if you change the number of packet to 1000 instead of 300, strange thing also happens on the phone, that not all 1000 packet was transfered (the call back was lost after a while).
The easiest way to verify is to use a sniffer to see what is transfered on air.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ble_5F00_app_5F00_uart-_2D00_-TestThroughPut.zip"&gt;ble_app_uart - TestThroughPut.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/nRFUART_5F00_TestThroughPut.zip"&gt;nRFUART_TestThroughPut.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 BLE - Android and iOS app development</title><link>https://devzone.nordicsemi.com/thread/10242?ContentTypeID=1</link><pubDate>Thu, 22 May 2014 09:52:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ebb525bb-d4cc-4074-bcc7-d258933d1eb9</guid><dc:creator>Paul Tay</dc:creator><description>&lt;p&gt;Hi Stefan,&lt;/p&gt;
&lt;p&gt;I have tried writeCharacteristic method with WRITE_TYPE_NO_RESPONSE option. But it didn&amp;#39;t do what I am looking for.&lt;/p&gt;
&lt;p&gt;To pack 4 packages of 20 bytes within the connection interval (says 40ms)  and  transmit them out from Android to nRF51822. (See the attached image)&lt;/p&gt;
&lt;p&gt;I wonder if can it be done on Android?&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/linklayer.png" alt="linklayer.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 BLE - Android and iOS app development</title><link>https://devzone.nordicsemi.com/thread/10241?ContentTypeID=1</link><pubDate>Thu, 22 May 2014 07:12:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0daccdf5-b9bc-40f2-b376-e93081138f95</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;Hi Paul&lt;/p&gt;
&lt;p&gt;Looking at the Android BLE API, I suspect you can send write commands by calling &lt;a href="http://developer.android.com/reference/android/bluetooth/BluetoothGattCharacteristic.html#setWriteType(int)"&gt;BluetoothGattCharacteristic.setWriteType&lt;/a&gt; method and choose the &lt;a href="http://developer.android.com/reference/android/bluetooth/BluetoothGattCharacteristic.html#WRITE_TYPE_NO_RESPONSE"&gt;WRITE_TYPE_NO_RESPONSE&lt;/a&gt; option before calling &lt;a href="http://developer.android.com/reference/android/bluetooth/BluetoothGatt.html#writeCharacteristic(android.bluetooth.BluetoothGattCharacteristic)"&gt;writeCharacteristic&lt;/a&gt; method.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 BLE - Android and iOS app development</title><link>https://devzone.nordicsemi.com/thread/10240?ContentTypeID=1</link><pubDate>Thu, 22 May 2014 06:44:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6b7bceb6-1175-4f7b-8f53-c2555515f165</guid><dc:creator>Paul Tay</dc:creator><description>&lt;p&gt;Hi Stefan,&lt;/p&gt;
&lt;p&gt;In our project, we want to maximize throughput of sending large size data from smart phone devices (Android/iOS) to nRF51822. We have not find a suitable method yet.&lt;/p&gt;
&lt;p&gt;But in your last paragraph, you mentioned write command which does not include acknowledgement that can boost the throughput. Can this be done on Android?&lt;/p&gt;
&lt;p&gt;I can only see writeRXCharacteristic, BluetoothGatt API - writeCharacteristic function and its corresponding callback.&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;
&lt;p&gt;Regards,
Paul&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 BLE - Android and iOS app development</title><link>https://devzone.nordicsemi.com/thread/10239?ContentTypeID=1</link><pubDate>Wed, 21 May 2014 12:53:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0071d96c-187b-4cb3-aaac-af4d3298f318</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;Hi Paul&lt;/p&gt;
&lt;p&gt;Q1:  I am not aware of that you can get notification on when the Android stack has sent buffered packets, see Q2.&lt;/p&gt;
&lt;p&gt;Q2: I am not aware of that you can read the status of the connection from the Android BLE stack. After you call writeRXCharacteristic, you will receive a callback from the Android stack if the packet has been queued up for transmission in the BLE stack. If the callback is positive, there is buffer space available and you can just go ahead and give another packet to the BLE stack. If the callback is negative, it means that the stack buffer is full and you must try again later to buffer up the same packet. I could recommend to start a timer before suspending the thread and let the timer wake up the thread again later in order to retry.&lt;/p&gt;
&lt;p&gt;Q3: Which direction do you transfer this data, from the nRF51822 to the Android, or in the opposite direction. You can realize expected data rate on &lt;a href="http://devzone.nordicsemi.com/index.php/how-do-i-calculate-throughput-for-a-ble-link#reply-3441"&gt;this thread&lt;/a&gt; when sending data with notifications.&lt;/p&gt;
&lt;p&gt;Write requests from the central will not give you much throughput, see data througput section in the S110 Softdevice Specification, available on our web site. Write commands will however give you higher througput.&lt;/p&gt;
&lt;p&gt;If you use write request from the central you can only send one packet in every second connection interval. This is because there is an acknowledgement required for each packet from the slave before another packet is sent. You can boost your throughput from the central by sending write command instead which does not include acknowledgement. You can also choose to have a GATT server residing on the central device instead of the peripheral device, enabling the central to send notifications.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>