<?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>Android phone updates ble write characteristic three times</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/82418/android-phone-updates-ble-write-characteristic-three-times</link><description>Hello, I want to develop applications for my Mac and for iOS + Android smartphone. First I created a simple Mac gatt server with apples CoreBluetooth API which has one service and one characteristic (which is write with response). First I wanted to test</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 07 Dec 2021 14:39:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/82418/android-phone-updates-ble-write-characteristic-three-times" /><item><title>RE: Android phone updates ble write characteristic three times</title><link>https://devzone.nordicsemi.com/thread/342392?ContentTypeID=1</link><pubDate>Tue, 07 Dec 2021 14:39:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c98d0841-4d4a-4d54-a90c-537fa9bc91fa</guid><dc:creator>Aleksander Nowakowski</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Have a look at 2 screen shots:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1638887584703v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Here, the Android tries to write a characteristic and gets Insufficient Authentication error, which triggers automatic bonding procedure. After bonding is complete, Android automatically repeats the request and reports success to the app. This is all transparent to the app, which just just wrote the value once, and got (a bit delayed) response.&lt;/p&gt;
&lt;p&gt;In the second screenshot:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1638887769395v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Android has already been bonded to the device, but with insufficient authentication (legacy MITM, instead of LESC). Android tries to write, gets an error. Without the bond, it would initiate bonding here, but as bond already exist, it considers bonding successful, and repeats as in 1st case. This of course fails, so for some reason it repeats next time. Instead, Android should remember the security level of existing bonding and just fail the request after 1st try, like iOS does.&lt;/p&gt;
&lt;p&gt;Mind, that that was tested on Pixel 5 with Android 12 and other Android phones may behave differently.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android phone updates ble write characteristic three times</title><link>https://devzone.nordicsemi.com/thread/342331?ContentTypeID=1</link><pubDate>Tue, 07 Dec 2021 13:05:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:766936f4-822f-4bf7-af47-6ca274f25170</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Update:&lt;/p&gt;
&lt;p&gt;Our expert tested this scenario and he confirmed that this is the behavior from the BLE stack of the Android OS on the phone and not coming from the nRF Connect mobile app. Not sure why Android tries 3 times after failure with insufficient auth. The retries also seems to be pretty fast not giving time for anything else to change so that the second or third might have more chance to succeed. But the quick answer is , this is not behavior from the Nordic side&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android phone updates ble write characteristic three times</title><link>https://devzone.nordicsemi.com/thread/342311?ContentTypeID=1</link><pubDate>Tue, 07 Dec 2021 12:13:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7221e7eb-fdb4-46f1-9a2c-4ce82810dac2</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi Bastian,&lt;/p&gt;
&lt;p&gt;nRF mobile apps inherit some behavior and limitations for the OS they are built on.&amp;nbsp;And my guess here is that on Android, the native BLE stack does not give up requesting write access to the characteristic in the first go. I will request the Android app expert to confirm if this is the case. Will be back to you soon.&lt;/p&gt;
&lt;div style="left:40px;top:-20px;"&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>