⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 高手啊,,帮我将这个c程序改写delphi吧。有难度的。有关pdu转码的问题 delphi - windows sdk-api - csdn社区 community_csdn_net.htm

📁 PDU协议解释,分析信息传输的具体指令,扩大实际数据量
💻 HTM
📖 第 1 页 / 共 5 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<!-- saved from url=(0048)http://topic.csdn.net/t/20050331/19/3898783.html -->
<HTML lang=zh-CN xml:lang="zh-CN" 
xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>高手啊,,帮我将这个C程序改写DELPHI吧。有难度的。有关PDU转码的问题 Delphi / Windows SDK/API - CSDN社区 community.csdn.net</TITLE>
<META content=all name=robots>
<META http-equiv=Content-Language content=zh-CN>
<META http-equiv=Content-Type content="text/html; charset=utf-8"><LINK 
href="高手啊,,帮我将这个C程序改写DELPHI吧。有难度的。有关PDU转码的问题 Delphi - Windows SDK-API - CSDN社区 community_csdn_net.files/topic.css" 
type=text/css rel=stylesheet>
<SCRIPT 
src="高手啊,,帮我将这个C程序改写DELPHI吧。有难度的。有关PDU转码的问题 Delphi - Windows SDK-API - CSDN社区 community_csdn_net.files/Topic.js" 
type=text/javascript></SCRIPT>

<META content="c++ 指针 编码 解码 数值 字符 函数 数据 psrc 字符串 Delphi Windows SDK/API" 
name=Keywords>
<META 
content="// 短消息参数结构,编码/解码共用// 其中,字符串以0结尾typedef struct {    char SCA[16];       // 短消息服务中心号码(SMSC地址)    char TPA[16];       // 目标号码或回复号码(TP-DA或TP-RA)    char TP_PID;        // 用户信息协议标识(TP-PID)    char TP_DCS;        // 用户信息编码方式(TP-DCS)    char TP_SCTS[16];   // 服务时间戳字符串(TP_SCTS), 接收时用到    char TP_UD[161];    // 原始用户信息(编码前或解码后的TP-UD)    char index;         // 短消息序号,在读取时用到} SM_PARAM;---最好能改写成返回内容和电话号码的。//+CMGR: 1,,20//0891683110801505F0000BA13133452812F00000503092518342200131// PDU解码,用于接收、阅读短消息// pSrc: 源PD" 
name=description>
<META content="MSHTML 6.00.2900.3132" name=GENERATOR></HEAD>
<BODY>
<DIV id=wrapper>
<DIV id=innerWrapper>
<TABLE class=CSDN-PHF id=CSDNPHL cellSpacing=1 cellPadding=0 border=0>
  <TBODY>
  <TR>
    <TD><A href="http://www.csdn.net/" rel=external>CSDN首页</A></TD>
    <TD><A href="http://news.csdn.net/" rel=external>新闻</A></TD>
    <TD><A href="http://bbs.csdn.net/" rel=external><STRONG>论坛</STRONG></A></TD>
    <TD><A href="http://groups.csdn.net/" 
    rel=external><STRONG>小组</STRONG></A></TD>
    <TD><A href="http://blog.csdn.net/" 
    rel=external><STRONG>Blog</STRONG></A></TD>
    <TD><A href="http://dev.csdn.net/" rel=external>文档</A></TD>
    <TD><A href="http://download.csdn.net/" rel=external>下载</A></TD>
    <TD><A href="http://book.csdn.net/" rel=external>读书</A></TD>
    <TD><A href="http://tag.csdn.net/" 
rel=external><STRONG>Tag</STRONG></A></TD>
    <TD><A href="http://wz.csdn.net/" rel=external><STRONG>网摘</STRONG></A></TD>
    <TD><A href="http://search.csdn.net/" 
    rel=external><STRONG>搜索</STRONG></A></TD>
    <TD><A href="http://dotnet.csdn.net/" 
      rel=external><STRONG>.NET</STRONG></A></TD>
    <TD><A href="http://java.csdn.net/" 
    rel=external><STRONG>Java</STRONG></A></TD>
    <TD><A href="http://gamedev.csdn.net/" rel=external>游戏</A></TD>
    <TD><A href="http://live.csdn.net/" rel=external>视频</A></TD>
    <TD><A href="http://job.csdn.net/" rel=external>人才</A></TD>
    <TD><A href="http://prj.csdn.net/" rel=external>外包</A></TD>
    <TD><A href="http://www.dearbook.com.cn/" rel=external>第二书店</A></TD>
    <TD><A href="http://www.programmer.com.cn/" 
  rel=external>程序员</A></TD></TR></TBODY></TABLE>
