driver.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * Copyright (c) 2019 Clementine Computing LLC.
  3. *
  4. * This file is part of PopuFare.
  5. *
  6. * PopuFare is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU Affero General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * PopuFare is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU Affero General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Affero General Public License
  17. * along with PopuFare. If not, see <https://www.gnu.org/licenses/>.
  18. *
  19. */
  20. #ifndef _DRIVER_H
  21. #define _DRIVER_H
  22. #include <stdio.h>
  23. #include <stdlib.h>
  24. #include <sys/types.h>
  25. #include <unistd.h>
  26. #include <time.h>
  27. #include <string.h>
  28. #include "../commhub/commhub.h"
  29. #include "../commhub/client_utils.h"
  30. #include "../common/common_defs.h"
  31. #include "mongoose.h"
  32. extern driver_status my_driver_status;
  33. extern int update_driver_status;
  34. extern time_t paddle_req_timeout;
  35. extern set_paddle_req paddle_req;
  36. extern int hub_fd;
  37. //-------------------------------------------------------------------------------------
  38. void clear_diu_messages();
  39. int check_paddle_request();
  40. int make_paddle_request(int);
  41. int driver_login(int, char*);
  42. int driver_logout(void);
  43. void action_nextstop(void);
  44. void action_prevstop(void);
  45. void ws_send(struct mg_mgr *mgr, char *msg);
  46. extern struct mg_mgr g_mgr;
  47. #endif