本文介绍了C#中pdu的AT命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过流动命令以pdu模式发送短信,"length"是一个显示pdu长度的标签,当我写AT+CMGS=20或任何长度时我的代码都可以工作,但是我希望该代码采用标签insted的值在代码中编写静态值的方法,即时通讯以下面提到的方式使用了它,但是它不起作用.

如果我做错方法,谁能帮我写代码?

I m sending sms in pdu mode through flowing command, "length" is a label which shows pdu length, my code is working when I write AT+CMGS=20 or whatever the length is but i want that code take value of label insted of writing static value in code, i m using it below mention way but it is not working.

can anyone help me about how can i write in code if i m doing in wrong way?

string recievedData = ExecCommand(port, "AT", 500000, "No phone connected");
recievedData = ExecCommand(port, "AT+CMGF=0", 500000, "Failed to set message format.");
string command = "AT+CMGS=\""+ length +" \"";
recievedData = ExecCommand(port, command, 500000, "Failed to accept phoneNo");
command = p1 + char.ConvertFromUtf32(26) + "\r";
recievedData = ExecCommand(port, command, 5000, "Failed to send message");

推荐答案


string command = "AT+CMGS=\""+ length +" \"";

>


to

string command = "AT+CMGS=\""+ length.Text +" \"";


这篇关于C#中pdu的AT命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-11 10:36