<?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>PCA10056/NRF52840 used android Blinky source code.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/36212/pca10056-nrf52840-used-android-blinky-source-code</link><description>If I want to send two byte, how can I do? I use the https://github.com/NordicSemiconductor/Android-nRF-Blinky sample code. 
 In BlinkyManage.jave 
 
 public void send(final boolean onOff) { // Are we connected? if (mLedCharacteristic == null) return;</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 12 Jul 2018 02:39:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/36212/pca10056-nrf52840-used-android-blinky-source-code" /><item><title>RE: PCA10056/NRF52840 used android Blinky source code.</title><link>https://devzone.nordicsemi.com/thread/139805?ContentTypeID=1</link><pubDate>Thu, 12 Jul 2018 02:39:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c7663bde-4f5b-46a1-987e-68f6d2f3f251</guid><dc:creator>Ray Chiou</dc:creator><description>&lt;p&gt;Thank you very much.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PCA10056/NRF52840 used android Blinky source code.</title><link>https://devzone.nordicsemi.com/thread/139609?ContentTypeID=1</link><pubDate>Tue, 10 Jul 2018 14:42:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:893bc78f-56b0-411e-b50a-cc4523f5a46a</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Ray&lt;/p&gt;
&lt;p&gt;On the Android side, all you have to do is to initialize the command variable with two bytes instead of one:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;// Set the command buffer to {0x01, 0x02}&lt;/code&gt;&lt;br /&gt;&lt;code&gt;final byte[] command = new byte[]{(byte)0x01, (byte)0x02};&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Please note that the blinky service is only set up to send/receive one byte on each of the two characteristics. To change this you would have to modify the characteristic configuration in ble_lbs.c to increase the max length to more than 1 byte (excerpt from line 119):&lt;/p&gt;
&lt;p&gt;&lt;code&gt; attr_char_value.p_uuid = &amp;amp;ble_uuid;&lt;/code&gt;&lt;br /&gt;&lt;code&gt; attr_char_value.p_attr_md = &amp;amp;attr_md;&lt;/code&gt;&lt;br /&gt;&lt;code&gt; attr_char_value.init_len = &lt;strong&gt;&lt;span style="color:#ff0000;"&gt;sizeof(uint8_t)&lt;/span&gt;&lt;/strong&gt;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt; attr_char_value.init_offs = 0;&lt;/code&gt;&lt;br /&gt;&lt;code&gt; attr_char_value.max_len = &lt;strong&gt;&lt;span style="color:#ff0000;"&gt;sizeof(uint8_t)&lt;/span&gt;&lt;/strong&gt;;&lt;/code&gt;&lt;br /&gt;&lt;code&gt; attr_char_value.p_value = NULL;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;If you do this I would recommend making a copy of the ble_lbs.c and ble_lbs.h files, and change the LBS_UUID_BASE define to avoid mixing your service up with the original blinky service.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>