퍼티를 통해 내 SMS를 읽는 데 문제가 있습니다. 그 beacuse에 AT + CMGL = "ALL"을 입력했지만 메시지 (텍스트)와 숫자는 숫자 일뿐입니다. gms 모뎀은 노키아 s10에서 UCS2를 사용합니다. 여기서 무엇을 해야할지 몰라? 어떻게 내 숫자를보고 그냥 내 메시지를 읽을 수 있습니까 ?? (내가 CodeProject의에서이 코드를 사용하고 내가이 줄을 변경내가 UCS2에서 숫자를 얻는 이유는 무엇입니까? 어떻게 명령과 C#에서 해결할 수 있습니까?
또한하시기 바랍니다 도움이되지만 UCS-2 인코딩 저장소에서 결과를 변환하려면 UCS2
public ShortMessageCollection ReadSMS(SerialPort port, string p_strCommand)
{
// Set up the phone and read the messages
ShortMessageCollection messages = null;
try
{
#region Execute Command
// Check connection
ExecCommand(port,"AT", 300, "No phone connected");
// Use message format "Text mode"
ExecCommand(port,"AT+CMGF=1", 300, "Failed to set message format.");
// Use character set "PCCP437"
**ExecCommand(port, "AT+CSCS=\"UCS2\"", 300, "Failed to set character set.")**;
// Select SIM storage
ExecCommand(port,"AT+CPMS=\"SM\"", 300, "Failed to select message storage.");
// Read the messages
string input = ExecCommand(port, p_strCommand, 5000, "Failed to read the messages.");
#endregion
#region Parse messages
messages = ParseMessages(input);
#endregion
}
catch (Exception ex)
{
throw ex;
}
if (messages != null)
return messages;
else
return null;
}