请参考下面的代码:
char* pszMessageFormat = "AT+CMGF=0\r"; //Set the transfer mode to PDU
Write(pszMessageFormat, strlen(pszMessageFormat));
if (!WaitForSerialResponse("OK", dwTimeout, 32))
{
CString sError;
sError.LoadString(IDS_SMSSERIALPORT_FAIL_SET_PDU_MODE);
AfxThrowSMSException(sError, E_SMS_SET_PDU_MODE);
}
char* pszMessageFormat = "AT+CMGF=0\r"; //Set the transfer mode to PDU
Write(pszMessageFormat, strlen(pszMessageFormat));
if (!WaitForSerialResponse("OK", dwTimeout, 32))
{
CString sError;
sError.LoadString(IDS_SMSSERIALPORT_FAIL_SET_PDU_MODE);
AfxThrowSMSException(sError, E_SMS_SET_PDU_MODE);
}
serialPort1 = new SerialPort("COM1", 9600, Parity.None, 8, StopBits.One);
我用我代码都发能正常发出短信,就是没法收到回复!