View previous topic :: View next topic |
Author |
Message |
densimitre
Joined: 21 Dec 2004 Posts: 45
|
SMS - array of destination phonenumbers |
Posted: Mon Feb 29, 2016 10:37 pm |
|
|
Hello dear
Sorry for this question, but some time ago I see a great code where a multi dimensional array is used for send sms to many phones (using "for loop" and indexes to the array), but after a search in the forum, I canĀ“t find it.
So, if someone can share the link to the post it will be very nice
Kind regards |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9246 Location: Greensville,Ontario
|
|
Posted: Tue Mar 01, 2016 6:10 am |
|
|
IF it was complete code then look in the 'code library' forum not this 'general discussion' one.
Complete, working code is usually located there. I know there are several 'SMS' related programs there...seems to be very common these days !
Jay |
|
|
ezflyr
Joined: 25 Oct 2010 Posts: 1019 Location: Tewksbury, MA
|
|
Posted: Tue Mar 01, 2016 10:44 am |
|
|
Hi,
I'm not quite sure what you are asking, as this isn't all that complicated? Here are some code snippets that may help you along the way!
Here is how the phone number arrays are defined:
Code: |
//Variable arrays for the phone numbers
int8 RegisteredPhoneNums[3][11];
|
Here is how the message is initiated to the desired phone number:
Code: |
fprintf(ADH8066, "AT+CMGS=\"%s\"\r", RegisteredPhoneNums[RegisteredNumberIndex]); // set MSG phone number to Registered Phone Num
|
Here is how the message content is sent:
Code: |
Case 0: //Send AC Power Restored Msg!
fprintf(ADH8066, "Hangar AC Power Restored ");
break;
|
Here is how the message is actually sent:
Code: |
delay_ms(2000);
fputc(26, ADH8066); //send the msg with a CNTL-Z
|
_________________ John
If it's worth doing, it's worth doing in real hardware! |
|
|
densimitre
Joined: 21 Dec 2004 Posts: 45
|
|
Posted: Wed Mar 02, 2016 8:37 am |
|
|
Hello dear
Yes, it is not difficult to do it, in fact, I'm working on it, with a const char array that holds phone numbers (in 129 or 145 format), and then a loop for send the same message as index is incremented inside the loop.
I used a code based in the proposed one by the PCMProgrammer (real Master !!!)
http://www.ccsinfo.com/forum/viewtopic.php?t=48456&postdays=0&postorder=asc&start=0
I only wanted to see the code solution for a loop to send sms to many numbers...
thank you again
Regards |
|
|
ezflyr
Joined: 25 Oct 2010 Posts: 1019 Location: Tewksbury, MA
|
|
Posted: Wed Mar 02, 2016 1:01 pm |
|
|
Hi,
Wrap the code I've posted in a loop and you're done! _________________ John
If it's worth doing, it's worth doing in real hardware! |
|
|
|