<DIV id=logo>
<TABLE cellSpacing=0 cellPadding=0 width=770 border=0>
  <TBODY>
  <TR>
    <TD style="TEXT-ALIGN: left"><A href="http://community.csdn.net/" 
      rel=external><IMG class=logo alt=CSDN社区 
      src="高手啊,,帮我将这个C程序改写DELPHI吧。有难度的。有关PDU转码的问题 Delphi - Windows SDK-API - CSDN社区 community_csdn_net.files/logo_csdn.gif"></A></TD>
    <TD style="TEXT-ALIGN: center"><A href="http://g.csdn.net/5022240" 
      rel=external><IMG class=logo style="MARGIN: 0px" alt="" 
      src="高手啊,,帮我将这个C程序改写DELPHI吧。有难度的。有关PDU转码的问题 Delphi - Windows SDK-API - CSDN社区 community_csdn_net.files/468-60.gif"></A></TD>
    <TD style="TEXT-ALIGN: right"><A href="http://g.csdn.net/5021657" 
      rel=external><IMG style="MARGIN: 0px" alt="" 
      src="高手啊,,帮我将这个C程序改写DELPHI吧。有难度的。有关PDU转码的问题 Delphi - Windows SDK-API - CSDN社区 community_csdn_net.files/120_60.gif"></A></TD></TR>
  <TR id=bigFlash style="TEXT-ALIGN: center">
    <TD colSpan=3>
      <OBJECT 
      codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0 
      height=300 width=760 classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000><PARAM NAME="movie" VALUE="http://topic.csdn.net/images/adv/760-300.swf"><PARAM NAME="quality" VALUE="high">
            <embed src="http://topic.csdn.net/images/adv/760-300.swf" 
      quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" 
      type="application/x-shockwave-flash" width="760" height="300"></embed>
      </OBJECT></TD></TR></TBODY></TABLE>
