如何发送短信到我的GSM调制解调器? [英] How to send sms to my gsm modem?

查看:132
本文介绍了如何发送短信到我的GSM调制解调器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要发送短信到我的gsm调制解调器-SIM300 V7.01.

如何串行发送AT Command?我的意思是在下面给出的串行程序中如何以及在何处插入AT命令:

I need to send sms to my gsm modem - SIM300 V7.01.

How to send AT Command serially? I mean how and where to insert the AT Commands in the serial program given below:

#include <reg51.h>
void SerTx(unsigned char);
void main(void){
TMOD=0x20; //use Timer 1, mode 2
TH1=0xFD; //9600 baud rate
SCON=0x50;
TR1=1; //start timer
while (1) {
SerTx(‘Y’);
SerTx(‘E’);
SerTx(‘S’);
}
}
void SerTx(unsigned char x){
SBUF=x; //place value in buffer
while (TI==0); //wait until transmitted
TI=0;
}


如果程序错误,请给我合适的解决方案.
我的项目提交时间为5天.请在这方面帮助我.

[edit]添加了代码标签[/edit]


If the program is wrong, kindly give me the suitable solution for this.
My project submission is in 5 days. Please help me out in this regard.

[edit] added code tags[/edit]

推荐答案

这看起来像是8051微控制器的代码.首先阅读文档或教程(Google提出了 [ ^ ]网站)

我不再记得如何配置串行端口,您将不得不查找适当的寄存器设置.
除此之外,您的代码看起来还可以,请尝试使用AT命令序列的每个字符调用SerTx.
This looks like code for an 8051 microcontroller. First read the documentation or a tutorial (Google came up with this[^] site)

I no longer remember how to configure the serial port, you''ll have to look up the appropriate register settings.
Other than that, your code looks OK, try calling SerTx with each character of the AT command sequence.


这篇关于如何发送短信到我的GSM调制解调器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