<?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>Student Blinky Project Help</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/87045/student-blinky-project-help</link><description>Hello, 
 As part of my Senior Project for graduation I am working using the Blinky example projects to learn about BLE implementation. As part of the project I need to add in functionality that will allow a second button to light up a second LED. I could</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 21 Apr 2022 14:49:50 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/87045/student-blinky-project-help" /><item><title>RE: Student Blinky Project Help</title><link>https://devzone.nordicsemi.com/thread/364297?ContentTypeID=1</link><pubDate>Thu, 21 Apr 2022 14:49:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:77825786-e186-4102-bbd4-20ddafca6b87</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;That&amp;#39;s great, Paul!&lt;br /&gt;No problem at all, I am happy to help! :)&lt;br /&gt;I am glad to hear that it now works as intended.&lt;br /&gt;&lt;br /&gt;Please do not hesitate to open another ticket if you should encounter any other issues or questions in the future.&lt;br /&gt;&lt;br /&gt;Good luck with your development!&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Student Blinky Project Help</title><link>https://devzone.nordicsemi.com/thread/364289?ContentTypeID=1</link><pubDate>Thu, 21 Apr 2022 14:29:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:454dd9cb-0f6f-428c-86ab-b47dde984761</guid><dc:creator>MagnaObscura</dc:creator><description>&lt;p&gt;Karl,&lt;/p&gt;
