<?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>nRF51822</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/93/nrf51822</link><description>Hi everybody, i am working with a nrf51822 chip and i would like to use it only in slave mode. is it possible? and how can we do it?
Thanks</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 16 Sep 2013 05:29:17 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/93/nrf51822" /><item><title>RE: nRF51822</title><link>https://devzone.nordicsemi.com/thread/498?ContentTypeID=1</link><pubDate>Mon, 16 Sep 2013 05:29:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a27c46f-194b-4089-babd-913d416dcf08</guid><dc:creator>Bastiaan</dc:creator><description>&lt;p&gt;It seems this would have been much better off as a separate question, since it has nothing to do with what was originally asked here.&lt;/p&gt;
&lt;p&gt;However, when a peer device writes to a characteristic, you&amp;#39;ll get a BLE_GATTS_EVT_WRITE event.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822</title><link>https://devzone.nordicsemi.com/thread/499?ContentTypeID=1</link><pubDate>Mon, 16 Sep 2013 05:29:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e773d734-5c90-4a3f-b958-9bb7a74d441f</guid><dc:creator>Guest</dc:creator><description>&lt;p&gt;It seems this would have been much better off as a separate question, since it has nothing to do with what was originally asked here.&lt;/p&gt;
&lt;p&gt;However, when a peer device writes to a characteristic, you&amp;#39;ll get a BLE_GATTS_EVT_WRITE event.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822</title><link>https://devzone.nordicsemi.com/thread/500?ContentTypeID=1</link><pubDate>Mon, 16 Sep 2013 05:27:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:57c5c67d-5fc3-454a-81fa-66f2cecf3fa6</guid><dc:creator>andy2003hunan</dc:creator><description>&lt;p&gt;anyone can answer this question?tks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822</title><link>https://devzone.nordicsemi.com/thread/497?ContentTypeID=1</link><pubDate>Sat, 14 Sep 2013 02:01:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9099c91e-6c26-4ac3-bb55-a241c72a0949</guid><dc:creator>andy2003hunan</dc:creator><description>&lt;p&gt;by the way,which BLE_STACK EVENT can let us know the phone has written the characteristics?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822</title><link>https://devzone.nordicsemi.com/thread/495?ContentTypeID=1</link><pubDate>Tue, 30 Jul 2013 10:46:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ebc93f8-1b8c-41f4-a4f7-d1e8038e54eb</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;To clean up a few of the unresolved questions on this site, I&amp;#39;m working through old ones. If you found the answer from Lukas below useful, I&amp;#39;d recommend that you click the &amp;quot;Accept this answer&amp;quot; button, to show appreciation. :-)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822</title><link>https://devzone.nordicsemi.com/thread/496?ContentTypeID=1</link><pubDate>Wed, 10 Jul 2013 17:39:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9ec5839c-4abd-4e32-b18e-5bf6602dfb86</guid><dc:creator>Lukas_Simma</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;with slave mode do you meen that the nrf51822 is the sensor and eg. a smartphone connect to the sensor to read/write some data? For that use case the S110 softdevice and the sample code are ready to go.&lt;/p&gt;
&lt;p&gt;Hint: If you are in test stage only then from LAIRD you get a certified Module with Basic Scripts....&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;At first to have an easy startup use a developent kit from NORDIC&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The development kit contains the needed jtag debugger device to program and debug the chip&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;With the product code on the package on the website download the SDK&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Download the free version from Keil uVision4&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Install Nordic SDK (after installing Keil)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Use nRFgo Studio to flash the S110 Library to the chip&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Open with KEIL the sample code from eg. ble\ble_app_hrs&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Compile and flash the code with KEIL to the Chip&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Download the Nordic App nRF Utility for iPhone or Samsung Galagy S3/S4 (and some else)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Connect from the App to the nordic chip&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Now in the code check mail.c and ble__bas.c&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;in main.c see at
&amp;quot;advertising_init()&amp;quot; this prepare structures to do advertising
&amp;quot;advertising_start()&amp;quot; here the advertising ist started&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;the file ble_bas.c initializes a BTLE Battery service and the characteristic
check ble_bas_init() here the BTLE service is prepared
check battery_level_char_add() here the BTLE characteristics for the service is prepared
check ble_bas_battery_level_update() here a new value of the characteristic is set (and send with notify)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If you need to write a value from the smartphone to the chip check the code ble\ble_app_hids_mouse where many characteristics are enabled to change the value&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Check the File &amp;quot;ble_hids.c&amp;quot; ....  service and the characteristics form the HID service¨&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Check  code lines where you find a write in it
char_md.char_props.read          = 1;
char_md.char_props.write_wo_resp = 1;
char_md.char_props.write = 1;
--&amp;gt; For every characteristic which must be write enabled you have to define that it can be written (with or without a respons back to the smartphone after write operation)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;See the lines
attr_md.read_perm  = p_rep_ref_attr_md-&amp;gt;read_perm;
attr_md.write_perm = p_rep_ref_attr_md-&amp;gt;write_perm;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;---&amp;gt; You must also enable the right to write!!!
eg. use following for your first tests:
BLE_GAP_CONN_SEC_MODE_SET_OPEN(&amp;amp;attr_md.read_perm);
BLE_GAP_CONN_SEC_MODE_SET_OPEN(&amp;amp;attr_md.write_perm);&lt;/p&gt;
&lt;p&gt;Best regards,
Lukas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>