Linux串口编程短信篇(二)

您所在的位置:网站首页 编辑短信zm发送到怎么编辑 Linux串口编程短信篇(二)

Linux串口编程短信篇(二)

2024-07-11 16:59| 来源: 网络整理| 查看: 265

文章目录 一. 电话号码处理1.1 短信中心号码的处理1.2 收件人号码处理 二. 短信内容处理2.1 UTF-8 转 Unicode2.2 Hex 转 String 三. 最终汇总3.1 PDU格式拼接3.2 函数 pdu_encod() 四. 模块头文件 PDU.h

一. 电话号码处理 1.1 短信中心号码的处理

在这里插入图片描述 实现:

int Processing_center_number(char *center_number) { int i; char temp; char head[20] = "0891"; //08: length 91: globalization if(!center_number) { printf("Invalid input\n"); return -1; } /* Drop the ‘+’ sign, add ‘F’, and swap the parity bits */ strcpy(center_number,¢er_number[1]); strcat(center_number,"F"); for(i = 0; i Unicode , LSB */ int utf8_to_unicode(char* utf8_buf,char* unic_buf) { if(!utf8_buf) { printf("Invalid parameter\n"); return -1; } char *temp = unic_buf; char b1,b2,b3,b4; //b1: high data bit b4: low data bits while(*utf8_buf) { if(*utf8_buf > 0x00 && *utf8_buf > 2) & 0x07; temp++; *temp = (b1


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3