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.
83 lines
2.0 KiB
83 lines
2.0 KiB
#ifndef __KERNEL_MODULE_MODEM_MANAGER_HEADER__
|
|
#define __KERNEL_MODULE_MODEM_MANAGER_HEADER__
|
|
|
|
#include "../../components/base/basicThread.h"
|
|
#include "kernelModule.h"
|
|
|
|
//*
|
|
|
|
typedef std::vector<DBC_MODEM_DATA *> VECTOR_DBC_MODEM_DATA;
|
|
|
|
class kernelModuleModemManager;
|
|
|
|
typedef struct S_MDM_USER_DATA
|
|
{
|
|
uint8_t modem_id;
|
|
char target[64];
|
|
kernelModuleModemManager * parent;
|
|
bool finished;
|
|
pthread_t handler;
|
|
} MDM_USER_DATA;
|
|
|
|
typedef std::vector<MDM_USER_DATA *> VECTOR_MDM_USER_DATA;
|
|
|
|
typedef struct S_MDM_CALL_DATA : public MDM_USER_DATA
|
|
{
|
|
uint8_t waitTillHangup;
|
|
} MDM_CALL_DATA;
|
|
|
|
typedef struct S_MDM_SMS_DATA : public MDM_USER_DATA
|
|
{
|
|
CSTR text;
|
|
} MDM_SMS_DATA;
|
|
|
|
//*/
|
|
|
|
#define MDM_IDLE_WM 0x01
|
|
#define MDM_INIT_CALL_WM 0x02
|
|
#define MDM_MODEM_IS_BUSY_WM 0x03
|
|
#define MDM_FETCH_NEXT_WM 0x04
|
|
#define MDM_WAIT_WINDOW_WM 0x05
|
|
#define MDM_STOP_WM 0x06
|
|
|
|
typedef std::vector<DBC_MODEM_PHONEBOOK_RECORD *> VECTOR_MDM_PHONE_BOOK;
|
|
|
|
class kernelModuleModemManager : public kernelModule, public basicThread
|
|
{
|
|
private:
|
|
|
|
DBC_MODEM_MANAGER_DATA m_sMMData;
|
|
VECTOR_MDM_USER_DATA m_vUserData;
|
|
VECTOR_MDM_PHONE_BOOK m_vPhoneBook;
|
|
bool moduleActive;
|
|
bool sessionStarted;
|
|
bool notificationSent;
|
|
char m_cMyWanIP[32];
|
|
uint8_t m_bCurrentMode;
|
|
// uint32_t m_nWindowCounterTO;
|
|
// MThread procs
|
|
static void * callProc(void *);
|
|
static void * smsProc(void *);
|
|
bool updateWanIP();
|
|
|
|
protected:
|
|
|
|
uint32_t startCall(CSTR number);
|
|
void sendSMS(CSTR number, CSTR text);
|
|
void hangupCall(uint32_t call_id);
|
|
/* From Basic Thread */
|
|
virtual void m_fThreadProc(void);
|
|
|
|
public:
|
|
|
|
explicit kernelModuleModemManager(uint32_t moduleID);
|
|
~kernelModuleModemManager();
|
|
/* From Kernel Module */
|
|
virtual bool reloadSettings();
|
|
virtual bool startService();
|
|
virtual bool stopService(bool force = false);
|
|
virtual bool dispatchEvent(EVENT_CONTAINER * Evt);
|
|
virtual bool validate();
|
|
};
|
|
|
|
#endif
|