I've been working on a project where in I can send sms using a usb modem. Problem is I want to send those to multiple contact numbers. Im using mysql as my DB to store those phone numbers.

Here's a list what I my project is able to do(sms part only)

  1. able to communicate with IO ports. I can select an available port where the modem was connected. And also able to connect and disconnect it anytime I want.
  2. able to send an SMS message(using a prepaid sim card). But is only able to send 1 message at a time.

What I wanted to do but wasn't able to apply yet:

Using a list view, or grid view I want to select a specified group and send a pre-programmed message to those group.

I already know how to get data from a list view or a grid view. Im thinking of using a loop to extract all the contact numbers from the database and using AT commands, send it to those numbers. Only problem is how put those numbers to be executed as AT commands and send it.

I'm very confused on how to work it out but I'm getting there slowly. I just need a bit of advice from you guys.

A few suggestions on what I should or should be doing would be fine. If anyone has a sample code lying around, could you give me the link? I'll just go ahead and analyze it. Thanks.

有帮助吗?

解决方案

To send SMS messages with AT commands you use the AT+CMGS command. It is described in the 27.005 specification. Of all possible AT commands to start working with, it is not the simplest, but it's not impossible either. The important thing is that you MUST wait for "\r\n >" before sending the message content.

The general concept for AT command communication is that you send an AT command line to the modem, and then you MUST read and parse everything sent back from the modem until you receive a Final result code. See this answer for more details. And by all means read the V.250 specification to get a better understanding of AT commands.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top