&lt;p&gt;That was definitely the issue and my project now works exactly as I intended it to. Thank you so much for your help! You&amp;#39;ve been great!&lt;/p&gt;
&lt;p&gt;-Paul&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Student Blinky Project Help</title><link>https://devzone.nordicsemi.com/thread/364272?ContentTypeID=1</link><pubDate>Thu, 21 Apr 2022 13:49:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cf942abc-0e4e-47ed-9477-3b185c9d1f04</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello again, Paul&lt;br /&gt;&lt;br /&gt;Briefly looking through your code it seems to me that your second characteristic is never actually added, since the function will return immediately after having added the first LED characteristic - thus never making it to the LED2 characteristic.&lt;br /&gt;&lt;br /&gt;Please fix this, and see if it resolves your issue.&lt;br /&gt;If it does not, please elaborate further on your issue, the behavior you are seeing and how it differs from what you would have expected.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Student Blinky Project Help</title><link>https://devzone.nordicsemi.com/thread/364018?ContentTypeID=1</link><pubDate>Wed, 20 Apr 2022 15:22:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb61d56b-b195-4aa4-9e1a-923324ee60a4</guid><dc:creator>MagnaObscura</dc:creator><description>&lt;p&gt;Hi Karl,&lt;/p&gt;
&lt;p&gt;Thanks for your reply. I am still struggling with this a little bit. I am trying to add a second button characteristic and a second LED characteristic to the LBS service.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;pre class="ui-code" data-mode="c_cpp"&gt; // Add Button characteristic.
    memset(&amp;amp;add_char_params, 0, sizeof(add_char_params));
    add_char_params.uuid              = LBS_UUID_BUTTON_CHAR;
    add_char_params.uuid_type         = p_lbs-&amp;gt;uuid_type;
    add_char_params.init_len          = sizeof(uint8_t);
    add_char_params.max_len           = sizeof(uint8_t);
    add_char_params.char_props.read   = 1;
    add_char_params.char_props.notify = 1;

    add_char_params.read_access       = SEC_OPEN;
    add_char_params.cccd_write_access = SEC_OPEN;

    err_code = characteristic_add(p_lbs-&amp;gt;service_handle,
                                  &amp;amp;add_char_params,
                                  &amp;amp;p_lbs-&amp;gt;button_char_handles);
    if (err_code != NRF_SUCCESS)
    {
        return err_code;
    }

    // Add Button2 characteristic.
    memset(&amp;amp;add_char_params, 0, sizeof(add_char_params));
    add_char_params.uuid              = LBS_UUID_BUTTON2_CHAR;
    add_char_params.uuid_type         = p_lbs-&amp;gt;uuid_type;
    add_char_params.init_len          = sizeof(uint8_t);
    add_char_params.max_len           = sizeof(uint8_t);
    add_char_params.char_props.read   = 1;
    add_char_params.char_props.notify = 1;

    add_char_params.read_access       = SEC_OPEN;
    add_char_params.cccd_write_access = SEC_OPEN;

    err_code = characteristic_add(p_lbs-&amp;gt;service_handle,
                                  &amp;amp;add_char_params,
                                  &amp;amp;p_lbs-&amp;gt;button_char_handles);
    if (err_code != NRF_SUCCESS)
    {
        return err_code;
    }

    // Add LED characteristic.
    memset(&amp;amp;add_char_params, 0, sizeof(add_char_params));
    add_char_params.uuid             = LBS_UUID_LED_CHAR;
    add_char_params.uuid_type        = p_lbs-&amp;gt;uuid_type;
    add_char_params.init_len         = sizeof(uint8_t);
    add_char_params.max_len          = sizeof(uint8_t);
    add_char_params.char_props.read  = 1;
    add_char_params.char_props.write = 1;

    add_char_params.read_access  = SEC_OPEN;
    add_char_params.write_access = SEC_OPEN;

    return characteristic_add(p_lbs-&amp;gt;service_handle, &amp;amp;add_char_params, &amp;amp;p_lbs-&amp;gt;led_char_handles);

    // Add LED2 characteristic.
    memset(&amp;amp;add_char_params, 0, sizeof(add_char_params));
    add_char_params.uuid             = LBS_UUID_LED2_CHAR;
    add_char_params.uuid_type        = p_lbs-&amp;gt;uuid_type;
    add_char_params.init_len         = sizeof(uint8_t);
    add_char_params.max_len          = sizeof(uint8_t);
    add_char_params.char_props.read  = 1;
    add_char_params.char_props.write = 1;

    add_char_params.read_access  = SEC_OPEN;
    add_char_params.write_access = SEC_OPEN;

    return characteristic_add(p_lbs-&amp;gt;service_handle, &amp;amp;add_char_params, &amp;amp;p_lbs-&amp;gt;led_char_handles);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;LED2 and BUTTON2 are my new characteristics, but I guess I&amp;#39;m not certain that I understand if this will work or not. Further, this is the current handler for the LED writes:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void led_write_handler(uint16_t conn_handle, ble_lbs_t * p_lbs, uint8_t led_state)
{
    if (led_state)
    {
        bsp_board_led_on(LEDBUTTON_LED);
        NRF_LOG_INFO(&amp;quot;Received LED ON!&amp;quot;);
    }
    else
    {
        bsp_board_led_off(LEDBUTTON_LED);
        NRF_LOG_INFO(&amp;quot;Received LED OFF!&amp;quot;);
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I notice that this will never turn on my LEDBUTTON2_LED which I have defined along with LED_BUTTON2_BUTTON.&lt;/p&gt;
&lt;p&gt;I guess I just don&amp;#39;t know where to go form here.&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
&lt;p&gt;-Paul&lt;/p&gt;
&lt;div style="font-weight:400;" id="mouseposition-extension-element-full-container"&gt;
&lt;div style="background:rgba(255, 255, 255, 0.7);color:#000000;cursor:default;display:none;font-family:&amp;#39;Helvetica Neue&amp;#39;, Helvetica, Arial, sans-serif;font-size:12px;height:0px;position:absolute;width:0px;" id="mouseposition-extension-element-rect-display"&gt;
&lt;pre style="background-color:rgba(255, 255, 255, 0.7);color:#000000;text-align:center;"&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;pre style="background:#ffffff;border-color:#222222 black #333333;border-radius:3px;border-style:solid;border-width:1px;color:#222222;cursor:default;display:none;font-family:&amp;#39;Helvetica Neue&amp;#39;, Helvetica, Arial, sans-serif;font-size:12px;line-height:14px;padding:3px;position:absolute;" id="mouseposition-extension-element-coordinate-display"&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Student Blinky Project Help</title><link>https://devzone.nordicsemi.com/thread/363595?ContentTypeID=1</link><pubDate>Tue, 19 Apr 2022 12:53:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ea406fb-a7ee-4e24-bd24-9a0ea02b784b</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user=""]to learn about BLE implementation.[/quote]
&lt;p&gt;Please do not hesitate to ask if you should have any questions about BLE development or implementations, we&amp;#39;re happy to help you!&lt;/p&gt;
[quote user=""]As part of the project I need to add in functionality that will allow a second button to light up a second LED. I could use some guidance on this. I don&amp;#39;t need the code written for me or anything, I just need help figuring out where to add in the extra characteristic and what other things I might need to modify.[/quote]
&lt;p&gt;I assume you have already taken a look at &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/ble_sdk_app_blinky.html"&gt;the ble_blinky examples&lt;/a&gt;&amp;nbsp;from the SDK since you mention them, where you can see exactly how you could implement the functionality you describe - it can however be hard to understand how they work just by looking at the code, without knowing the process that the code is implementing. &lt;br /&gt;In essence, the central example functions by initiating a connection to a advertising peripheral that fits its device name filter, which is &amp;quot;Nordic_Blinky&amp;quot; in this case, and then enabling CCCD for the specific lbs service&amp;#39;s characteristic.&lt;br /&gt;Enabling CCCD means that you enable notifications, which translates to &amp;#39;send me a message whenever the value of this characteristic changes&amp;#39;.&lt;br /&gt;Thus, the peripheral is able to alert the central device about a button press through this characteristic, so that it may update its LED status. Since the central is the &amp;#39;master&amp;#39; in the communication between the devices it is able to update the peripheral device on any of its own LED status changes whenever it would like.&lt;br /&gt;&lt;br /&gt;I highly recommend reading through &lt;a href="https://devzone.nordicsemi.com/guides/short-range-guides/b/bluetooth-low-energy/posts/ble-advertising-a-beginners-tutorial"&gt;the beginner&amp;#39;s guide to advertising&lt;/a&gt;, and the following services and characteristics parts of the tutorial series, to better understand how the communication is structured and implemented.&lt;br /&gt;Understanding the BLE blinky code will be much easier after you have read through these tutorials.&lt;br /&gt;Please do not hesitate to ask if you should have any questions!&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>