I am developing Receiving sms software with Pol
but the return is disordered coding !

Err err,error;
UInt16 gTelRefNum;
TelAppID gTelAppID;

TelSmsMultiPartExtensionType extensionType;
TelSmsExtensionType ext;
TelSmsDateTimeType gTeldatetime;

TelSmsGetAvailableStorageType m_Stores;
UInt16 m_Index;
UInt16 m_Storage=0;
UInt16 m_Retrieved=0;
UInt16 m_StorageCount=0;
UInt16 m_DataSize=70;
TelSmsDeliveryMessageType m_Sms;
TelSmsDeliveryAdvancedGSMType tmp;


void InitSms() // should call from constructor {
extensionType.bytesSent = 0;
extensionType.partCurrent = 0;
extensionType.partCount = 0;
extensionType.partId = 0;


ext.extensionTypeId = kTelSmsMultiPartExtensionTypeId;
ext.extension.mp = extensionType;

gTeldatetime.absolute = false;
gTeldatetime.dateTime = 86400*2;

tmp.protocolId = kTelSmsDefaultProtocol;
tmp.replyPath = false;
tmp.serviceCenterNumber = "+8613800755500";
tmp.serviceCenterNumberSize = kTelMaxPhoneNumberLen + 1;


m_Sms.version = kTelSmsAPIVersion; m_Sms.index = m_Index;
m_Sms.timeStamp = gTeldatetime;
m_Sms.dataSize = m_DataSize;
m_Sms.data = (unsigned char*)MemPtrNew(m_DataSize + 1 );
m_Sms.data[m_Sms.dataSize]='\0';
m_Sms.dataCodingScheme = kTelSmsDefaultGSMEncoding;



/*
kTelSms8BitsEncoding 0 8-bit encoding. kTelSmsBitsASCIIEncoding 1 ANSI X3.4 encoding. kTelSmsIA5Encoding 2 CCITT T.50 encoding. kTelSmsIS91Encoding 3 TIA/EIA/IS-91 section 3.7.1 encoding. kTelSmsUCS2Encoding 4 UCS2 encoding; used with GSM only. kTelSmsDefaultGSMEncoding


*/

上面几种都试完了,但还是乱码,接收英文就没问题,why?api再也找不出其它的编码方式


m_Sms.originatingAddressSize=kTelMaxPhoneNumberLen + 1; m_Sms.originatingAddress ="+223388"; m_Sms.otherToReceive=false; m_Sms.reportDeliveryIndicator=true; m_Sms.standardType = kTelNwkGSM; m_Sms.advancedParams.advancedGSM=tmp; m_Sms.extensionsCount = 1; m_Sms.extensionsP = &ext;

}
下面是读取sms的代码:
err = TelSmsReadMessage(gTelRefNum, gTelAppID,&m_Sms,NULL);
 if( err==errNone)
      return (const char*)m_Sms.data;

无解?

_________________________________________________________________
免费下载 MSN Explorer: http://explorer.msn.com/lccn/



-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/

Reply via email to