<?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>Why BLE Apps receive 1 byte only From NRF52840DK</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/58424/why-ble-apps-receive-1-byte-only-from-nrf52840dk</link><description>I am using nrf52840 . I am sending data 2 bytes as FF .I put the data in 2d array like this. char dataSend[1][5]={&amp;quot;FF&amp;quot;}; This char dataSend has 1 row and 5 length .This should send as 2 bytes . I already debug in terminal as it will print and send as</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 02 Mar 2020 07:20:20 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/58424/why-ble-apps-receive-1-byte-only-from-nrf52840dk" /><item><title>RE: Why BLE Apps receive 1 byte only From NRF52840DK</title><link>https://devzone.nordicsemi.com/thread/237319?ContentTypeID=1</link><pubDate>Mon, 02 Mar 2020 07:20:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3cde033a-d7fd-4c31-98e7-8dab2e8b4ade</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When you are using quotations&amp;nbsp;the data is treated as a null terminated ASCII string, and {&amp;quot;FF&amp;quot;} essentially becomes&amp;nbsp;{70, 70, 0}.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To assign 0xFF to a variable you just use the hex representation directly, without the quotations:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;char dataSend[1][5]={0xFF};&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Please be aware that the compiler might complain about this, since the value of a normal char is -128 to 127, and a value of 255 would be outside this range.&amp;nbsp;&lt;br /&gt;You should use an unsigned char instead (or uint8_t in the nRF5 SDK):&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;uint8_t dataSend[1][5] = {0xFF};&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I am not sure why you only receive a single byte on the Android side. Can you tell me which example you are using on the nRF52 side, and send me the code you use to send the data from the nRF52?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Unless I missed it I can only see the Android code in your post.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards&lt;br /&gt;Torbjørn&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>