<?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>Reading battery level from peripheral BLE to central BLE to iOS app.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/49096/reading-battery-level-from-peripheral-ble-to-central-ble-to-ios-app</link><description>I have a BLE device acting as a central and a peripheral, relaying information between that peripheral and a custom iOS app. As a central, it reads (not notifications) the battery level of another BLE acting as a peripheral. This is working fine. I see</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 29 Jul 2019 12:21:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/49096/reading-battery-level-from-peripheral-ble-to-central-ble-to-ios-app" /><item><title>RE: Reading battery level from peripheral BLE to central BLE to iOS app.</title><link>https://devzone.nordicsemi.com/thread/200961?ContentTypeID=1</link><pubDate>Mon, 29 Jul 2019 12:21:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f454155-8a42-4d6e-a8fd-d16144995583</guid><dc:creator>Aleksander Nowakowski</dc:creator><description>&lt;p&gt;In &lt;strong&gt;BluetoothGattService&lt;/strong&gt; object you&amp;#39;ll find &lt;strong&gt;getInstance()&lt;/strong&gt; method. For Android version 4.3 - 6?? they return zero-based indexes, for more recent versions they return handle number. This is not documented what they return and this may change to something else again in the future. The important thing is, that each next instance of the same service (and characteristic) gets a different value of instance id.&lt;/p&gt;
&lt;p&gt;There is no such method for descriptors, for some reason.&lt;/p&gt;
&lt;p&gt;Also, instances don&amp;#39;t work for local GATT configuration on the phone. Even if you add 5 services of the same UUID, they all get the same instance id = 0. If a packet is received for a characteristic inside one of them, it will be delivered ONLY to the first instance of the server. This might have changed in recent years, however, I would have to check.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading battery level from peripheral BLE to central BLE to iOS app.</title><link>https://devzone.nordicsemi.com/thread/198799?ContentTypeID=1</link><pubDate>Tue, 16 Jul 2019 17:58:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ee8e2c2-968a-46cd-9531-4384fc4dfbcf</guid><dc:creator>mzarling</dc:creator><description>&lt;p&gt;Now that I have two battery services running, I have one more question. How can the mobile app distinguish between the two battery services?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading battery level from peripheral BLE to central BLE to iOS app.</title><link>https://devzone.nordicsemi.com/thread/198249?ContentTypeID=1</link><pubDate>Fri, 12 Jul 2019 22:05:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5492f9f1-e99c-4d5a-a792-f2e172f8ed12</guid><dc:creator>mzarling</dc:creator><description>&lt;p&gt;I was already reviewing the BLE Relay Example, but it wasn&amp;#39;t relaying a battery service. I used the heart rate service relay as an example for a battery service relay, but I was still having issues. Then I found out that the target&amp;nbsp; peripheral was not actually notifying the battery level. I didn&amp;#39;t write the firmware for the target peripheral, but I have access to the source. On the Central device, I saw that I was getting a &lt;span style="background-color:#ffffff;"&gt;BLE_BAS_C_EVT_BATT_READ_RESP&lt;/span&gt; instead of a&amp;nbsp;&lt;span style="background-color:#ffffff;"&gt;BLE_BAS_C_EVT_BATT_NOTIFICATION&lt;/span&gt; so I placed the call for battery_level_update in the&amp;nbsp;&lt;span style="background-color:#ffffff;"&gt;bas_c_evt_handler at the switch case&amp;nbsp;&lt;span style="background-color:#ffffff;color:#000000;float:none;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;BLE_BAS_C_EVT_BATT_READ_RESP instead of the switch case&amp;nbsp;&amp;nbsp;BLE_BAS_C_EVT_BATT_NOTIFICATION. It working now. I am able to see the target peripheral battery level through the central and then to the mobile app.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="background-color:#ffffff;"&gt;&lt;span style="background-color:#ffffff;color:#000000;float:none;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;Please let me know if there is a reason I shouldn&amp;#39;t be doing it this way.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="background-color:#ffffff;"&gt;&lt;span style="background-color:#ffffff;color:#000000;float:none;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;Thank you for your help.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading battery level from peripheral BLE to central BLE to iOS app.</title><link>https://devzone.nordicsemi.com/thread/195551?ContentTypeID=1</link><pubDate>Mon, 01 Jul 2019 08:55:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:86b35189-2a33-4b91-aa09-6a4e5d028d53</guid><dc:creator>Mttrinh</dc:creator><description>&lt;p&gt;Have you taken a look at the relay example we have in the SDK? If not, I would suggest you to have a look at the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/ble_sdk_app_rscs_relay.html?cp=5_1_4_2_1_2" rel="noopener noreferrer" target="_blank"&gt;Experimental: BLE Relay Example&lt;/a&gt;, I think it will give you an idea on how to do it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading battery level from peripheral BLE to central BLE to iOS app.</title><link>https://devzone.nordicsemi.com/thread/195389?ContentTypeID=1</link><pubDate>Fri, 28 Jun 2019 13:55:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d5a9f3c1-f0d7-482a-b9e0-f895b2091eec</guid><dc:creator>mzarling</dc:creator><description>&lt;p&gt;Doesn&amp;#39;t work with iPhone or Android mobiles. There is something I&amp;#39;m missing to get the battery level through the BLE device that is acting as a Central/Collector and a Peripheral. It is reading the battery level from the end BLE peripheral (target) with &amp;quot;&lt;span style="background-color:#ffffff;"&gt;ble_bas_c_bl_read&lt;/span&gt;&amp;quot; which RTT shows is working fine. It&amp;#39;s structure is identified with BLE_BAS_C_DEF(m_bas_c). The structure BLE_BAS_DEF(m_bas_target) is defined for the battery service that the mobile app sees. How is the connection made between these two battery services to get the data from the end BLE, through another BLE and to the mobile app?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading battery level from peripheral BLE to central BLE to iOS app.</title><link>https://devzone.nordicsemi.com/thread/195325?ContentTypeID=1</link><pubDate>Fri, 28 Jun 2019 10:20:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b7d5f2e-3967-432c-b726-5c75894e0012</guid><dc:creator>Mttrinh</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Just to clarify: The issue here is that the battery level relayed from the central/peripheral device is not updated? Have you tried with our nRF Connect app to see if there is anything different?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Dont know if this will help but have you tried with other phones?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading battery level from peripheral BLE to central BLE to iOS app.</title><link>https://devzone.nordicsemi.com/thread/195229?ContentTypeID=1</link><pubDate>Thu, 27 Jun 2019 22:23:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3af1830a-0b8b-4b4e-8973-1e368ccc7884</guid><dc:creator>mzarling</dc:creator><description>&lt;p&gt;I have the peripheral/central relay device reading the peripheral battery level every 20 seconds. The battery service for the end peripheral is showing in the iOS app, but just stays with the initialized value.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>