<?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>Adding all necessary .h files to every .c file</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/10643/adding-all-necessary-h-files-to-every-c-file</link><description>Hello there, I am already guessing that by the question alone it seems like what i&amp;#39;m asking is silly or wrong but I have no formal education here so I will need some help. 
 I have done all the tutorials posted, (advertising, services, characterisitcs</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 04 Dec 2015 16:42:16 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/10643/adding-all-necessary-h-files-to-every-c-file" /><item><title>RE: Adding all necessary .h files to every .c file</title><link>https://devzone.nordicsemi.com/thread/39703?ContentTypeID=1</link><pubDate>Fri, 04 Dec 2015 16:42:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fe569289-17d2-4481-aea5-e8b304abf388</guid><dc:creator>Nikolaus Wittenstein</dc:creator><description>&lt;p&gt;Just try it! You&amp;#39;ll know if you need to include a header because it won&amp;#39;t compile.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding all necessary .h files to every .c file</title><link>https://devzone.nordicsemi.com/thread/39706?ContentTypeID=1</link><pubDate>Thu, 03 Dec 2015 22:07:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c082f2ec-6a78-4971-a252-3fedd34029af</guid><dc:creator>wolfman24</dc:creator><description>&lt;p&gt;I mean i understand what they&amp;#39;re for and why they exist, i just want to know how to get them into my new project. In this project i want to have a custom service with a few characteristics in it. I was wondering if I will i need to make my own header files for the .c class to create the service? The tutorial i followed had a service and its characteristic created in a .c file separate from the main.c, and this .c file had a lot of headers in order to accomplish its function of adding the service to the stack. I just assumed that the dozen or so headers that were added in the tutorial were not an excess and were standard for every project wishing to make a custom service and I wanted to know how to do it for y project.&lt;/p&gt;
&lt;p&gt;Sorry if i&amp;#39;m being confusing or difficult but this is the best way i know how to ask for help, thanks for your time&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding all necessary .h files to every .c file</title><link>https://devzone.nordicsemi.com/thread/39705?ContentTypeID=1</link><pubDate>Thu, 03 Dec 2015 21:53:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cbc1957d-379c-4238-a22e-46e6b4f31b0f</guid><dc:creator>Nikolaus Wittenstein</dc:creator><description>&lt;p&gt;For every external function you use in a file, you have to include the header where that function is defined. That&amp;#39;s really it. There are no general groups or anything—you include what you need. If those in turn include headers, it&amp;#39;s because they use functions in those other headers. You don&amp;#39;t need to include those headers because they already do.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding all necessary .h files to every .c file</title><link>https://devzone.nordicsemi.com/thread/39704?ContentTypeID=1</link><pubDate>Thu, 03 Dec 2015 21:49:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d658491d-5db6-49f8-ac07-eb22670429d6</guid><dc:creator>wolfman24</dc:creator><description>&lt;p&gt;I learned on Java and i know some swift. I think i have a good idea on the concept and what you just said confirmed that, so thanks you for that! I just don&amp;#39;t know which header files or how many I will need to accomplish what i need. Like in the services tutorial it called on about three, but one of those called on a few more. Were all those header files made specifically for that one .c class or was there just a general group of them that were imported as like a default package to back up creating a service?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding all necessary .h files to every .c file</title><link>https://devzone.nordicsemi.com/thread/39702?ContentTypeID=1</link><pubDate>Thu, 03 Dec 2015 21:25:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:45f75ed9-f53a-4761-ba15-1a4c7012d9cc</guid><dc:creator>Nikolaus Wittenstein</dc:creator><description>&lt;p&gt;Each time you want to use a function that someone else has written, you need to &lt;code&gt;#include&lt;/code&gt; a file where that function is defined. Otherwise, the compiler won&amp;#39;t know which function you&amp;#39;re talking about. In general, this means that if you&amp;#39;re trying to use e.g. PWM code, you need to &lt;code&gt;#include&lt;/code&gt; the relevant PWM header. If you&amp;#39;re using code from lots of different modules, like &lt;code&gt;main.c&lt;/code&gt; does, then you&amp;#39;ll need a lot of header files.&lt;/p&gt;
&lt;p&gt;Code won&amp;#39;t compile if you&amp;#39;re missing a header file include, but it will compile if you have an extra header file included. This means that over time you may end up with extra &lt;code&gt;#include&lt;/code&gt;s at the top of your file, as you may have added them to allow you to use functions you no longer use. So sometimes there can be non-essential &lt;code&gt;#include&lt;/code&gt;s.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure what you mean by &amp;quot;import files as a package&amp;quot;, or if there&amp;#39;s a better way to answer your question. Is there another programming language that you know, so that I could make an analogy to that?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding all necessary .h files to every .c file</title><link>https://devzone.nordicsemi.com/thread/39708?ContentTypeID=1</link><pubDate>Thu, 03 Dec 2015 17:28:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c92c656b-2172-4dcb-8cef-5f00bf465eb5</guid><dc:creator>wolfman24</dc:creator><description>&lt;p&gt;Yeah that&amp;#39;s what I gathered as well. And I can&amp;#39;t move any further till i do. Is there a way to import the files as a package or do i have to declare each one separately? Is there a model i can follow?&lt;/p&gt;
&lt;p&gt;I ultimately want to use the nrf51822 to send out pwm signals so is there specific header files needed?&lt;/p&gt;
&lt;p&gt;And thanks for the response!!
@rbgautam&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding all necessary .h files to every .c file</title><link>https://devzone.nordicsemi.com/thread/39707?ContentTypeID=1</link><pubDate>Thu, 03 Dec 2015 17:18:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cbb11d51-1091-45b7-8e72-2f3d1d80e501</guid><dc:creator>rbgautam</dc:creator><description>&lt;p&gt;I am also a beginner in the field, but ads far as I understand the .h files are the header files which contain the prototypes for all the functions that are than defined in the .c files. Also I think u wont&amp;#39; be able to compile a project until u have the corresponding prototypes define in the .h files.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>