<?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>How to Implement Cable Replacement Service?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/6454/how-to-implement-cable-replacement-service</link><description>Hi Team, 
 Can anyone help regarding Cable Replacement service.
Is this service is already supported in softdevices?
What are the options if not supported?</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 24 Apr 2015 08:45:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/6454/how-to-implement-cable-replacement-service" /><item><title>RE: How to Implement Cable Replacement Service?</title><link>https://devzone.nordicsemi.com/thread/22514?ContentTypeID=1</link><pubDate>Fri, 24 Apr 2015 08:45:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:46776611-517d-4912-ade3-cdb57fa77b5c</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;p&gt;Can you please open up a new thread for this? This thread is getting quite messy. Also, it is easier for others to help you as well when the question is on the top and they don&amp;#39;t have to scroll down 10 meters to see it :) Probably no one is even looking down here.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to Implement Cable Replacement Service?</title><link>https://devzone.nordicsemi.com/thread/22513?ContentTypeID=1</link><pubDate>Fri, 24 Apr 2015 04:49:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1dde4cbe-67a3-44a5-9036-d3f71160a295</guid><dc:creator>Milan</dc:creator><description>&lt;p&gt;Hi Stian,&lt;/p&gt;
&lt;p&gt;Many thanks for this very useful help.&lt;/p&gt;
&lt;p&gt;I have successfully achieved this yesterday and now only following is pending:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Adding Characteristic User Description 0x2901,0x2902&lt;/li&gt;
&lt;li&gt;and what exactly to do inside read, write and how to assign attribute handle etc.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I have sniffed few packet of existing blugiga and I am trying to implement the same in our Nordic.&lt;/p&gt;
&lt;p&gt;Regards,
Milan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to Implement Cable Replacement Service?</title><link>https://devzone.nordicsemi.com/thread/22512?ContentTypeID=1</link><pubDate>Thu, 23 Apr 2015 14:26:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:36b736e5-a365-48df-877e-dbbb94cf49f8</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;p&gt;I edited my answer to show how to use custom 128 UUIDs&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to Implement Cable Replacement Service?</title><link>https://devzone.nordicsemi.com/thread/22511?ContentTypeID=1</link><pubDate>Wed, 15 Apr 2015 09:20:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a0a1eb85-fe15-45d4-a830-a41869ecd0d2</guid><dc:creator>Milan</dc:creator><description>&lt;p&gt;Thanks Stian and Jason!!&lt;/p&gt;
&lt;p&gt;I have started working on this but seems difficult.
See the image.  These is what I need to implement in NORDIC Soc.
&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/shot_5F00_2015_2D00_04_2D00_23_5F00_11_2D00_07_2D00_00.png" alt="image description" /&gt;&lt;/p&gt;
&lt;p&gt;I have successfully set Service UUID.&lt;/p&gt;
&lt;p&gt;I am unable to set 128-bit characteristic UUID and
listed descriptors.&lt;/p&gt;
&lt;p&gt;I also want to change MAC address which is sent in advertising.  Guide me at what point this could be done.&lt;/p&gt;
&lt;p&gt;Please help ASAP!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to Implement Cable Replacement Service?</title><link>https://devzone.nordicsemi.com/thread/22510?ContentTypeID=1</link><pubDate>Tue, 14 Apr 2015 14:18:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:778e8c7a-1f34-44ca-b6de-17f0e877129a</guid><dc:creator>Jason</dc:creator><description>&lt;p&gt;You may can refer to our &amp;quot;&lt;a href="http://www.embeda.com.tw/ucxpresso/?article=2-1-make-your-own-rc-app"&gt;2-1. Make your own RC App&lt;/a&gt;&amp;quot; for the bleServiceUART.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to Implement Cable Replacement Service?</title><link>https://devzone.nordicsemi.com/thread/22509?ContentTypeID=1</link><pubDate>Tue, 14 Apr 2015 09:24:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4e6182e6-4bf0-485f-ae2f-9473de1b39eb</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;p&gt;We have the nAN-36 document that shows how to set up a custom characteristic with a custom UUID: &lt;a href="https://www.nordicsemi.com/eng/nordic/download_resource/24020/5/6058527"&gt;www.nordicsemi.com/.../6058527&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The app note is written for an older SDK, but you can find the updated code here: &lt;a href="https://github.com/NordicSemiconductor/nrf51-ble-app-lbs"&gt;github.com/.../nrf51-ble-app-lbs&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I would recommend to download the SDK from here: &lt;a href="http://developer.nordicsemi.com/nRF51_SDK/nRF51_SDK_v8.x.x/"&gt;developer.nordicsemi.com/.../&lt;/a&gt; (not packs), and unzip the github example into the &amp;#39;ble_peripheral&amp;#39; folder in the SDK.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to Implement Cable Replacement Service?</title><link>https://devzone.nordicsemi.com/thread/22508?ContentTypeID=1</link><pubDate>Tue, 14 Apr 2015 08:40:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1827bb4f-286e-4b7c-9907-9677c0d48315</guid><dc:creator>Milan</dc:creator><description>&lt;p&gt;Do I need to modify &amp;quot;ble_uart_app&amp;quot; such that it works like cable replacement profile of bluegiga?
Can you guide or any tutorial available which may help in this?
Right now I don&amp;#39;t have clarity like where to provide
&lt;strong&gt;bluegigia uuid&lt;/strong&gt; - 0bd51666-e7cb-469b-e84d-2742f1ba77cc in &amp;quot;ble_uart_app&amp;quot; during modification.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to Implement Cable Replacement Service?</title><link>https://devzone.nordicsemi.com/thread/22507?ContentTypeID=1</link><pubDate>Tue, 14 Apr 2015 08:31:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b6a11e35-e495-4485-98eb-dc92b00328d3</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;p&gt;Cable Replacement profile is a Bluegiga proprietary profile and is not a profile standardized by the
Bluetooth SIG.&lt;/p&gt;
&lt;p&gt;We have an example project (w/ app on phone-side) in our SDK, called &amp;quot;ble_app_uart&amp;quot;: &lt;a href="http://developer.nordicsemi.com/nRF51_SDK/nRF51_SDK_v8.x.x/doc/8.0.0/s110/html/a00072.html"&gt;developer.nordicsemi.com/.../a00072.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Please see this tutorial on how to use the example: &lt;a href="https://devzone.nordicsemi.com/tutorials/4/testing-and-using-a-simple-ble-application/"&gt;devzone.nordicsemi.com/.../&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;To show you how to change the UUIDs I have started out with the ble_app_uart example. In that example you have the &lt;strong&gt;ble_nus.c&lt;/strong&gt; and &lt;strong&gt;ble_nus.h&lt;/strong&gt; files which describes the UART service.&lt;/p&gt;
&lt;p&gt;First go to section 2.2.4 in the nAN-36 app note i linked to in the comment to see how UUIDs work.&lt;/p&gt;
&lt;p&gt;So, in the cable replacement service you have two base UUIDs. In the &lt;strong&gt;ble_crs.c&lt;/strong&gt; the &lt;code&gt;NUS_BASE_UUID&lt;/code&gt; is defined, which is the service UUID. You need to change this to the one you want to use. We also want to add a new base UUID for the TX characteristic. The values below are the ones described in the Cable Replacement service description.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define NUS_BASE_UUID    {{0xcc, 0x77, 0xba, 0xf1, 0x42, 0x27, 0x4d, 0x8e, 0x9b, 0x46, 0xcb, 0xe7, 0x66, 0x16, 0xd5, 0x0b}} /**&amp;lt; Used vendor specific UUID. */
#define NUS_TX_BASE_UUID {{0xc1, 0x3c, 0x35, 0x55, 0x28, 0x11, 0xe1, 0xaa, 0x76, 0x48, 0x42, 0xb0, 0x80, 0xd7, 0xad, 0xe7}} /**&amp;lt; Used vendor specific UUID. */
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In &lt;strong&gt;ble_nus.h&lt;/strong&gt; the 16 bit service UUID is defined, which is the 3rd and 4th byte in the base UUID. Change this to the one you want to use. In your case that would be the 0x1666 value in the base UUID&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define BLE_UUID_NUS_SERVICE 0x1666  
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The 16 bit UUID for the tx characteristic is defined in &lt;strong&gt;ble_nus.c&lt;/strong&gt;, and you want to change this to this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define BLE_UUID_NUS_TX_CHARACTERISTIC 0xd780
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now we would like the tx characteristic to use the &lt;code&gt;NUS_TX_BASE_UUID&lt;/code&gt; we defined, not the &lt;code&gt;NUS_BASE_UUID&lt;/code&gt; which is used by default. So, we need to add a the new base UUID in the tx characteristic. Go to nAN-36 section 4.4.3 to see how to add a new base UUID. In &lt;code&gt;tx_char_add()&lt;/code&gt; in &lt;strong&gt;ble_nus.c&lt;/strong&gt; add this to the code:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uint32_t      err_code;
ble_uuid128_t nus_tx_base_uuid = NUS_TX_BASE_UUID;  
err_code = sd_ble_uuid_vs_add(&amp;amp;nus_tx_base_uuid, &amp;amp;p_nus-&amp;gt;uuid_type);
if (err_code != NRF_SUCCESS){return err_code;}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You can add this at the top of the function.&lt;/p&gt;
&lt;p&gt;You can also remove the rx characteristic, since you don&amp;#39;t need it. Go to the &lt;code&gt;ble_nus_init()&lt;/code&gt; function in &lt;strong&gt;ble_nus.c&lt;/strong&gt; and remove the block:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Add the RX Characteristic.
err_code = rx_char_add(p_nus, p_nus_init);
if (err_code != NRF_SUCCESS)
{
    return err_code;
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>