You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
2.5 KiB

4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
4 years ago
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
4 years ago
​
​
​
​
​
​
​
​
4 years ago
​
​
​
  1. #ifndef __KERNEL_MODULE_MODEM_MANAGER_HEADER__
  2. #define __KERNEL_MODULE_MODEM_MANAGER_HEADER__
  3. #include "kernelModule.h"
  4. #include "../../components/base/basicThread.h"
  5. //*
  6. typedef std::vector<DBC_MODEM_DATA *> VECTOR_DBC_MODEM_DATA;
  7. class kernelModuleModemManager;
  8. typedef struct S_MDM_USER_DATA{
  9. uint8_t modem_id;
  10. char target[64];
  11. kernelModuleModemManager * parent;
  12. bool finished;
  13. pthread_t handler;
  14. }MDM_USER_DATA;
  15. typedef std::vector<MDM_USER_DATA *> VECTOR_MDM_USER_DATA;
  16. typedef struct S_MDM_CALL_DATA: public MDM_USER_DATA{
  17. uint8_t waitTillHangup;
  18. } MDM_CALL_DATA;
  19. typedef struct S_MDM_SMS_DATA: public MDM_USER_DATA{
  20. CSTR text;
  21. } MDM_SMS_DATA;
  22. //*/
  23. #define MDM_IDLE_WM 0x01
  24. #define MDM_INIT_CALL_WM 0x02
  25. #define MDM_MODEM_IS_BUSY_WM 0x03
  26. #define MDM_FETCH_NEXT_WM 0x04
  27. #define MDM_WAIT_WINDOW_WM 0x05
  28. typedef std::vector<DBC_MODEM_PHONEBOOK_RECORD*> VECTOR_MDM_PHONE_BOOK;
  29. class kernelModuleModemManager: public kernelModule, public basicThread {
  30. private:
  31. DBC_MODEM_MANAGER_DATA m_sMMData;
  32. VECTOR_MDM_USER_DATA m_vUserData;
  33. VECTOR_MDM_PHONE_BOOK m_vPhoneBook;
  34. bool moduleActive;
  35. bool sessionStarted;
  36. bool notificationSent;
  37. //uint32_t m_nWindowCounterTO;
  38. // MThread procs
  39. static void * callProc( void * );
  40. static void * smsProc( void * );
  41. protected:
  42. uint32_t startCall( CSTR number );
  43. void sendSMS( CSTR number, CSTR text );
  44. void hangupCall( uint32_t call_id );
  45. /* From Basic Thread */
  46. virtual void m_fThreadProc( void );
  47. public:
  48. explicit kernelModuleModemManager( uint32_t moduleID );
  49. ~kernelModuleModemManager();
  50. /* From Kernel Module */
  51. virtual bool reloadSettings();
  52. virtual bool startService();
  53. virtual bool stopService( bool force = false );
  54. virtual bool dispatchEvent(EVENT_CONTAINER *Evt);
  55. virtual bool validate();
  56. };
  57. #endif