<?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>Solution of the &amp;quot;Challenge 1&amp;quot; (Nordic tutorial)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/18636/solution-of-the-challenge-1-nordic-tutorial</link><description>Hello, 
 I used this tutorial :
 devzone.nordicsemi.com/.../ 
 But I can&amp;#39;t resolve the &amp;quot;Challenge 1&amp;quot; (write 4 bytes on the characteristic).
Can you explain me, please ? :-) 
 Thanks a lot !</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 28 Dec 2016 12:31:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/18636/solution-of-the-challenge-1-nordic-tutorial" /><item><title>RE: Solution of the "Challenge 1" (Nordic tutorial)</title><link>https://devzone.nordicsemi.com/thread/71982?ContentTypeID=1</link><pubDate>Wed, 28 Dec 2016 12:31:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d3b796f7-9722-4338-be0d-f9b4d8a1051c</guid><dc:creator>TheRaven</dc:creator><description>&lt;p&gt;Yes of course ! ;-)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Solution of the "Challenge 1" (Nordic tutorial)</title><link>https://devzone.nordicsemi.com/thread/71981?ContentTypeID=1</link><pubDate>Wed, 28 Dec 2016 12:19:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0f1301aa-8125-42ef-a99c-4cdbea6e48d4</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Great! If it does, I would appreciate if you would accept my answer by clicking the circle next to it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Solution of the "Challenge 1" (Nordic tutorial)</title><link>https://devzone.nordicsemi.com/thread/71980?ContentTypeID=1</link><pubDate>Wed, 28 Dec 2016 12:10:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a042f63c-8cbf-4f5c-bd2a-078d536f2844</guid><dc:creator>TheRaven</dc:creator><description>&lt;p&gt;Ok, I will do it.
Yes, now, I&amp;#39;ve put len equal to 4.
And I replace : uint32_t ble_lbs_on_button_change(ble_lbs_t * p_lbs, uint8_t button_state)
by : uint32_t ble_lbs_on_button_change(ble_lbs_t * p_lbs, uint8_t button_state[4])&lt;/p&gt;
&lt;p&gt;And now, it seems it works :-)
(I&amp;#39;m going to do some tests to see if it always works good).
Thanks !&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Solution of the "Challenge 1" (Nordic tutorial)</title><link>https://devzone.nordicsemi.com/thread/71979?ContentTypeID=1</link><pubDate>Wed, 28 Dec 2016 12:04:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7a008c31-4256-4a83-b389-4cbb3c8c0de1</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;I recommend doing the tutorial with the example files provided, or else at least this challenge doesn&amp;#39;t make sense, because challenge 1 and 2 shouldn&amp;#39;t be a problem while you get trouble with challenge 3.&lt;/p&gt;
&lt;p&gt;What is len? Is it 4?&lt;/p&gt;
&lt;p&gt;Also you have to change the max length (attr_char_value.max_len) of the button characteristic value.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Solution of the "Challenge 1" (Nordic tutorial)</title><link>https://devzone.nordicsemi.com/thread/71978?ContentTypeID=1</link><pubDate>Wed, 28 Dec 2016 11:46:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e737c80-532b-40dc-a9c0-2f94847a9920</guid><dc:creator>TheRaven</dc:creator><description>&lt;p&gt;ps : I tried to do it on the example &amp;quot;ble_lbs&amp;quot;, so currently, I have :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uint32_t ble_lbs_on_button_change(ble_lbs_t * p_lbs, uint8_t button_state)
{
    ble_gatts_hvx_params_t params;
    uint16_t len = sizeof(button_state);
    
    memset(&amp;amp;params, 0, sizeof(params));
    params.type = BLE_GATT_HVX_NOTIFICATION;
		params.handle = p_lbs-&amp;gt;button_char_handles.value_handle;
    params.p_data = &amp;amp;button_state;
    params.p_len = &amp;amp;len;
    
    return sd_ble_gatts_hvx(p_lbs-&amp;gt;conn_handle, &amp;amp;params);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I think I have to modify this function, because when I use it, it only changes the first byte (and the 3 others are 34 56 78).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>