<?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 create custom service?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/23934/how-to-create-custom-service</link><description>how to create custom service in order to send dummy message, not from the console, I
have to make one char arr[]=&amp;quot;hello&amp;quot; this is a fixed string, then where i have add this string as data and what are the parameters are required to create simple custom</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 31 Jul 2017 22:38:50 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/23934/how-to-create-custom-service" /><item><title>RE: how to create custom service?</title><link>https://devzone.nordicsemi.com/thread/94243?ContentTypeID=1</link><pubDate>Mon, 31 Jul 2017 22:38:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:787c02b9-03d4-40ed-bda2-0575eb79210b</guid><dc:creator>Roger Clark</dc:creator><description>&lt;p&gt;@endnode&lt;/p&gt;
&lt;p&gt;Yes.&lt;/p&gt;
&lt;p&gt;That&amp;#39;s actually what I do in a lot of cases.&lt;/p&gt;
&lt;p&gt;I already have a manually generated adv packet, as I&amp;#39;m trying to squeeze as much data as possible into the packet, so that the Android (or iOS) App&amp;#39;s don&amp;#39;t need to connect, as connecting flattens the battery if it happens a lot.&lt;/p&gt;
&lt;p&gt;BTW. I originally started programming nRF using mbed and it has some nice features which generate the adv packet in a more modular fashion, where you can call functions to add another 16 bit service or the name or manufacturer data to the adv packet before its finally passed to the API&lt;/p&gt;
&lt;p&gt;I should probably write something similar myself, but as usual, I never have the time and its quicker to manually create it ;-)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to create custom service?</title><link>https://devzone.nordicsemi.com/thread/94244?ContentTypeID=1</link><pubDate>Mon, 31 Jul 2017 21:21:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8605a2b3-c06d-4dd3-a1a1-40b94df920c5</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;I personally prefer formatting Adv. and Scan rsp. data manually, it&amp;#39;s just up to 2x31 bytes. If you already hold UUIDs and similar things in constants at compilation time why not doing the same with these strings if they are static as well? Surely if you switch to BT SIG UUID base for services other then standard GATT and GAP then you need to change AD tag but that&amp;#39;s trivial, the rest of formatting is pretty easy.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to create custom service?</title><link>https://devzone.nordicsemi.com/thread/94237?ContentTypeID=1</link><pubDate>Mon, 31 Jul 2017 21:00:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f42281c0-0e6f-4745-a34f-dc7454e32a93</guid><dc:creator>Roger Clark</dc:creator><description>&lt;p&gt;LOL... OK.&lt;/p&gt;
&lt;p&gt;As I&amp;#39;m a long way through making the hrs into a custom / template 16 bit service, I think I may as well continue...
But I may also try using the custom 128 bit service linked by @Jaokim, with the BLE_UUID_TYPE_BLE, and see how that works out.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to create custom service?</title><link>https://devzone.nordicsemi.com/thread/94234?ContentTypeID=1</link><pubDate>Mon, 31 Jul 2017 14:03:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a1b918b5-0d4e-4026-ab48-6b1b9dc339bf</guid><dc:creator>Joakim Jakobsen</dc:creator><description>&lt;p&gt;I dont know if I&amp;#39;m understanding what you want to achieve. If you simply want to send the string &amp;quot;Hello&amp;quot; from the peripheral to the central, you can set up a &lt;a href="https://devzone.nordicsemi.com/tutorials/19/"&gt;timer&lt;/a&gt; on the peripheral and in the timer_handler you can send the string e.g every 10 seconds. You can use the function &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v13.1.0%2Fgroup__ble__nus.html&amp;amp;anchor=gacaf254f54b8edc3d2558845b89a93e4c"&gt;ble_nus_string_send()&lt;/a&gt; to send your string from the peripheral to the central. And here you would have to use the ble_app_uart / ble_app_uart_c examples.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to create custom service?</title><link>https://devzone.nordicsemi.com/thread/94242?ContentTypeID=1</link><pubDate>Mon, 31 Jul 2017 12:04:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b02797d1-ce89-4852-baaf-637deb23113a</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;And I haven&amp;#39;t thought about this one;) Sure all Adv./Scan Rsp. data must be managed separately (as they are) so you will just use different AD TAG and fill the content with 16-bit value(s)...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to create custom service?</title><link>https://devzone.nordicsemi.com/thread/94241?ContentTypeID=1</link><pubDate>Mon, 31 Jul 2017 12:02:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f949daa4-c0be-43b4-a6ae-b9b9618ca0b1</guid><dc:creator>Roger Clark</dc:creator><description>&lt;p&gt;@endnote&lt;/p&gt;
&lt;p&gt;Good point.. I hadn&amp;#39;t thought about it that way.
But... how does the advertisng packet send the &amp;quot;incomplete list of 16 bit services&amp;quot; type, if I appear to be using 128 bit services ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to create custom service?</title><link>https://devzone.nordicsemi.com/thread/94239?ContentTypeID=1</link><pubDate>Mon, 31 Jul 2017 11:49:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f4fb066f-c262-4556-9427-44adbbcd66ff</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Hi Roger, remember that in Nordic stack (and actually even in BT SIG spec) all UUIDs are 128bit;) It&amp;#39;s just the base which is different so if you want to add any &amp;quot;standard&amp;quot; BT SIG 16-bit UUID (or simply some UUID derived from BT SIG 128-bit base) then simply use &lt;code&gt;BLE_UUID_TYPE_BLE&lt;/code&gt; instead of your custom type base index.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to create custom service?</title><link>https://devzone.nordicsemi.com/thread/94240?ContentTypeID=1</link><pubDate>Mon, 31 Jul 2017 10:41:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e6cf2bc-2ad0-4638-954b-49804ba08909</guid><dc:creator>Roger Clark</dc:creator><description>&lt;p&gt;@Joakim Jakobsen&lt;/p&gt;
&lt;p&gt;Thanks. I didn&amp;#39;t realise there was a nice clean custom service example.&lt;/p&gt;
&lt;p&gt;Is there an example of a custom 16 bit service as well ?&lt;/p&gt;
&lt;p&gt;Currently I&amp;#39;m going through the process of converting the hrs into a custom 16 bit service, so that I can them implement various 16 bit services e.g. the Temperature service, which Nordic does not have an example of.&lt;/p&gt;
&lt;p&gt;From what I have seen the API calls to setup a 16 bit service are different from a 128 bit service, hence why I have been using the HRS as a starting point.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to create custom service?</title><link>https://devzone.nordicsemi.com/thread/94236?ContentTypeID=1</link><pubDate>Mon, 31 Jul 2017 10:17:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ce9daa17-bef6-4afe-8465-d9152e971ef5</guid><dc:creator>IC</dc:creator><description>&lt;p&gt;Ble_app_uart is working fine but I don&amp;#39;t want to send through the console, it should be programmatically I want to create one char array and directly I want to add this string to the data.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to create custom service?</title><link>https://devzone.nordicsemi.com/thread/94238?ContentTypeID=1</link><pubDate>Mon, 31 Jul 2017 09:07:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b51db88f-5010-4433-a4a1-c2b16db1b522</guid><dc:creator>Joakim Jakobsen</dc:creator><description>&lt;p&gt;In addition to endnode&amp;#39;s answer you can take a look at &lt;a href="https://github.com/bjornspockeli/custom_ble_service_example"&gt;this&lt;/a&gt; tutorial on GitHub. This tutorial covers creating a custom service with a custom value characteristic for one of the latest SDK&amp;#39;s (SDK v13.0.0). Like endnode said, you should take a look at the information provided and post another question here on DevZone if you run into any specific problems. Good luck.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to create custom service?</title><link>https://devzone.nordicsemi.com/thread/94235?ContentTypeID=1</link><pubDate>Mon, 31 Jul 2017 08:14:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4035b412-4602-4d73-b6e6-445268b02564</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Learn how BLE works (see &lt;a href="https://devzone.nordicsemi.com/tutorials/"&gt;all Tutorials in &amp;quot;Bluetooth low energy&amp;quot; here&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Try to make Nordic BLE UART Service examples work (you need two dev kits obviously but it works on all nRF51/52/52840 variants, just pick right nRF5 SDK version). GAP Peripheral part is in &lt;code&gt;examples\ble_peripheral\ble_app_uart&lt;/code&gt; path while GAP Central example is in &lt;code&gt;examples\ble_central\ble_app_uart_c&lt;/code&gt; path.&lt;/li&gt;
&lt;li&gt;Send whatever strings you need.&lt;/li&gt;
&lt;li&gt;Profit.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If you fail in any step, please first go back to step 1) and if not resolved then search carefully through all 23k+ Q&amp;amp;S on this forum. If still not resolved then you are most then welcome to paste new question (please give us then detailed description what HW+SW set-up you have, what is your goal, what steps you&amp;#39;ve done, what is the result what was your expectation instead).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>