<?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>Where is scanf defined?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/21660/where-is-scanf-defined</link><description>Hi Nordic! 
 On the radio_test example, the functions scanf and printf are heavily used, however, I haven&amp;#39;t found where they are defined. This example is reading the data from the UART port, but there doesnt seem to be any implementation of the scanf</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 26 Apr 2017 14:03:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/21660/where-is-scanf-defined" /><item><title>RE: Where is scanf defined?</title><link>https://devzone.nordicsemi.com/thread/85058?ContentTypeID=1</link><pubDate>Wed, 26 Apr 2017 14:03:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e3601b4-5eae-4173-b4a6-55c1c9a42cc0</guid><dc:creator>AmiguelS</dc:creator><description>&lt;p&gt;Works like a charm. Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Where is scanf defined?</title><link>https://devzone.nordicsemi.com/thread/85057?ContentTypeID=1</link><pubDate>Wed, 26 Apr 2017 11:33:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:493169b1-ab24-4b36-bb78-28969f01f0f7</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;You can place it anywhere you want, just remove the original &lt;em&gt;retarget.c&lt;/em&gt; source file from your project and include the new one.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Where is scanf defined?</title><link>https://devzone.nordicsemi.com/thread/85056?ContentTypeID=1</link><pubDate>Wed, 26 Apr 2017 11:31:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d25aaf2c-7a7c-41c4-b54d-a8d9f41a3f67</guid><dc:creator>AmiguelS</dc:creator><description>&lt;p&gt;I see, thanks for the reply! If I wanted to write a new &lt;em&gt;retarget.c&lt;/em&gt; , using other communication protocol, where would I place the new file, and what changes would I have to do in order to use my file instead of the SDK one?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Where is scanf defined?</title><link>https://devzone.nordicsemi.com/thread/85055?ContentTypeID=1</link><pubDate>Wed, 26 Apr 2017 11:16:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb9dc838-9943-4a48-a27d-a1fc3fa9d1f3</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;code&gt;printf&lt;/code&gt; and &lt;code&gt;scanf&lt;/code&gt; are, as you indicated, defined in the C library &lt;em&gt;stdio.h&lt;/em&gt;. The communication on the UART interface is handled by the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v13.0.0/group__app__uart.html?cp=4_0_0_6_10_41"&gt;app_uart module&lt;/a&gt;, and more specific, the functions &lt;code&gt;app_uart_put&lt;/code&gt; and &lt;code&gt;app_uart_get&lt;/code&gt;. The stdio functions can be &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v13.0.0/group__retarget.html?cp=4_0_0_6_10_50"&gt;retargeted&lt;/a&gt; to use the app_uart module to read and write data using the UART interface. You can find the implementation of these functions in the file &lt;em&gt;retarget.c&lt;/em&gt;. You will also have to enable retargeting in &lt;em&gt;sdk_config.h&lt;/em&gt;, by setting &lt;code&gt;#define RETARGET_ENABLED 1&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>