<?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>Calling Softdevice API functions</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/44988/calling-softdevice-api-functions</link><description>Hi. 
 I am working with an nRF52840. How should I call Softdevice API functions from my app? 
 and more precisely this GAP function: 
 
 
 
 uint32_t 
 sd_ble_gap_tx_power_set (uint8_t role, uint16_t handle, int8_t tx_power) 
 
 
 
 In addition to this</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 21 Mar 2019 10:12:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/44988/calling-softdevice-api-functions" /><item><title>RE: Calling Softdevice API functions</title><link>https://devzone.nordicsemi.com/thread/177531?ContentTypeID=1</link><pubDate>Thu, 21 Mar 2019 10:12:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8686d49f-443b-40ca-86c8-59f720b0d850</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;grep is a well-known utility from Unix for doing text searches through file.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Grep"&gt;https://en.wikipedia.org/wiki/Grep&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;versions for windows are available - much better than the search in Windows Explorer!&lt;/p&gt;
&lt;p&gt;If you have SES (Segger Embedded Studio), you can use the &amp;quot;find in files&amp;quot; facility.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Calling Softdevice API functions</title><link>https://devzone.nordicsemi.com/thread/177455?ContentTypeID=1</link><pubDate>Wed, 20 Mar 2019 22:58:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f96faa40-25ff-455f-a973-e65b1d798436</guid><dc:creator>wpaul</dc:creator><description>&lt;p&gt;SoftDevice APIs are in a sense logically separate from the rest of the SDK. Assume we&amp;#39;re talking about the S140 BLE SoftDevice for the nRF52840. Within the SDK package, there is a components/softdevice/s140 directory. This contains a &amp;quot;hex&amp;quot; directory which includes the object code for the SoftDevice in .hex format and a &amp;quot;headers&amp;quot; directory which includes all of the .h files that define the APIs provided by the SoftDevice code.&lt;/p&gt;
&lt;p&gt;Note also that components/softdevice/common contains some C files which basically contain &amp;quot;glue&amp;quot; code to interface the SoftDevice APIs to the rest of the SDK. The SDK itself provides various component libraries that facilitate using BLE and the various peripherals in the nRF52840 chip, and the SDK examples are built on top of all that.&lt;/p&gt;
&lt;p&gt;The sd_ble_gap_tx_power_set() funcion is a GAP routine. The ble_gap.h file under components/softdevice/s140/headers contains the function prototype for all the GAP-related SoftDevice APIs and the various macros and structures that those APIs use. So you would need to include at least that header file, as well as ble.h and maybe one or two others.&lt;/p&gt;
&lt;p&gt;Note that you can download the SoftDevice package from the Nordic website separately from the SDK. That package basically just includes the SoftDevice object code and headers described above, which makes it easier to see where the SoftDevice leaves off and the rest of the SDK begins.&lt;/p&gt;
&lt;p&gt;Note also that these APIs are not just function calls. If you look at the headers closely, you&amp;#39;ll see that they&amp;#39;re defined using a special SVCALL() macro, which is defined in nrf_svc.h. They&amp;#39;re actually implemented as system calls. When you call one, you&amp;#39;re actually executing an ARM SVC instruction, which generates a system call trap. The SoftDevice has a trap handler which captures these taps, looks at the system call number, and then jumps to the right internal function to service it.&lt;/p&gt;
&lt;p&gt;Lastly, some SoftDevice only&amp;nbsp; have meaning in certain states. For example, you can&amp;#39;t call sd_ble_gap_tx_power_set() until you&amp;#39;ve also done sd_softdevice_enable() and sd_ble_enable() (along with some other dependent functions). The SDK libraries try to take of these things for you.&lt;/p&gt;
&lt;p&gt;-Bill&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Calling Softdevice API functions</title><link>https://devzone.nordicsemi.com/thread/177452?ContentTypeID=1</link><pubDate>Wed, 20 Mar 2019 20:38:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:84ce57ac-55a2-49b0-8b39-b88da3a1d881</guid><dc:creator>p143</dc:creator><description>&lt;p&gt;What do you mean by (eg, grep)? I am working in a Windows environment and a Segger IDE.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Calling Softdevice API functions</title><link>https://devzone.nordicsemi.com/thread/177436?ContentTypeID=1</link><pubDate>Wed, 20 Mar 2019 16:22:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:97b7f5a0-d625-4601-b764-402f68b568e4</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;If&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/37928/just-set-tx-power"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/37928/just-set-tx-power&lt;/a&gt;&amp;nbsp;is not sufficient, just do a text search (eg, grep) through the examples ...&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Calling Softdevice API functions</title><link>https://devzone.nordicsemi.com/thread/177434?ContentTypeID=1</link><pubDate>Wed, 20 Mar 2019 16:12:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:86148fd8-3ef7-42de-9004-333b62707ab9</guid><dc:creator>p143</dc:creator><description>&lt;p&gt;&amp;quot;&lt;span&gt;&amp;nbsp;wealth of&amp;nbsp;examples illustrating how to ...&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Hi awneil.&lt;/p&gt;
&lt;p&gt;Just to make sure I understand the process, could you then mention just 2 or 3&amp;nbsp; SDK 15.2.0 examples calling the sd_ble_gap_tx_power_set API function?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Juan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Calling Softdevice API functions</title><link>https://devzone.nordicsemi.com/thread/176726?ContentTypeID=1</link><pubDate>Mon, 18 Mar 2019 13:19:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7bf456fe-000b-4c1f-bd68-4824fc0c7b01</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;The SDK contains a wealth of&amp;nbsp;examples illustrating how to call the SoftDevice - and other API - functions.&lt;/p&gt;
&lt;p&gt;Specifically for&amp;nbsp;&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v6.1.0/group___b_l_e___g_a_p___f_u_n_c_t_i_o_n_s.html#gad10e80ba20ddab42d1753fd1be2d8c26"&gt;sd_ble_gap_tx_power_set&lt;/a&gt;&lt;span&gt;&amp;nbsp;see also:&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/37928/just-set-tx-power"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/37928/just-set-tx-power&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>