Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: ConfigFile
Diff: ConfigurationFile.cpp
- Revision:
- 1:5b6c5c2a33d0
- Parent:
- 0:1405a58a7e8d
- Child:
- 2:5af11ca8e085
diff -r 1405a58a7e8d -r 5b6c5c2a33d0 ConfigurationFile.cpp
--- a/ConfigurationFile.cpp Sun Apr 03 15:44:20 2016 +0000
+++ b/ConfigurationFile.cpp Mon Apr 04 22:04:09 2016 +0000
@@ -2,13 +2,10 @@
ConfigurationFile::ConfigurationFile()
{
- PC_Comm _pc;
- pc = _pc.pc;
}
ConfigurationFile::~ConfigurationFile()
{
-
}
void ConfigurationFile::setIP()
@@ -91,6 +88,26 @@
return url;
}
+void ConfigurationFile::setServerAddress()
+{
+ char value[BUFSIZ];
+ if (cfg.getValue( "SERVER", &value[0], sizeof(value)))
+ {
+ printf("'%s'='%s'\n", "Server Address", value);
+ string s = value;
+ serverAddress = s;
+ }
+ else
+ {
+ error("Failure to read Server Address key");
+ }
+}
+
+string ConfigurationFile::getServerAddress()
+{
+ return serverAddress;
+}
+
void ConfigurationFile::readServerEthernetConfiguration()
{
@@ -105,6 +122,23 @@
setIP();
setMask();
setGateway();
+ setServerAddress();
+}
+
+void ConfigurationFile::getServerConfiguration()
+{
+ getIP();
+ getMask();
+ getGateway();
+ getURL();
+}
+
+void ConfigurationFile::getNodeConfiguration()
+{
+ getIP();
+ getMask();
+ getGateway();
+ getServerAddress();
}
void ConfigurationFile::readConfigurationFile(char *pathName)