#include "Subsystem.hxx"
//  class MySubsystem: public Subsystem
//  {
//  public:
    
//      MySubsystem (unsigned short int portCommandListener, unsigned long int
//                 reportPeriod, char * ccName, unsigned short int
//                 portReportListener, unsigned short int maxTimeoutCount_, 
//                 char * specialReportOnStartup)
//              :Subsystem( portCommandListener, reportPeriod,  ccName, 
//                          portReportListener,  maxTimeoutCount_, 
//                          specialReportOnStartup)
//          {};

//  protected:
    
//      virtual void ProcessCmd(char *)
//          {};
//      virtual void GenerateReport()
//          {}; 
//      virtual void HandleConnectionTimeoutIsOver()
//          {};
    
//  };

            
#include <unistd.h>
int main()
{
        //This two ports depend on your subsystem
    unsigned short int portCommandListener=2001;
    unsigned short int portReportListener=2002;
    
    unsigned long int reportPeriod=3000000;//in usec
    unsigned short int maxTimeoutCount=10;
        //Unless your subsystem functionallity is integrated in Subsystem
        //derived class, setup your subsystem hardware here
        //...
    
        //checkout subsystem setup and elaborate the setup/special report:
    char * specialReportOnStartup="2.34:5:6.89:5.2";

        //now start subsystem communication
    Subsystem
        mySubsys(portCommandListener,reportPeriod,"ifae-w41.ifae.es",
                 portReportListener,maxTimeoutCount,specialReportOnStartup);


        //if you haven't overriden ElaborateReport you have to take care to
        //SetReportString periodically here, along with your subsystem's
        //hardware control

        //If you have overriden ElaborateReport you just have to
        //WaitingForShutdown 
    mySubsys.WaitingForShutdown();

        //setup your subsystem hardware to shutdown ...
    
    return 0;
}
