Discussion:
How to make efficient and reliable SMS sender in C language using AT commands
(too old to reply)
j***@gmail.com
2013-10-31 19:23:39 UTC
Permalink
Hi everybody,
I have written a program in C which uses AT commands to send SMS via GSM modem.
The problem is sometimes it misses SMS. Although it is very rare but I require
an efficient and reliable SMS sender.

Another problem is if SMS is more than 159 characters I sends it in two parts.
I have read very much about PDU mode, but is there a reliable way of sending multipart message in text mode so that it appears a single message on the receiver's phone?

Regards,
Jamil.
tlvp
2013-11-01 02:30:08 UTC
Permalink
I have ... a program in C which uses AT commands to send SMS via GSM modem.
... problem is ... if SMS is more than 159 characters I sends it in two parts.
Makes sense. After all, there are plenty of older handsets that simply
won't display more than the first hundred-some-odd characters of an SMS
(hundred sixty, hundred forty four, hundred twenty eight, you can never be
sure in advance, depends on the handset).
I have read very much about PDU mode, but is there a reliable way of sending multipart message in text mode so that it appears a single message on the receiver's phone?
If you can send it as MMS rather than multi-part SMS, any MMS-capable
handset will receive it. But there are still handsets out there that "don't
do MMS", they "only do SMS".
Regards,
Jamil.
HTH, Jamil. Cheers, -- tlvp
--
Avant de repondre, jeter la poubelle, SVP.
DevilsPGD
2013-11-01 04:43:08 UTC
Permalink
Post by tlvp
If you can send it as MMS rather than multi-part SMS, any MMS-capable
handset will receive it. But there are still handsets out there that "don't
do MMS", they "only do SMS".
Plus there may still be legacy plans that bill extra for MMS, while SMS
is free. No carrier has sold these for years though, to my knowledge.
--
The nice thing about standards, there is enough for everyone to have their own.
tlvp
2013-11-02 01:11:08 UTC
Permalink
Post by DevilsPGD
there may still be legacy plans that bill extra for MMS, while SMS
is free.
Well, Page Plus, I believe, charges differently for one MMS vs. for the
various sequences of however-many SMSes it takes to present the same
text-only content. Not saying tho' whether that is or is not "legacy" :-) .

Cheers, -- tlvp
--
Avant de repondre, jeter la poubelle, SVP.
John Henderson
2013-11-02 19:47:34 UTC
Permalink
Post by j***@gmail.com
Hi everybody,
I have written a program in C which uses AT commands to send SMS via GSM modem.
The problem is sometimes it misses SMS. Although it is very rare but I require
an efficient and reliable SMS sender.
How does it miss sending? Are you not waiting for the reference number
to be returned from the AT+CMGS command (and retrying if it isn't
returned)?
Post by j***@gmail.com
Another problem is if SMS is more than 159 characters I sends it in two parts.
More than 160 characters actually.
Post by j***@gmail.com
I have read very much about PDU mode, but is there a reliable way of sending multipart message in text mode so that it appears a single message on the receiver's phone?
Try encoding the multiple UDHs (each suitably padded to a septet
boundary), and present them as part of the text-mode UDs. Don't forget
to set the UDHI bit in the "first octet" using the AT+CSMP command.

John
John Henderson
2013-11-02 20:57:50 UTC
Permalink
Post by John Henderson
Try encoding the multiple UDHs (each suitably padded to a septet
boundary), and present them as part of the text-mode UDs.
I now realize that's not going to work reliably. The encoded UDH may
need to contain characters with values incompatible with their position
within the text, such as <ctrl-Z> or <ESC>.

An alternative (albeit much more primitive) approach to PDU-mode
concatenation is suggested in recent versions of 3GPP 23.040, section
3.8.3. I quote:

"The first message is ended with a + sign, and each subsequent message
start and end with + signs until the final message which starts with a
+ sign but does not end with a + sign."

John
j***@tpg.com.au
2014-02-25 00:17:47 UTC
Permalink
Use to have lots of problem with cell phone At-Command especially using usb2serial cable and now problem free
Check project on https://sites.google.com/site/dmsqfree/
Written in CBuilder.
now using gsm modem instead of cell phone. it is fully controllabled,...

Port open with:
hComHnd=CreateFile(COM5,GENERIC_READ+GENERIC_WRITE,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL+FILE_FLAG_OVERLAPPED,NULL);

setcommstate
get port receive event inside a thread,.. bla bla,...

keep going, cheers
James

Loading...