<?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>added service nRF51 SDK9</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/21264/added-service-nrf51-sdk9</link><description>I added service into ble_app_template 
 in static void services_init(void) {}
 
 like this 
 #define NUS_BASE_UUID {{0x9E, 0xCA, 0xDC, 0x24, 0x0E, 0xE5, 0xA9, 0xE0, 0x93, 0xF3, 0xA3, 0xB5, 0x00, 0x00, 0x40, 0x6E}}

#define BLE_UUID 0x0005 

ble_uuid128_t</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 11 Apr 2017 06:45:28 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/21264/added-service-nrf51-sdk9" /><item><title>RE: added service nRF51 SDK9</title><link>https://devzone.nordicsemi.com/thread/83245?ContentTypeID=1</link><pubDate>Tue, 11 Apr 2017 06:45:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0f43aae9-5f26-4d2d-8a4c-37e41c49421b</guid><dc:creator>Mikhail</dc:creator><description>&lt;p&gt;Thanks for answer. There are two projects in examples (SDK9):
1- ble_app_uart_s130
I call&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;services_init();
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;where I call&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;err_code = ble_nus_init(&amp;amp;m_nus, &amp;amp;nus_init);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;where I added UUID&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ble_uuid128_t nus_base_uuid = NUS_BASE_UUID;
...
err_code = sd_ble_uuid_vs_add(&amp;amp;nus_base_uuid, &amp;amp;p_nus-&amp;gt;uuid_type);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And at this case I can observer on my smartfone (central role) this UUID when discovered.&lt;/p&gt;
&lt;p&gt;2- In those examples we have ble_app_template
where I insert same code like previwes example into&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static void services_init(void)
{
    /* YOUR_JOB: Add code to initialize the services used by the application.
    uint32_t                           err_code;
    ble_xxs_init_t                     xxs_init;
    ble_yys_init_t                     yys_init;

    // Initialize XXX Service.
    memset(&amp;amp;xxs_init, 0, sizeof(xxs_init));

    xxs_init.evt_handler                = NULL;
    xxs_init.is_xxx_notify_supported    = true;
    xxs_init.ble_xx_initial_value.level = 100; 
    
    err_code = ble_bas_init(&amp;amp;m_xxs, &amp;amp;xxs_init);
    APP_ERROR_CHECK(err_code);

    // Initialize YYY Service.
    memset(&amp;amp;yys_init, 0, sizeof(yys_init));
    yys_init.evt_handler                  = on_yys_evt;
    yys_init.ble_yy_initial_value.counter = 0;

    err_code = ble_yy_service_init(&amp;amp;yys_init, &amp;amp;yy_init);
    APP_ERROR_CHECK(err_code);
    */
			
	ble_uuid128_t base_uuid = NUS_BASE_UUID;   
	ble_uuid_t    ble_uuid = { . uuid = BLE_UUID }; 
    uint32_t 	  err_code = sd_ble_uuid_vs_add(&amp;amp;base_uuid, &amp;amp;ble_uuid.type);
    APP_ERROR_CHECK(err_code);
  
	uint16_t      service_handle;		  
    err_code = sd_ble_gatts_service_add(BLE_GATTS_SRVC_TYPE_PRIMARY, &amp;amp;ble_uuid, &amp;amp;service_handle);  
    APP_ERROR_CHECK(err_code);	
	
	sd_ble_gap_appearance_set(BLE_APPEARANCE_GENERIC_TAG);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;but now I can&amp;#39;t see on my smartfone same service.
Why?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: added service nRF51 SDK9</title><link>https://devzone.nordicsemi.com/thread/83246?ContentTypeID=1</link><pubDate>Tue, 11 Apr 2017 02:35:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:97e969ce-3315-4f2e-87a8-f21f20be3d2e</guid><dc:creator>Linxi</dc:creator><description>&lt;p&gt;Use &amp;quot;nrf Connect&amp;quot; to connect with your device ，then check if there is an unknown service has the same uuid with yours.&lt;/p&gt;
&lt;p&gt;It seems that you are adding a vendor defined uuid .You should describe your question more detailed. You don&amp;#39;t see this service ,by scanning or connecting ? If scan ,you should add uuid to advertising packet, if connected, you should check your initialization procedure.&lt;/p&gt;
&lt;h4&gt;&lt;/h4&gt;
&lt;p&gt;Hi:
I don&amp;#39;t think it&amp;#39;s right.  ----&amp;gt; #define BLE_UUID  0x0005
Look at this defination :     uint16_t    uuid; /**&amp;lt; 16-bit UUID value or octets 12-13 of 128-bit UUID. */&lt;/p&gt;
&lt;p&gt;If your UUID is true service uuid,the right value should be 0x0000 , 12-13 of 128-bit UUID.
But you can see that ,its name is  NUS_BASE_UUID. You know? It&amp;#39;s a basal uuid.&lt;/p&gt;
&lt;p&gt;12-13 of nus service is defined by nordic ,you can not change it .
As I know , ble uart service&amp;#39;s (nus) UUID is 0x0001&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define BLE_UUID_NUS_SERVICE 0x0001
#define BLE_UUID_NUS_TX_CHARACTERISTIC 0x0002/**&amp;lt; The UUID of the TX Characteristic. */
#define BLE_UUID_NUS_RX_CHARACTERISTIC 0x0003 /**&amp;lt; The UUID of the RX Characteristic.*/
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>