SKYENGINE API 参考手册返回目录 |
(int32 code = 1103,
int32 mr_platEx
uint8* input,
int32
input_len,
uint8** output,
int32* output_len,
MR_PLAT_EX_CB*
cb
)
Description
读取一条短信。
Parameters
Name
Description
input
T_DSM_GET_SMS_INFO_REQ数据结构指针
input_len
T_DSM_GET_SMS_INFO_REQ数据结构大小
output
无
output_len
无
cb
无
MR_WAITING 请求成功
MR_FAILED 请求失败
MR_IGNORE 不支持该功能
读取结果通过mr_event通知应用,各个参数的含义如下:
第一个:MR_SMS_OP_EVENT;
第二个:MR_SMS_OP_GET_MSG_CONTENT;
第三个:短信内容缓存的地址(编码方式是大端unicode)。
T_DSM_GET_SMS_INFO_REQ数据结果:
typedef struct
{
int32 index; //显示时候索引
int8 type; //MR_SMS_INBOX, MR_SMS_OUTBOX
}T_DSM_GET_SMS_INFO_REQ;
/*mrp code*/
T_DSM_GET_SMS_INFO_REQ getInfoReq = { 0 };
getInfoReq.index = 0;
getInfoReq.type = MR_SMS_OUTBOX;
mrc_platEx( 1103, (uint8* )&getInfoReq, sizeof( T_DSM_GET_SMS_INFO_REQ ), NULL, NULL, NULL );mr_event事件处理:
case MR_SMS_OP_EVENT:
{
switch ( wParam )
{
case MR_SMS_OP_GET_MSG_CONTENT:
{
char *utf8 = NULL;
int32 utf8_size;
utf8_size = 2*wstrlen((PCWSTR)lParam);
utf8 = malloc( utf8_size );
buflog = malloc( utf8_size + 50 );
wstr2str( (PCWSTR)lParam, (PSTR)utf8, utf8_size );
mrc_printf( buflog, "Response success, get content:%s", utf8 );
free( utf8 );
utf8 = NULL;
}
break;
default:
break;
}
}