<?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>Periperal + Broadcaster  role</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/13280/periperal-broadcaster-role</link><description>hello , 
 i want to know if there an example available that has both peripheral + Broadcaster role running at the same time , Broadcaster advertise the service in the peripheral and its rssi ? 
 Thanks</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 22 Apr 2016 15:20:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/13280/periperal-broadcaster-role" /><item><title>RE: Periperal + Broadcaster  role</title><link>https://devzone.nordicsemi.com/thread/50629?ContentTypeID=1</link><pubDate>Fri, 22 Apr 2016 15:20:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16442102-75ef-4737-9dfc-cf0960d93906</guid><dc:creator>Brook Gebremedhin</dc:creator><description>&lt;p&gt;ok  thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Periperal + Broadcaster  role</title><link>https://devzone.nordicsemi.com/thread/50628?ContentTypeID=1</link><pubDate>Fri, 22 Apr 2016 15:07:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:05992d8d-4b3e-4293-9891-6f843ca784d5</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;q4) Yes.
q5) Please add a new question for this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Periperal + Broadcaster  role</title><link>https://devzone.nordicsemi.com/thread/50627?ContentTypeID=1</link><pubDate>Fri, 22 Apr 2016 14:48:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2eada659-66ff-4a30-9747-99913cc592c4</guid><dc:creator>Brook Gebremedhin</dc:creator><description>&lt;p&gt;@petter&lt;/p&gt;
&lt;p&gt;thanks again.&lt;/p&gt;
&lt;p&gt;q4) I wanted to brodcast an exising service that is available in periperal role , not a new one is it possible?
q5) I also didnt see any example of Observer role , can you direct me to that example.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Periperal + Broadcaster  role</title><link>https://devzone.nordicsemi.com/thread/50626?ContentTypeID=1</link><pubDate>Wed, 20 Apr 2016 07:31:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:632408fd-eef1-431a-992a-42989c0b1a5b</guid><dc:creator>Brook Gebremedhin</dc:creator><description>&lt;p&gt;@petter , i am not sure how to add the custom service  through this function. how do i connect my service  with sd_ble_gap_adv_data_set()  ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Periperal + Broadcaster  role</title><link>https://devzone.nordicsemi.com/thread/50625?ContentTypeID=1</link><pubDate>Wed, 20 Apr 2016 05:50:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f604047-e09e-40ef-989b-0b8a290fd9cb</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;What is the problem?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Periperal + Broadcaster  role</title><link>https://devzone.nordicsemi.com/thread/50624?ContentTypeID=1</link><pubDate>Tue, 19 Apr 2016 13:59:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0df4dec2-a705-4d0c-ba1f-d7c1c1a2376b</guid><dc:creator>Brook Gebremedhin</dc:creator><description>&lt;p&gt;@petter,&lt;/p&gt;
&lt;p&gt;your code for the non broadcasting works fine.
but am having trouble to add existing custom service to the non connectable
advertising. could you provide me a sudo code for this ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Periperal + Broadcaster  role</title><link>https://devzone.nordicsemi.com/thread/50621?ContentTypeID=1</link><pubDate>Tue, 19 Apr 2016 13:58:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:54b3a6cb-5756-4bbc-848c-d9810fb8f7f0</guid><dc:creator>Brook Gebremedhin</dc:creator><description>&lt;p&gt;@petter,&lt;/p&gt;
&lt;p&gt;your code for the non broadcasting works fine.
but am having trouble to add existing custom service to the non connectable
advertising. could you provide me a sudo code for this ?
tnx&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Periperal + Broadcaster  role</title><link>https://devzone.nordicsemi.com/thread/50623?ContentTypeID=1</link><pubDate>Mon, 18 Apr 2016 12:05:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af0d234a-72f8-426c-8934-da4dc394fa2a</guid><dc:creator>Brook Gebremedhin</dc:creator><description>&lt;p&gt;@Petter , hi thanks for the reply.&lt;/p&gt;
&lt;p&gt;Q1) if i understand correctly once my periperal role is connected to a central device , i can call sd_ble_gap_adv_start() to do non-connectable advertising ? , can you show me sudo code for this as there is no example for this ?&lt;/p&gt;
&lt;p&gt;Q2) the other thing is while am in non-connectable advertising mode how can i adversise we my service ?&lt;/p&gt;
&lt;p&gt;Q3) to read this non connectable service , which role does the other ble device has to be observer or central or both are possible ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Periperal + Broadcaster  role</title><link>https://devzone.nordicsemi.com/thread/50622?ContentTypeID=1</link><pubDate>Mon, 18 Apr 2016 11:47:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:98471bdc-282d-4940-86bf-c86332171162</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;I&amp;#39;m actually not aware of any example, but there are several questions about this on DevZone.&lt;/p&gt;
&lt;p&gt;It should be simply to set the advertising data with sd_ble_gap_adv_data_set() (through ble_advdata_set()) and call sd_ble_gap_adv_start(). See &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s130.api.v2.0.0/group___b_l_e___g_a_p___a_d_v___m_s_c.html?cp=2_6_2_1_0_2_1_3_0"&gt;this&lt;/a&gt; MSC.&lt;/p&gt;
&lt;p&gt;Please be aware that you per spec only can do non-connectable advertising while in a connection.&lt;/p&gt;
&lt;p&gt;Putting in an UUID (service) shouldn&amp;#39;t be too hard. I&amp;#39;m not sure what RSSI you would be putting in? What received signal strength would you be putting in?&lt;/p&gt;
&lt;p&gt;Edit1:&lt;/p&gt;
&lt;p&gt;Q1) Yes. Something like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ble_gap_adv_params_t m_adv_params;

