📄 mminwsimulatordlg.cpp
字号:
{
pData=SAT.SetupMenuPlugin();
}
else if(!pLugin.CompareNoCase(_T("satselectitemplg")))
{
pData=SAT.SelectItemPlugin();
}
else if(!pLugin.CompareNoCase(_T("satdisplaytxtplg")))
{
pData=SAT.DisplayTextPlugin();
}
else if(!pLugin.CompareNoCase(_T("satgetinkeyplg")))
{
pData=SAT.GetInkeyPlugin();
}
else if(!pLugin.CompareNoCase(_T("satgetinputplg")))
{
pData=SAT.GetInputPlugin();
}
else if(!pLugin.CompareNoCase(_T("SendSMSContectByIndex")))
{
SetBufferForMessage(RetDataPointerForInMessage(1519));
pData = SendSMSContectByIndex();
}
else if(!pLugin.CompareNoCase(_T("SendGetVoicemailAddressRsp")))
{
pData = SendGetVoicemailAddressRsp();
}
else if(!pLugin.CompareNoCase(_T("SendSetVoicemailAddressRsp")))
{
pData = RetDataPointerForInMessage(1547);
if(pData)
{
SetBufferForMessage(pData);
pData = SendSetVoicemailAddressRsp();
}
}
else if(!pLugin.CompareNoCase(_T("SendSMSToMMI")))
{
//SetBufferForMessage(RetDataPointerForInMessage(1531));
pData = SendSMSToMMI();
}
else if(!pLugin.CompareNoCase(_T("SendSmsMemStatus")))
{
pData = SendSmsMemStatus();
}
else if(!pLugin.CompareNoCase(_T("SendMessageNumber")))
{
//SetBufferForMessage(RetDataPointerForInMessage(1503));
pData = SendMessageNumber();
}
else if(!pLugin.CompareNoCase(_T("DeleteSMSRequest")))
{
pData = RetDataPointerForInMessage(1517);
if(pData)
{
SetBufferForMessage(pData);
pData = DeleteSMSRequest();
}
}
else if(!pLugin.CompareNoCase(_T("SaveSMSMessage")))
{
pData = RetDataPointerForInMessage(1523);
if(pData)
{
SetBufferForMessage(pData);
pData = SaveSMSMessage();
}
}
else if(!pLugin.CompareNoCase(_T("GetMemoryStorage")))
{
//SetBufferForMessage(RetDataPointerForInMessage(1507));
pData = GetMemoryStorage();
}
else if(!pLugin.CompareNoCase(_T("SetMemoryStorage")))
{
SetBufferForMessage(RetDataPointerForInMessage(1525));
pData = SetMemoryStorage();
}
else if(!pLugin.CompareNoCase(_T("SetLastNoRsp")))
{
pData = RetDataPointerForInMessage(1500);
if(pData)
{
SetBufferForCallHistory(pData);
pData = SetLastNoRsp();
}
}
else if(!pLugin.CompareNoCase(_T("GetLastNoRsp")))
{
pData = RetDataPointerForInMessage(1498);
if(pData)
{
SetBufferForCallHistory(pData);
pData = GetLastNoRsp();
}
}
else if(!pLugin.CompareNoCase(_T("DeleteAllCallsRsp")))
{
pData = RetDataPointerForInMessage(1502);
if(pData)
{
SetBufferForCallHistory(pData);
pData = DeleteAllCallsRsp();
}
}
else if(!pLugin.CompareNoCase(_T("IncomingCallInd")))
{
pData = IncomingCallInd();
}
else if(!pLugin.CompareNoCase(_T("CheckSecurityBootup")))
{
pData = RetDataPointerForInMessage(1444);
if(pData)
{
SetBufferForSettings(pData);
pData = CheckSecurityBootup();
}
}
else if(!pLugin.CompareNoCase(_T("SettingGPRSGetConnectType")))
{
pData = SettingGPRSGetConnectType();
}
else if(!pLugin.CompareNoCase(_T("SettingGPRSSetConnectType")))
{
pData = RetDataPointerForInMessage(3011);
if(pData)
{
SetBufferForSettings(pData);
pData = SettingGPRSSetConnectType();
}
}
else if(!pLugin.CompareNoCase(_T("GetCallPriceUnit")))
{
pData = GetCallPriceUnit();
}
else if(!pLugin.CompareNoCase(_T("SetCallPriceUnit")))
{
pData = RetDataPointerForInMessage(1456);
if(pData)
{
SetBufferForMessage(pData);
pData = SetCallPriceUnit();
}
}
else if(!pLugin.CompareNoCase(_T("SettingGetNetworkBand")))
{
pData = SettingGetNetworkBand();
}
else if(!pLugin.CompareNoCase(_T("SettingSetNetworkBand")))
{
pData = RetDataPointerForInMessage(1440);
if(pData)
{
SetBufferForSettings(pData);
pData = SettingSetNetworkBand();
}
}
else if(!pLugin.CompareNoCase(_T("BootupFunctions")))
{
pData = RetDataPointerForInMessage(1448);
SetBufferForSettings(pData);
pData = BootupFunctions();
}
else if(!pLugin.CompareNoCase(_T("SMSBootUpBeginInd")))
{
pData = SMSBootUpBeginInd();
}
else if(!pLugin.CompareNoCase(_T("SMSSendBootupReadInd")))
{
SetBufferForMessage(RetDataPointerForInMessage(1556));
pData = SMSSendBootupReadInd();
}
else if(!pLugin.CompareNoCase(_T("SendSMSResponse")))
{
SetBufferForMessage(RetDataPointerForInMessage(1521));
pData = SendSMSResponse();
}
else if(!pLugin.CompareNoCase(_T("CheckSimLock")))
pData = CheckSimLock();
else if(!pLugin.CompareNoCase(_T("GetProfileParamsRsp")))
pData = GetProfileParamsRsp();
else if(!pLugin.CompareNoCase(_T("SetProfileSettingParamsRsp")))
{
pData = RetDataPointerForInMessage(1507);
if(pData)
{
SetBufferForMessage(pData);
pData = SetProfileSettingParamsRsp();
}
}
return pData;
}
void CMMINWSimulatorDlg::AddMessageToList(MYQUEUE1 stIncomingMsg)
{
CheckDeleteMessageIfExist(stIncomingMsg);
INPTRLIST *stPtrListIncomingMsg = new INPTRLIST;
stPtrListIncomingMsg->stMessage = stIncomingMsg;
stPtrListIncomingMsg->index = m_IndexInIncomingMsgList;
m_IncomingMsgDataList->AddTail(stPtrListIncomingMsg);
//delete(stPtrListIncomingMsg);
}
CMMINWSimulatorDlg::~CMMINWSimulatorDlg()
{
//destructor
delete(m_IncomingMsgDataList);
delete(m_pMessageManager);
}
CString CMMINWSimulatorDlg::GetSystemTimeString()
{
CString sTime;
CTime ct ;
ct = CTime::GetCurrentTime();
sTime.Format
(_T("%02d/%02d/%02d %02d:%02d:%02d"),ct.GetMonth(),ct.GetDay(),ct.GetYear(),ct.GetHour(),ct.GetMinute(),ct.GetSecond());
return sTime;
}
void* MyMallocDataPtr(U32 size)
{
void *ptr;
struct tsize{
U32 size;
};
struct tsize *temp, tempdata;
int sizeofuint = sizeof(U32);
temp = (tsize*) malloc(size + sizeofuint);
tempdata.size=size;
memcpy(temp, &tempdata, sizeof(tempdata));
ptr = (void*)((char*)temp + sizeof(tempdata));
return ptr;
}
void CMMINWSimulatorDlg::RmBuffEntryIncomingBufferList(int Index)
{
INPTRLIST *stPtrListIncomingMsg;
for( POSITION pos = m_IncomingMsgDataList->GetHeadPosition(); pos != NULL; )
{
POSITION posCurrent = pos;
stPtrListIncomingMsg = (INPTRLIST*)(m_IncomingMsgDataList->GetNext( pos ));
if(stPtrListIncomingMsg->index == Index)
{
m_IncomingMsgDataList->RemoveAt(posCurrent);//removed the entry as message is send
//also call the function to set the status or icon for disabling the entry
AMLOGINFO(_T("Removed the entry from the incoming message data list buffer"));
break;
}
}
}
void* CMMINWSimulatorDlg::RetDataPointerForInMessage(int iMsgId)
{
INPTRLIST *stPtrListIncomingMsg;
for( POSITION pos = m_IncomingMsgDataList->GetHeadPosition(); pos != NULL; )
{
stPtrListIncomingMsg = (INPTRLIST*)(m_IncomingMsgDataList->GetNext( pos ));
if(stPtrListIncomingMsg->stMessage.nMsgType == iMsgId)
{
return(stPtrListIncomingMsg->stMessage.nDataPtr);//removed the entry as message is send
//also call the function to set the status or icon for disabling the entry
AMLOGINFO(_T("Found the entry for incoming message data list buffer"));
}
}
AMLOGINFO(_T("No Entry for Buffer for incoming message data list buffer"));
return NULL;
}
void CMMINWSimulatorDlg::CheckDeleteMessageIfExist(MYQUEUE1 stIncomingMsg)
{
//new function so as to update the message entries in ptrlist
INPTRLIST *stPtrListIncomingMsg;
for( POSITION pos = m_IncomingMsgDataList->GetHeadPosition(); pos != NULL; )
{
POSITION posCurrent = pos;
stPtrListIncomingMsg = (INPTRLIST*)(m_IncomingMsgDataList->GetNext( pos ));
if(stPtrListIncomingMsg->stMessage.nMsgType == stIncomingMsg.nMsgType)
{
m_IncomingMsgDataList->RemoveAt(posCurrent);//removed the entry as message is send
//also call the function to set the status or icon for disabling the entry
AMLOGINFO(_T("Removed the entry from the incoming message data list buffer"));
break;
}
}
}
extern BOOL AudioReplayMelody(void);
extern unsigned char RepeatFactor;
extern BOOL bSendAudioFinishInd;
void SendAudioFinishInd()
{
MYQUEUE Msg;
void* tmp=(void*)MyMallocDataPtr(10);
TRACE(LPCTSTR(_T("\n In SendAudioFinishInd")));
bSendAudioFinishInd=FALSE;
Msg.oslSrcId = MOD_L4C;
Msg.oslDestId = PRT_EVENT;
Msg.oslMsgId = 1337;///audio finish ind
Msg.oslDataPtr = tmp;
Msg.oslPeerBuffPtr = NULL;
myNSRThread->WriteToSocket(&Msg);
}
LRESULT CMMINWSimulatorDlg::OnMciNotify(WPARAM wParam, LPARAM lParam)
{
if(wParam==MCI_NOTIFY_SUCCESSFUL)
{
if((RepeatFactor==0)||(RepeatFactor==1))
AudioReplayMelody();
else if((RepeatFactor==2)&&(bSendAudioFinishInd))
{
SendAudioFinishInd();
}
}
return(TRUE);
}
void CMMINWSimulatorDlg::OnMenuAsyncmsg()
{
// TODO: Add your command handler code here
AMLOGINFO(_T("On Click of Options of Asycn Messages"));
CAsyncSendMessage cAsyncSendMsg;
cAsyncSendMsg.SetLibrayIdentifier(library_identifier);
cAsyncSendMsg.DoModal();
}
void CMMINWSimulatorDlg::OnMenuChangeAttributes()
{
// TODO: Add your command handler code here
//CChangeAttributesDlg changeAtt;
//changeAtt.DoModal();
//MsgAttributeChange mac;
//mac.SetLibraryIdentifier(library_identifier);
//mac.Is_Coming_From = MAIN;
//mac.DoModal ();
}
void CMMINWSimulatorDlg::OnMenuEditAddData()
{
//TODO: Add your command handler code here
CAddEditDialog addEdit;
addEdit.Is_Coming_From = MAIN;
addEdit.SetLibraryIdentifier(library_identifier);
addEdit.DoModal();
}
void CMMINWSimulatorDlg::OnMenuAsyncMessages()
{
// TODO: Add your command handler code here
CAsyncSendMessage cAsyncSendMsg;
cAsyncSendMsg.DoModal();
}
void CMMINWSimulatorDlg::OnLvnItemchangedListIncomingMessages(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMLISTVIEW pNMLV = reinterpret_cast<LPNMLISTVIEW>(pNMHDR);
// TODO: Add your control notification handler code here
*pResult = 0;
}
BOOL CMMINWSimulatorDlg::PreTranslateMessage(MSG* pMsg)
{
BOOL bHandleMsg = FALSE;
switch(pMsg->message)
{
case WM_KEYDOWN:
{
switch(pMsg->wParam)
{
case VK_ESCAPE:
//case VK_RETURN:
ShowWindow(SW_HIDE);
return 1;
break;
default:
break;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -