Now that our target will be having a server constantly running on our board, we will need some kind of configuration file for it so that the server knows how it is supposed to operate. For this purpose, we will create a file called server.conf
(or more exactly, we will define a variable that will hold the name of this file) that will always hold the current runtime configuration of our server.
First, we should define a structure for it. A very simple one can be a configuration like keyword=value
. It's simple to read, and also parsing it with code is easy.
Then, we should think about what type of configuration data we need in our server. This will, of course, depend on the features of the server. What kind of features do we currently have in our code? That's right, we have two functions, temperature and light sensor measurement. Let's make the delay between readings a configurable value. Create a file called server.conf
and enter the following lines in it...