sms设置wap书签.c
来自「Interface specification of China mobile 」· C语言 代码 · 共 196 行
C
196 行
#include <stdio.h>
unsigned char m_sms1[] ={
0x0B,
0x05,
0x04,
0xc3,
0x4f,
0xc0,
0x02,
0x00,
0x03,
0x04,
0x02,
0x01,
//WDP headers end
0x01,
0x06,
0x2C,
0x1F,
0x2A,
0x61,0x70,0x70,0x6C,0x69,0x63,0x61,0x74,0x69,
0x6F,0x6E,0x2F,0x78,0x2D,0x77,0x61,0x70,0x2D,
0x70,0x72,0x6F,0x76,0x2E,0x62,0x72,0x6F,0x77,
0x73,0x65,0x72,0x2D,0x73,0x65,0x74,0x74,0x69,
0x6E,0x67,0x73,
//WSP headers
0x00,
0x81,
0xEA,
0x01,
0x01,
0x6A,
0x00,
0x45,
0xC6,
0x06,
0x01,
0x87,
0x12,
0x45,
0x01,
0x87,
0x13,
0x11,
0x03,
0x31, 0x32, 0x33, 0x2E, 0x34, 0x35, 0x2E,
0x31, 0x32, 0x33, 0x2E, 0x36, 0x37,
0x00,
0x01,
0x87,
0x21,
0x11,
0x03,
0x2B, 0x34, 0x35, 0x38, 0x33, 0x35, 0x37, 0x32,
0x00,
0x01,
0x87,
0x22,
0x70,
0x01,
0x87,
0x23,
0x11,
0x03,
0x77, 0x61, 0x70, 0x75, 0x73, 0x65, 0x72,
0x00,
0x01,
0x87,
0x24,
0x11,
0x03,
0x77, 0x61, 0x70, 0x70, 0x61, 0x3, 0x73, 0x77,
0x00,
0x01,
0x87,
0x28,
0x72,
0x01,
0x87
};
unsigned char m_sms2[] = {
0x0B,
0x05,
0x04,
0xC3,
0x4F,
0xC0,
0x02,
0x00,
0x03,
0x04,
0x02,
0x02,
//WDP headers end
0x29,
0x6A,
0x01,
0x01,
0x86,
0x07,
0x11,
0x03,
'h', 't', 't', 'p',':','/', '/', 'h',
'e', 'r', 'o', '.', 't', 'x','s','m','s','.','c','o','m',
0x00,
0x01,
0xC6,
0x08,
0x01,
0x87,
0x15,
0x11,
0x03,
'h', 'e', 'r', 'o', '-', 'T', 'X','S','v','c',
0x00,
0x01,
0x01,
0xC6,
0x7F,
0x01,
0x87,
0x15,
0x11,
0x03,
'h', 'e', 'r', 'o', '-', 'T', 'X',
0x00,
0x01,
0x87,
0x17,
0x11,
0x03,
'h', 't', 't', 'p', ':','/', '/', 'h',
'e', 'r', 'o', '.', 't', 'x','s','m','s','.','c','o','m',
0x00,
0x01,
0x01,
0x01
};
int main()
{
printf("sz:%d\n",sizeof(m_sms1));
printf("sz:%d\n",sizeof(m_sms2));
if(!connect_sms_server()) {
printf("连接smsc错误。\n");
return -1;
}
//sms_send_msg_b("13924060425","hi",2,0x0F);
send_sms_1();
send_sms_2();
return 0;
}
#define MOBILE_NUM "13924060425"
int send_sms_1()
{
sms_send_msg_b(MOBILE_NUM,m_sms1,sizeof(m_sms1),0x04);
}
int send_sms_2()
{
sms_send_msg_b(MOBILE_NUM,m_sms2,sizeof(m_sms2),0x04);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?