自动重播短信 [英] Autoreplay SMS

查看:93
本文介绍了自动重播短信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我开发了一个SMS程序,可以通过与SUB电缆相连的电话在PC上发送短信和读取短信.对于这些我使用AT命令,我没有使用任何库.现在,我的问题是我的程序如何自动检测电话接收到短信并发送该号码的答案.自动重播.请帮忙. :omg:

我只需要一些介绍. :D

Hello , i developed an SMS program, with that i can send sms and read sms on pc via my phone thats connected with SUB cable. For these i use AT commands, i werent using any library. Now my question is how can my program autodetect that the phone recieved an sms and send an answer on that number. Autoreplay. Help please. :omg:

I just need some introductions. :D

推荐答案

我需要更多有关电话类型等信息.如果手机具有公共API,也许您可​​以编写一些内容来订阅手机的传入事件.当您收到一条消息时,您可以通过USB端口向另一端监听的线程发送命令.

但是,一种可能性是根本不使用电话作为接收器.我知道有些电信公司允许您登录并查看已发送和已接收的消息.也许您的电信公司提供某种服务,可让您查看收到的消息?您可以在计算机上订阅该服务,并且每当收到传入消息时,触发这些AT命令以通过电话发送响应.
I''d need a little more information the type of phone and such. If the phone has a public API, maybe you could write something that could subscribe to the phone''s incoming event. When you get a message, you fire a command down the USB port to a thread that is listening on the other end.

However, one possibility would be not to use the phone as the receiver at all. I know that some telcos allow you to log in and view your sent and received messages. Maybe your telco has an some kind of service that allows you to view received messages? You could subscribe to that service on your computer and whenever you get an incoming message, fire those AT commands to send out a response via your phone.


AT + CNMI:向TE发送新消息指示


命令可能的响应+ CNMI = [< mode" [,< mt> [,< bm> [,< ds> [,< bfr>]]]]]] + CNMI?+ CNMI:< ;模式;,mt; mt; bm; ds; bfr. + CNMI =?+ CSCB :(支持的< mode" s,< mt&s> s,< bm&s> s,< ds&s; s,< bfr&s; s的列表)


< mode> ;: 0:TA中的缓冲区;

1:预留TE-TA链路时,丢弃指示并拒绝新的SM;否则转发

直接;

2:保留TE-TA链接时缓存新的Sms,并在保留后将其刷新到TE;

否则直接转发给TE;

3:直接转发给TE;

< mt> ;: 0:没有将SMS-DELIVER路由到TE;

1:+ CMTI:< mem>,< index>路由到TE;

2:对于除类2以外的所有SMS_DELIVER:+ CMT:....路由到TE;

类2表示为< mt> = 1;

3:第3类:如< mt> = 2;

其他类别:如< mt> = 1;

< bm> ;:与< mt>相同,但适用于CBM;

< ds> ;: 0:否将SMS-STATUS-REPORT路由到TE;

1:使用+ CDS将SMS-STATUS-REPORTs路由到TE:...

< bfr> ;: 0:将TA缓冲区刷新到TE(如果< mode> = 1..3);

1:清除TA缓冲区(如果< mode> = 1..3);


AT+CNMI: New Message indication to TE


Command Possible response(s) +CNMI=[<mode>[,<mt>[,<bm>[,<ds>[,<bfr>]]]]] +CNMI?+CNMI: <mode>,<mt>,<bm>,<ds>,<bfr> +CNMI=?+CSCB: (list of supported <mode>s,<mt>s,<bm>s,<ds>s,<bfr>s)


<mode>: 0: buffer in TA;

1: discard indication and reject new SMs when TE-TA link is reserved; otherwise forward

directly;

2: buffer new Sms when TE-TA link is reserved and flush them to TE after reservation;

otherwise forward directly to the TE;

3: forward directly to TE;

<mt>: 0: no SMS-DELIVER are routed to TE;

1: +CMTI: <mem>,<index> routed to TE;

2: for all SMS_DELIVERs except class 2: +CMT: .... routed to TE;

class 2 is indicated as in <mt>=1;

3: Class 3: as in <mt>=2;

other classes: As in <mt>=1;

<bm>: same as <mt>, but for CBMs;

<ds>: 0: No SMS-STATUS-REPORT are routed to TE;

1: SMS-STATUS-REPORTs are routed to TE, using +CDS: ...

<bfr>: 0: TA buffer is flushed to TE (if <mode>=1..3);

1: TA buffer is cleared (if <mode>=1..3);


AT+CNMI=1,1,0,0,0 ; Enable de reception of SM''s


+CMTI: "ME",3 ; a SM is received and stored in ME, index 3 (send from modem!)


AT+CPMS="ME" ; Make sure memory is OK

OK

AT+CMGR=3 ; Read message

+CMGR: "REC UNREAD",,,

Hello world


嗯,这就是我想要的!例如:

短信投票系统,例如电视上有这个talen节目时,有2个人,而您会用文字VOTE ADAM在号码1234上发送短信.然后,您会收到为亚当投票"的短信,谢谢.因此,我希望我的应用程序能够检测到我的手机何时收到新的短信,并在该短信上进行应答.我的英语不是最好的,我希望你现在就掌握了.我认为我需要一个无休止的周期来阻塞我手机连接的端口...我不确定.
Hmm so here is what i want! For exemple:

An sms voting system, like when there are this talen shows on tv, there are 2guys and u send an sms on the number 1234 with the text VOTE ADAM. And then you get an sms back with You Voted for Adam, thank you. So i want that my application detects when my phone gets a new sms, and answer on that sms. My english isnt the best i hope you got it now. I think i need and endless cycle that is cheking the port on that my phone is connected... im not sure.


这篇关于自动重播短信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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