m_adv_params.type        = BLE_GAP_ADV_TYPE_ADV_NONCONN_IND;
m_adv_params.p_peer_addr = NULL;
m_adv_params.fp          = BLE_GAP_ADV_FP_ANY;
m_adv_params.interval    = NON_CONNECTABLE_ADV_INTERVAL;
m_adv_params.timeout     = APP_CFG_NON_CONN_ADV_TIMEOUT;

err_code = sd_ble_gap_adv_start(&amp;amp;m_adv_params);
APP_ERROR_CHECK(err_code);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Q2) You need to add your UUID to the ble_advdata_t struct that you give to ble_advdata_set(). You can have a look at how this is populated in one of our examples.&lt;/p&gt;
&lt;p&gt;Q3) Both&lt;/p&gt;
&lt;p&gt;Edit2:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;int main(void)
{
    uint32_t err_code;
    ble_stack_init();
    
    ble_uuid_t    ble_uuid;
    ble_uuid128_t base_uuid = {{0x9E, 0xCA, 0xDC, 0x24, 0x0E, 0xE5, 0xA9, 0xE0, 0x93, 0xF3, 0xA3, 0xB5, 0x00, 0x00, 0x40, 0x6E}};
    
    err_code = sd_ble_uuid_vs_add(&amp;amp;base_uuid, &amp;amp;ble_uuid.type);
    APP_ERROR_CHECK(err_code);

    ble_uuid.uuid = 0x0001;
    
    ble_gap_conn_sec_mode_t sec_mode;

    BLE_GAP_CONN_SEC_MODE_SET_OPEN(&amp;amp;sec_mode);
              
    err_code = sd_ble_gap_device_name_set(&amp;amp;sec_mode, &amp;quot;propUUID&amp;quot;, 8);
    APP_ERROR_CHECK(err_code);
    
    ble_advdata_t advdata;
    memset(&amp;amp;advdata, 0, sizeof(advdata));
    
    advdata.name_type          = BLE_ADVDATA_FULL_NAME;
    advdata.flags = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
    
    advdata.uuids_complete.p_uuids = &amp;amp;ble_uuid;
    advdata.uuids_complete.uuid_cnt = 1;

    err_code = ble_advdata_set(&amp;amp;advdata, NULL);
    APP_ERROR_CHECK(err_code);
                                          
    ble_gap_adv_params_t adv_params;
    memset(&amp;amp;adv_params, 0, sizeof(adv_params));

    adv_params.type        = BLE_GAP_ADV_TYPE_ADV_NONCONN_IND;
    adv_params.interval    = 200;
    adv_params.timeout     = 0;

    err_code = sd_ble_gap_adv_start(&amp;amp;adv_params);
    APP_ERROR_CHECK(err_code);
    
    // Enter main loop.
    for (;;)
    {
        power_manage();
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>