你为什么要这样做?这是一个过于复杂的过程,并且有可用的 MMSC 网关是有原因的。您只使用 GPRS 部分建立 PPP 连接,然后其余的事情通过 IP 进行。
I 强烈建议您为此使用网关,并且不要手动执行此操作.
为了建立 PPP 连接:
-
AT+CGDCONT?
这应该根据您所在的上下文进行响应。这意味着您已准备好连接/连接。
-
AT+CGATT=1
(连接调制解调器)
-
AT+CGDATA=?
(检查数据模式是什么)
-
AT+CGACT=1
(激活您的连接)
现在您使用 PPP,然后您可以使用您的提供商使用的任何内容通过调制解调器进行通话。它可以是从直接 HTTP 到 MMSE 协议的任何协议。
例如,以下是通过 HTTP 的完整记录。首先,我们需要设置调制解调器和连接信息。所有这些命令都应该得到以下响应OK
来自调制解调器。
AT+CMMSINIT # Initialize the MMS method
AT+CMMSCURL="some.url.com" # the MMS center URL
AT+CMMSCID=1 # Set bearer
AT+CMMSPROTO="1.1.1.1",8080 # MMS Proxy information
AT+SAPBR=3,1,"Contype","GPRS" # How you are sending
AT+SAPBR=3,1,"APN","foobar" # Set the APN
AT+SAPBR=1,1 # Activate the bearer context
接下来,我们准备消息:
> AT+CMMSEDIT=1 # Enter edit mode
OK
> AT+CMMSDOWN="PIC",54321,30000 # Download a pic that is 54321 bytes
# and set the latency
# for the download to 30000 ms
CONNECT # This means, ready to receive data
# so send your file
OK # Data received
> AT+CMMSRECP="123456789" # Set the recipient
OK
> AT+CMMSVIEW # View your message
(your message)
OK
> AT+CMMSSEND # Send the message
OK # Message sent
> AT+CMMSEDIT=0 # Exit edit mode, and clear the buffer
OK
当然,这是特定于我使用的调制解调器的。您的结果可能会有所不同。我可以告诉你,这是徒劳的做法。如果您想实际发送彩信,请选择合适的提供商。