CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

SMS - array of destination phonenumbers

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
densimitre



Joined: 21 Dec 2004
Posts: 45

View user's profile Send private message

SMS - array of destination phonenumbers
PostPosted: Mon Feb 29, 2016 10:37 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Mar 01, 2016 6:10 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Mar 01, 2016 10:44 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Mar 02, 2016 8:37 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Mar 02, 2016 1:01 pm     Reply with quote

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!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group