C++ file for display control
Dependencies: 4DGL mbed ConfigFile
Fork of 4DGLtest by
Diff: configread.cpp
- Revision:
- 4:302c2ac97db9
- Child:
- 6:904d00252480
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/configread.cpp Fri Jun 27 12:59:51 2014 +0000 @@ -0,0 +1,25 @@ +#include "mbed.h" +#include "ConfigFile.h" + + + +void ConfigRead(void) { + LocalFileSystem local("local"); + ConfigFile cfg; + char *key = "MyKey"; + char value[BUFSIZ]; + /* + * Read a configuration file from a mbed. + */ + if (!cfg.read("/local/input.cfg")) { + error("Failure to read a configuration file.\n"); + } + + /* + * Get a configuration value. + */ + if (cfg.getValue(key, &value[0], sizeof(value))) { + printf("'%s'='%s'\n", key, value); + } +} +