git.stg.codes
/
stg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Removed some unused stuff from netunit.cpp.
[stg.git]
/
projects
/
stargazer
/
plugins
/
other
/
smux
/
smux.cpp
diff --git
a/projects/stargazer/plugins/other/smux/smux.cpp
b/projects/stargazer/plugins/other/smux/smux.cpp
index 81b9ccb50a8d3e43a9db3235e3b1b50277af111d..09cb4636795b1f72d567dc6274e2d74f788a2fad 100644
(file)
--- a/
projects/stargazer/plugins/other/smux/smux.cpp
+++ b/
projects/stargazer/plugins/other/smux/smux.cpp
@@
-20,12
+20,12
@@
#include "smux.h"
#include "utils.h"
#include "smux.h"
#include "utils.h"
+namespace
+{
PLUGIN_CREATOR<SMUX> smc;
PLUGIN_CREATOR<SMUX> smc;
-PLUGIN * GetPlugin()
-{
-return smc.GetPlugin();
-}
+bool SPrefixLess(const Sensors::value_type & a,
+ const Sensors::value_type & b);
bool SPrefixLess(const Sensors::value_type & a,
const Sensors::value_type & b)
bool SPrefixLess(const Sensors::value_type & a,
const Sensors::value_type & b)
@@
-33,6
+33,15
@@
bool SPrefixLess(const Sensors::value_type & a,
return a.first.PrefixLess(b.first);
}
return a.first.PrefixLess(b.first);
}
+}
+
+extern "C" PLUGIN * GetPlugin();
+
+PLUGIN * GetPlugin()
+{
+return smc.GetPlugin();
+}
+
SMUX_SETTINGS::SMUX_SETTINGS()
: errorStr(),
ip(0),
SMUX_SETTINGS::SMUX_SETTINGS()
: errorStr(),
ip(0),
@@
-60,7
+69,7
@@
if (ParseIntInRange(pvi->value[0], 2, 65535, &p))
printfd(__FILE__, "Cannot parse parameter 'Port'\n");
return -1;
}
printfd(__FILE__, "Cannot parse parameter 'Port'\n");
return -1;
}
-port =
p
;
+port =
static_cast<uint16_t>(p)
;
pv.param = "Password";
pvi = std::find(s.moduleParams.begin(), s.moduleParams.end(), pv);
pv.param = "Password";
pvi = std::find(s.moduleParams.begin(), s.moduleParams.end(), pv);
@@
-269,6
+278,11
@@
if (Stop())
return -1;
if (Start())
return -1;
return -1;
if (Start())
return -1;
+if (!needReconnect)
+ {
+ printfd(__FILE__, "SMUX reconnected succesfully.\n");
+ logger("Reconnected successfully.");
+ }
return 0;
}
return 0;
}