Guest amicoc Posted November 17, 2004 Report Posted November 17, 2004 Hi I am trying to read an incoming message using RIL, I am able to intercept the message when it arrives and to get the structure RILMESSAGE pointer and to get the message lenght but I am NOT able to read the message text buffer (prm->msgInDeliver.rgbMsg) since strange characters are returned. I have even tried to translate the chars to hex code and I have seen that these codes dont correspond to real characters. Is someone able to decode the incoming SMS messages? I suspect that SMS text is encoded (compressed) or cripted in some way. Thanks a lot TCHAR *hexdump(unsigned char *data, int n) { static TCHAR buf[1000]; TCHAR *p; p=buf; while (n--) { p += _sntprintf(p, 4, TEXT(" %02x"), *data++); } return buf; } .... .... ..... case RIL_NCLASS_MESSAGE: { SetDlgItemText(g_hwnd,ID_LOOP,L"RIL_NCLASS_MESSAGE"); RILMESSAGE *prm = (RILMESSAGE *)lpData; if ( dwCode == 0x20001 ) { wsprintf(szString, L"code=0x%0X, msglen=%i ,msg=%s", prm->dwType, prm->msgInStatus.cchMsgLength, hexdump(prm->msgInDeliver.rgbMsg,prm->msgInDeliver.cchMsgLength) ); }
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now