X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/abeb1da46ca7b6a13a5c47c01d9141df4a8e1989..65a51d11c64daa4df3d4388df60bb4efc3e67e14:/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 81b9ccb5..09cb4636 100644 --- 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" +namespace +{ PLUGIN_CREATOR 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) @@ -33,6 +33,15 @@ bool SPrefixLess(const Sensors::value_type & a, return a.first.PrefixLess(b.first); } +} + +extern "C" PLUGIN * GetPlugin(); + +PLUGIN * GetPlugin() +{ +return smc.GetPlugin(); +} + 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; } -port = p; +port = static_cast(p); 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; +if (!needReconnect) + { + printfd(__FILE__, "SMUX reconnected succesfully.\n"); + logger("Reconnected successfully."); + } return 0; }