<SCRIPT type=text/javascript>setTimeout("document.getElementById('bigFlash').style.display='none'", 5000);</SCRIPT>
<!--
<a href="http://community.csdn.net/" rel="external"><img class="logo" src="/ui/images/logo_csdn.gif" alt="CSDN社区" /></a><a 
href="http://g.csdn.net/5021685" rel="external"><img src="http://topic.csdn.net/images/adv/468.60_csdn.gif" alt=""/></a><a 
href="http://job.csdn.net/enterprise/zpxia/index.htm" rel="external"><img src="http://topic.csdn.net/images/adv/120_60.gif" alt=""/></a>
--><IMG style="DISPLAY: none" alt="" 
src="高手啊,,帮我将这个C程序改写DELPHI吧。有难度的。有关PDU转码的问题 Delphi - Windows SDK-API - CSDN社区 community_csdn_net.files/pv.htm"> 
</DIV>
<DIV id=navigation>
<DIV id=search>
<DIV id=innerSearch><INPUT id=key onfocus="value=''"><A 
onclick="return Search()" 
href="http://topic.csdn.net/t/20050331/19/3898783.html#">搜索</A>&nbsp;|&nbsp;<A 
title=功能强大的网络收藏夹,一秒钟操作就可以轻松实现保存带来的价值、分享带来的快乐 
href="javascript:d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(saveit=window.open('http://wz.csdn.net/storeit.aspx?t='+escape(d.title)+'&amp;u='+escape(d.location.href)+'&amp;c='+escape(t),'saveit','scrollbars=no,width=590,height=300,left=75,top=20,status=no,resizable=yes'));saveit.focus();">收藏</A>&nbsp;|&nbsp;<A 
onclick="return Print()" 
href="http://topic.csdn.net/t/20050331/19/3898783.html#">打印</A>&nbsp;|&nbsp;<A 
onclick="return Close()" 
href="http://topic.csdn.net/t/20050331/19/3898783.html#">关闭</A> </DIV></DIV>
<DIV><A class=CSDNRoom href="http://community.csdn.net/" 
rel=external>CSDN社区</A>&nbsp;&gt;&nbsp; <A 
href="http://community.csdn.net/Expert/ForumsList.asp?typenum=1&amp;roomid=53" 
rel=external>Delphi</A>&nbsp;&gt;&nbsp; <A 
href="http://community.csdn.net/Expert/ForumList.asp?typenum=1&amp;roomid=5304" 
rel=external>Windows SDK/API</A> </DIV></DIV>
<DIV id=mainWrapper>
<DIV id=pageContent>
<DIV id=innerContent>
<H1>高手啊,,帮我将这个C程序改写DELPHI吧。有难度的。有关PDU转码的问题</H1>
<DIV class=author><A class=anchor name=Top>楼主</A>WangMinYI(步行者)<INPUT class=user2 title="二级用户 该版得分小于等于500分,大于100分" type=button>2005-03-31 
19:39:22 在 Delphi / Windows SDK/API 提问</DIV>
<P> <BR>&nbsp; // &nbsp; 短消息参数结构,编码/解码共用 &nbsp; <BR>&nbsp; // &nbsp; 其中,字符串以0结尾 
&nbsp; <BR>&nbsp; typedef &nbsp; struct &nbsp; { &nbsp; <BR>&nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; char &nbsp; SCA[16]; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; // &nbsp; 短消息服务中心号码(SMSC地址) &nbsp; <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
char &nbsp; TPA[16]; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // &nbsp; 
目标号码或回复号码(TP-DA或TP-RA) &nbsp; <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; char &nbsp; 
TP_PID; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // &nbsp; 
用户信息协议标识(TP-PID) &nbsp; <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; char &nbsp; 
TP_DCS; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // &nbsp; 
用户信息编码方式(TP-DCS) &nbsp; <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; char &nbsp; 
TP_SCTS[16]; &nbsp; &nbsp; &nbsp; // &nbsp; 服务时间戳字符串(TP_SCTS), &nbsp; 接收时用到 
&nbsp; <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; char &nbsp; TP_UD[161]; &nbsp; 
&nbsp; &nbsp; &nbsp; // &nbsp; 原始用户信息(编码前或解码后的TP-UD) &nbsp; <BR>&nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; char &nbsp; index; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; // &nbsp; 短消息序号,在读取时用到 &nbsp; <BR>&nbsp; } &nbsp; 
SM_PARAM; &nbsp; <BR>&nbsp; ---最好能改写成返回内容和电话号码的。 &nbsp; <BR>&nbsp; //+CMGR: 
&nbsp; 1,,20 &nbsp; <BR>&nbsp; 
//0891683110801505F0000BA13133452812F00000503092518342200131 &nbsp; <BR>&nbsp; 
// &nbsp; PDU解码,用于接收、阅读短消息 &nbsp; <BR>&nbsp; // &nbsp; pSrc: &nbsp; 源PDU串指针 
&nbsp; <BR>&nbsp; // &nbsp; pDst: &nbsp; 目标PDU参数指针 &nbsp; <BR>&nbsp; // &nbsp; 
返回: &nbsp; 用户信息串长度 &nbsp; <BR>&nbsp; int &nbsp; gsmDecodePdu(const &nbsp; char* 
&nbsp; pSrc, &nbsp; SM_PARAM* &nbsp; pDst) &nbsp; <BR>&nbsp; { &nbsp; <BR>&nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; int &nbsp; nDstLength; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // &nbsp; 目标PDU串长度 &nbsp; <BR>&nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; unsigned &nbsp; char &nbsp; tmp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // &nbsp; 内部用的临时字节变量 &nbsp; <BR>&nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; unsigned &nbsp; char &nbsp; buf[256]; &nbsp; &nbsp; // 
&nbsp; 内部用的缓冲区 &nbsp; <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <BR>&nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; // &nbsp; SMSC地址信息段 &nbsp; <BR>&nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; gsmString2Bytes(pSrc, &nbsp; &amp;tmp, &nbsp; 2); &nbsp; &nbsp; 
&nbsp; &nbsp; // &nbsp; 取长度 &nbsp; <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tmp 
&nbsp; = &nbsp; (tmp &nbsp; - &nbsp; 1) &nbsp; * &nbsp; 2; &nbsp; &nbsp; &nbsp; 
&nbsp; // &nbsp; SMSC号码串长度 &nbsp; <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pSrc 
&nbsp; += &nbsp; 4; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // &nbsp; 指针后移 &nbsp; <BR>&nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; gsmSerializeNumbers(pSrc, &nbsp; pDst-&gt;SCA, 
&nbsp; tmp); &nbsp; &nbsp; &nbsp; &nbsp; // &nbsp; 转换SMSC号码到目标PDU串 &nbsp; 
<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pSrc &nbsp; += &nbsp; tmp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // &nbsp; 指针后移 &nbsp; <BR>&nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // 
&nbsp; TPDU段基本参数、回复地址等 &nbsp; <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
gsmString2Bytes(pSrc, &nbsp; &amp;tmp, &nbsp; 2); &nbsp; &nbsp; &nbsp; &nbsp; // 
&nbsp; 取基本参数 &nbsp; <BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pSrc &nbsp; += &nbsp; 
2; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // &nbsp; 指针后移 &nbsp; 
<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(tmp &nbsp; &amp; &nbsp; 0x80) &nbsp; 
<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { &nbsp; <BR>&nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // &nbsp; 包含回复地址,取回复地址信息 &nbsp; <BR>&nbsp; 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -