//----------------------------------------------------------------------------
///
///
///
//----------------------------------------------------------------------------


#include <fosh/command.h>
// #include <stdio.h>
#include <stdlib.h>
#if defined(STM32)
   //#include <arena/platform.h>
   #include <biwak/voc.h>
#endif


class CCommandVoc: public CCommand
{
   public:
      CCommandVoc(const char *_name)
         :CCommand( _name, "   date: get/set time and date\n" )
      {}
      virtual int exec(int argc, const char *argv[]) const;
      virtual void printHelp() const;
};


int CCommandVoc::exec(int argc, const char *argv[]) const /* virtual */
{
   #if defined ( ARENA_USE_VOC ) && ( ARENA_USE_VOC > 0 )
      pf.voc[0]->update();

      printf( "VOC: %d (Ref: %d)\n", pf.voc[0]->getVoc(), VOC_CLEAN_VOC );
      printf( "CO2: %d (Ref: %d)\n", pf.voc[0]->getCo2(), VOC_CLEAN_CO2 );
   #else
      printf( "Nt supported\n" );
   #endif

   return(0);
}


const CCommand *createInstance_voc()
{
   return( new CCommandVoc("voc") );
}


STTERM_COMMAND(voc);


//---fin----------------------------------------------------------------------
