📄 form1test.frm
字号:
VERSION 5.00
Object = "{648A5603-2C6E-101B-82B6-000000000014}#1.1#0"; "MSCOMM32.OCX"
Begin VB.Form Form1
Caption = "短消息动态连接库测试程序"
ClientHeight = 7275
ClientLeft = 60
ClientTop = 345
ClientWidth = 5295
LinkTopic = "Form1"
ScaleHeight = 7275
ScaleWidth = 5295
StartUpPosition = 2 'CenterScreen
Begin MSCommLib.MSComm MSComm1
Left = 120
Top = 0
_ExtentX = 1005
_ExtentY = 1005
_Version = 393216
DTREnable = -1 'True
RTSEnable = -1 'True
End
Begin VB.Frame Frame2
Height = 1935
Left = 240
TabIndex = 8
Top = 5280
Width = 4935
Begin VB.CommandButton Command3
Caption = "关于"
Height = 495
Left = 2520
TabIndex = 13
Top = 1320
Width = 1215
End
Begin VB.CommandButton Command2
Caption = "解析短消息"
Height = 510
Left = 1080
TabIndex = 10
Top = 1320
Width = 1155
End
Begin VB.TextBox Text4
Height = 1005
Left = 360
MultiLine = -1 'True
TabIndex = 9
Text = "Form1test.frx":0000
Top = 240
Width = 4140
End
End
Begin VB.Frame Frame1
Height = 5175
Left = 240
TabIndex = 0
Top = 120
Width = 4935
Begin VB.CheckBox Check2
Caption = "状态报告"
Height = 255
Left = 2760
TabIndex = 18
Top = 4320
Width = 1455
End
Begin VB.CheckBox Check1
Caption = "闪屏"
Height = 255
Left = 1440
TabIndex = 17
Top = 4320
Width = 975
End
Begin VB.CommandButton Command5
Caption = "端口"
Height = 375
Left = 3360
TabIndex = 15
Top = 4680
Width = 855
End
Begin VB.CommandButton Command4
Caption = "发送短消息"
Height = 375
Left = 2160
TabIndex = 14
Top = 4680
Width = 1215
End
Begin VB.TextBox Text5
Height = 1815
Left = 1200
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 11
Top = 2400
Width = 3495
End
Begin VB.CommandButton Command1
Caption = "生成短消息"
Height = 375
Left = 840
TabIndex = 4
Top = 4680
Width = 1305
End
Begin VB.TextBox Text1
Height = 285
Left = 1200
TabIndex = 3
Text = "+8613800210500"
Top = 360
Width = 3345
End
Begin VB.TextBox Text2
Height = 270
Left = 1200
TabIndex = 2
Text = "13621972123"
Top = 840
Width = 3435
End
Begin VB.TextBox Text3
Height = 765
Left = 1200
MaxLength = 160
ScrollBars = 2 'Vertical
TabIndex = 1
Text = $"Form1test.frx":0055
Top = 1440
Width = 3465
End
Begin VB.Label Label5
Caption = "字数:"
Height = 255
Left = 120
TabIndex = 16
Top = 1920
Width = 975
End
Begin VB.Label Label4
Caption = "编码结果:"
Height = 735
Left = 120
TabIndex = 12
Top = 2880
Width = 975
End
Begin VB.Label Label1
Caption = "中心号码:"
Height = 240
Left = 120
TabIndex = 7
Top = 360
Width = 810
End
Begin VB.Label Label2
Caption = "电话号码"
Height = 210
Left = 120
TabIndex = 6
Top = 960
Width = 735
End
Begin VB.Label Label3
Caption = "内容"
Height = 255
Left = 120
TabIndex = 5
Top = 1560
Width = 825
End
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'''//上海蓝峰电子技术有限公司
'''//作者:厉小伟
'''//TC35modem价格:1280元 附送天线、数据线等配件.
'''//
'''//Email:dlxw@china.com
'''//电话;021-63222149 传真:021-63524268
'''短消息收发动态连接库使用说明
''' 在我们的GSM短消息应用中,最大的障碍可能就是发送中文短消息的PDU编码了,为此我们开发了
''' 短消息收发动态连接库,可以方便地在文本和PDU之间转换。
''' 我们开发的动态连接库适用于我们开发的TC35 modem 以及与其兼容的GSM 短消息设备。
''' (请TC35modem资料可以上我们网站上查阅,需要TC35 modem的用户可以直接与我们联系。)主要
''' 将文本和PDU短消息格式相互转化,用户可以将要发送的信息其转化成PDU格式直接放入通
''' 信端口,也可以将通信串 口中读到的PDU短消息,转化为文本方式的短消息。
'''
'''共有3个函数:
''' TextToSms(char* csca,char* ToNum,char* smsnr,int flashit,int reportit,int*
''' sms_len,char* sms):
''' 该函数用于将短消息中心,对方手机号码,短消息内容进行编码转变为PDU格式
''' 的字符串?
''' 其中
''' csca: 短消息中心号码为“+8613800210500”形式,注意 需要加+号。
''' ToNum:目的手机号码,要把本短消息发送到的号码,如13621972123。
''' flashit:对方接收是是否闪屏,1为闪屏,0为正常状态。 (注册用户可用)
''' reportit:是否返回状态报告。1为返回,0为不返回。 (注册用户可用)
''' sms_len:短消息长度,用于放在,at+cmgs=[sms_len]处。
''' sms_nr: 生成的PDU格式的短消息?
'''
''' 返回值:成功返回非0,错误返回0。
'''
''' SmsToText(char* sms,char* csca,int* csca_len,char* ToNum,int* ToNum_len,char*
''' sendtime,int* time_len,char* smsnr)
''' 该函数用于将PDU格式的短消息字符串分解成短消息中心?来源手机号码?发送
''' 时间?短消息内容?
''' PDU格式的短消息字符一般利用AT+CMGL=0 或AT+CMGL=1来获得。
''' 本函数只解析接收到的短消息
''' 其中
''' sms: PDU 格式的短消息?
''' csca: 短消息中心号码为“+8613800210500”形式,如果已经用at+csca=xxx设置了短消息中心,可为空。注意 需要加+号。
''' csca_len: 短消息中心号码字符串长度
''' ToNum: 来源手机号码?
''' ToNum_len: 手机号码字符串长度
''' sendtime: 发送时间?
''' time_len: 时间字符串长度
''' sms_nr: 短消息内容
'''
''' 返回值:正确:短消息内容长度,错误:0。
'''
''' 注意:当解析错误则csca="00000000000",内容为:"<Error>"
'''
''' About():显示动态连接库信息对话框。
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -