main-interface.cpp 879 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #include "../dist/interface.hpp"
  2. #include "config.hpp"
  3. using namespace std;
  4. int main(int argc,char** argv){
  5. cout<<"*****************************"<<endl;
  6. cout<<"* Genbraid interface client *"<<endl;
  7. cout<<"*****************************"<<endl;
  8. Interface interface(SERVER_IP,SERVER_PORT);
  9. bool quit=false;
  10. while(not quit){
  11. cout<<endl;
  12. cout<<"---------- Menu ----------"<<endl;
  13. cout<<endl;
  14. cout<<" i > get informations"<<endl;
  15. cout<<" k > kill server"<<endl;
  16. cout<<" q > quit"<<endl;
  17. cout<<endl;
  18. cout<<" choice ? ";
  19. char rep;
  20. cin>>rep;
  21. switch(rep){
  22. case 'i':
  23. interface.send_code('I');
  24. interface.get_informations();
  25. break;
  26. case 'k':
  27. interface.send_code('K');
  28. quit=true;
  29. break;
  30. case 'q':
  31. quit=true;
  32. break;
  33. default:
  34. break;
  35. }
  36. }
  37. return 0;
  38. }