Hi Adam,
I tried enabling the cold restart in the current outstation demo.
with no modification to your code, If I compile both demomain.cpp (that of outstation and that of master), I get the error on the master when I try the case "r" that:
ms(1441586138276) WARN tcpclient - Task was explicitly rejected via response with error IIN bit(s): cold restart
so I did the override of the ColdRestartSupport as you suggested in the previous comments in this thread. This is how i did it.
class myoutstation : public IOutstationApplication
{
public:
RestartMode ColdRestartSupport() const
{
return RestartMode::SUPPORTED_DELAY_FINE;
}
#static IOutstationApplication& Instance();
uint16_t ColdRestart()
{
return 65535;
}
};
2) I created an instance of this myoutstation called it "myoutstation1".
auto pOutstation = pChannel->AddOutstation("outstation", SuccessCommandHandler::Instance(), myoutstation1, stackConfig);
and now the response I get on the master output screen is:
ms(1441586765597) WARN tcpclient - Received unexpected response object headers for task: cold restart
I guess this means that first, the cold restart have been enabled, but returning the wrong thing or something like that.
Note: I used your new function
pMaster->PerformFunction("cold restart", FunctionCode::COLD_RESTART, {});
I want to be able to send the cold restart function and get a good response even though I don't implement the full shut down procedure. i.e., I want to get something on the master screen (a print out) that tells me what time the outstation would be shutting down or at least an indication that the command was successful instead of a warning. How can I achieve this? thanks