<?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>AndroidOS seems to treat Gatt Status as an 8 bit number, rather than 16</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/47646/androidos-seems-to-treat-gatt-status-as-an-8-bit-number-rather-than-16</link><description>I&amp;#39;m returning an error code on a rw_authorized characteristic using uint32_t sd_ble_gatts_rw_authorize_reply(uin16_t conn_handle, ble_gatts_rw_authorize_reply_params_t * auth_reply); 
 auth_reply contains a 16 bit gatt status field 
 On a read that my</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 23 May 2019 21:30:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/47646/androidos-seems-to-treat-gatt-status-as-an-8-bit-number-rather-than-16" /><item><title>RE: AndroidOS seems to treat Gatt Status as an 8 bit number, rather than 16</title><link>https://devzone.nordicsemi.com/thread/188921?ContentTypeID=1</link><pubDate>Thu, 23 May 2019 21:30:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:04ffcbd1-356c-4f7b-a094-92b1403865ff</guid><dc:creator>goldwake</dc:creator><description>&lt;p&gt;Thanks Hung Bui, that&amp;#39;s realy helpful&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AndroidOS seems to treat Gatt Status as an 8 bit number, rather than 16</title><link>https://devzone.nordicsemi.com/thread/188821?ContentTypeID=1</link><pubDate>Thu, 23 May 2019 12:25:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3f8d96ec-a4c9-4207-bab1-86ceba651f3d</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please be aware that the&amp;nbsp;gatt_status (BLE_GATT_STATUS_CODES) in our stack is not directly matched to the ATT error codes defined in Bluetooth spec.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The expected error code for a read request is defined by the spec as follow (Bluetooth v5.0 spec):&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/486x608/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-57b6eae55c0e4afdbd12cba0dc83703d/pastedimage1558614224626v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;As you can find in your case you should return &amp;quot;Read Not Permitted&amp;quot; , this is matched with our message sequence chart of the function usage here:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v6.1.1/group___b_l_e___g_a_t_t_s___r_e_a_d___r_e_q___a_u_t_h___m_s_c.html?cp=3_4_1_1_2_4_3_13"&gt;https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v6.1.1/group___b_l_e___g_a_t_t_s___r_e_a_d___r_e_q___a_u_t_h___m_s_c.html?cp=3_4_1_1_2_4_3_13&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So, please use&amp;nbsp;BLE_GATT_STATUS_ATTERR_READ_NOT_PERMITTED as the return status.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AndroidOS seems to treat Gatt Status as an 8 bit number, rather than 16</title><link>https://devzone.nordicsemi.com/thread/188671?ContentTypeID=1</link><pubDate>Thu, 23 May 2019 01:57:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:358291a2-e494-4983-be4a-3ffe70ef7170</guid><dc:creator>goldwake</dc:creator><description>&lt;p&gt;I&amp;#39;ve found android &lt;a href="https://android.googlesource.com/platform/external/bluetooth/bluedroid/+/refs/heads/master/stack/include/gatt_api.h"&gt;gatt_api.h file &lt;/a&gt;which contains&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="java"&gt;typedef UINT8 tGATT_STATUS;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;looks like it definitely is being treated as an 8bit number&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>