<?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>Only one character is seen when reading a string as a gatt characteristic</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/125484/only-one-character-is-seen-when-reading-a-string-as-a-gatt-characteristic</link><description>I&amp;#39;m leveraging a fuel_gauge example to pass a version string as part of a Device Information Service. When viewed in Nrf Connect (desktop or mobile) only the first character is seen. 
 
 However, the indication sees the whole string. 
 
 To simplify the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 10 Nov 2025 14:42:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/125484/only-one-character-is-seen-when-reading-a-string-as-a-gatt-characteristic" /><item><title>RE: Only one character is seen when reading a string as a gatt characteristic</title><link>https://devzone.nordicsemi.com/thread/553841?ContentTypeID=1</link><pubDate>Mon, 10 Nov 2025 14:42:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:99d75b7b-e0d2-4b7e-8b7c-2c39c09e2e31</guid><dc:creator>kruenheck</dc:creator><description>&lt;p&gt;that fixed it, thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Only one character is seen when reading a string as a gatt characteristic</title><link>https://devzone.nordicsemi.com/thread/553809?ContentTypeID=1</link><pubDate>Mon, 10 Nov 2025 12:01:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:384ca2ad-05ff-44a0-a5ce-f219f1bf5f39</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Keith,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;I assume you were using the same read callback implementation showed in the peripheral_lbs or in the academy BLE course ?&amp;nbsp;&lt;br /&gt;I think the issue is that you pass&amp;nbsp;&amp;nbsp;sizeof(*value) as the length of the attribute. In LBS sample it&amp;#39;s only one byte boolean either the button is 1 or it&amp;#39;s 0.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;In your case you will need to pass the actual length of the version string &lt;span&gt;swRev_state&lt;/span&gt;. Also make sure you declare the buffer&amp;nbsp;&lt;span&gt;swRev_state as a string/array.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Only one character is seen when reading a string as a gatt characteristic</title><link>https://devzone.nordicsemi.com/thread/553708?ContentTypeID=1</link><pubDate>Fri, 07 Nov 2025 14:54:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:81008816-bfb9-4169-ad2d-7bf3f9b0c9b4</guid><dc:creator>kruenheck</dc:creator><description>&lt;p&gt;here is the important pieces:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;pre class="ui-code" data-mode="text"&gt;static ssize_t read_swRev(struct bt_conn *conn, const struct bt_gatt_attr *attr, void *buf, uint16_t len, uint16_t offset)
{
&amp;#160; &amp;#160; // get a pointer to software revision which is passed in the BT_GATT_CHARACTERISTIC() and stored in attr-&amp;gt;user_data
&amp;#160; &amp;#160; const char *value = attr-&amp;gt;user_data;

&amp;#160; &amp;#160; if (dis_cb.swRev_cb)
&amp;#160; &amp;#160; {
&amp;#160; &amp;#160; &amp;#160; &amp;#160;&amp;#160;swRev_state = dis_cb.swRev_cb();&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;&amp;#160;
&amp;#160; &amp;#160; &amp;#160; &amp;#160; return bt_gatt_attr_read(conn, attr, buf, len, offset, value, sizeof(*value));&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;
&amp;#160; &amp;#160; }

&amp;#160; &amp;#160; return 0;
}


static struct my_dis_cb appDis_callbacks =
{
&amp;#160; &amp;#160; &amp;#160; &amp;#160; .swRev_cb = app_SwRev_cb,
};
&amp;#160;

#define SW_REVISION &amp;#160;
static char *app_SwRev_cb(void)
{
&amp;#160; &amp;#160; return &amp;quot;Rev0_04&amp;quot;;
}&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Only one character is seen when reading a string as a gatt characteristic</title><link>https://devzone.nordicsemi.com/thread/553688?ContentTypeID=1</link><pubDate>Fri, 07 Nov 2025 13:32:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39a98602-168a-4bcb-80af-313615855077</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Keith,&amp;nbsp;&lt;br /&gt;What do you have in&amp;nbsp;&lt;span&gt;read_swRev() ? It&amp;#39;s where the application supply to the stack what value it should return to the client when a read request is sent.&amp;nbsp;&lt;br /&gt;Can you provide the project here so we can take a look ?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>