LedTest.cxx

00001 #include <unistd.h>
00002 #include <iostream>
00003 
00004 #define USELIBRARY
00005 #include "../TApi.h"
00006 
00007 using namespace std;
00008 
00009 TApi *tapi = 0;
00010 
00011 int main () {
00012   if(!tapi)
00013     tapi = new TApi();
00014 
00015   tapi->initialiseAll(0);
00016 
00017   tapi->flashLED(0, 0, 1000, 10); 
00018 
00019   cout << "LEDTEST FlashLED has been called\n";
00020 
00021   tapi->status();
00022 
00023   try {
00024     cerr << "Going to await response\n";
00025     // Time out after 11 secs
00026     tapi->awaitResponse(0, 21);
00027     // There shouldn't be a reply
00028 
00029     cerr << "Done await response\n";
00030   } catch(...) {
00031     cout << "Exception awaiting echo response\n";
00032   }
00033 
00034   cout << "Pre shutdown status\n";
00035   tapi->status();
00036 
00037   tapi->shutdownAll();
00038 
00039   delete tapi;
00040 
00041   return 0;  
00042 }

Generated on Mon Feb 6 14:01:22 2006 for SCT DAQ/DCS Software - C++ by  doxygen 1.4.6