问题描述
我无法正确理解的一些理论问题,如果有任何机构在这里帮助我,谢谢
some theory question that i could not understand correctly if any body here to help me here thanks
class SmsClass
{
SerialPort serialPort;
public SmsClass(string comPort)
{
this.serialPort = new SerialPort();
this.serialPort.PortName = comPort;
this.serialPort.BaudRate = 9600; //what is BaudRate and why we use 9600 not other?
this.serialPort.Parity = Parity.None;//if parity is for error checking then why we set Parity.None?
this.serialPort.DataBits = 8;// what is Databits?
this.serialPort.StopBits = StopBits.One;
this.serialPort.Handshake = Handshake.RequestToSend;// what is Handshake do?
this.serialPort.DtrEnable = true;
this.serialPort.RtsEnable = true;
this.serialPort.NewLine = System.Environment.NewLine;
}
public bool sendSms(string cellNo, string sms)
{
string messages = null;
messages = sms;
if (this.serialPort.IsOpen == true)
{
try
{
this.serialPort.WriteLine("AT" + (char)(13));// why we set char 13?
Thread.Sleep(4);
this.serialPort.WriteLine("AT+CMGF=1" + (char)(13));//also here char 13?
Thread.Sleep(5);
this.serialPort.WriteLine("AT+CMGS=\"" + cellNo + "\"");
Thread.Sleep(10);
this.serialPort.WriteLine(">" + messages + (char)(26));//why we set char 26 here?
}
catch (Exception ex)
{
MessageBox.Show(ex.Source);
}
return true;
}
else
return false;
}
问题
1)什么是BaudRate为什么我们使用9600而不是其他?
2)如果奇偶校验用于错误检查那么为什么我们设置Parity.None?
3)什么是Databits?
4)什么是握手呢?
5)
Questions
1)What is BaudRate and why we use 9600 not other?
2)If parity is for error checking then why we set Parity.None?
3)What is Databits?
4)What is Handshake do?
5)
this.serialPort.WriteLine("AT" + (char)(13));// why we set char 13?
6)this.serialPort.WriteLine(AT + CMGF = 1+(char)(13)); //也在这里char 13?
7)this.serialPort.WriteLine(>+ messages +(char)(26)); //为什么我们在这里设置char 26?
6)this.serialPort.WriteLine("AT+CMGF=1" + (char)(13));//also here char 13?
7)this.serialPort.WriteLine(">" + messages + (char)(26));//why we set char 26 here?
推荐答案
这篇关于通过移动设备发送消息的一些基本理论问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!