15,893,663 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by pmk_1969 (Top 11 by date)
pmk_1969
11-Apr-11 11:40am
View
Hi Cpallini,
I solved the problem. Thanks to you for the help provided.
pmk_1969
11-Apr-11 11:39am
View
I can't able to differentiate C++ from C. Because I am new to C and C++. It works well on PIC Compiler(HI-TECH C PRO Compiler / MPLAB IDE v8.63). Thanks a lot once again.
pmk_1969
9-Apr-11 13:17pm
View
thanks Albert Holguin.
I solved the problem. As you told, I started to check GSM_DATA step by step. I located the problem. I declared variable i as global variable. I removed that and declare inside for loop.
That is, problem is here:
for(i = start;i < stop; i++){
Just I modified as follows:
for(int i = start;i < stop; i++){
Now, Everything works fine.
Thanks once again Mr.Albert Holguin
pmk_1969
9-Apr-11 10:46am
View
I have checked GSM_DATA output. correct data received. It works fine if i did not do anything other than just display the result. But if I start validate the GSM_DATA then only onetime validation done and simply sits. I have to restart the device to process next command. I don't know why?
The following code works fine:
void showGSM_DATA(char GSM_DATA[]){ //to show the GSM OUTPUT after eliminating the chars '\r' and '\n'
if (strcmp(GSM_DATA, "OK") == 0){
OK = 1;
if (strcmp(NextCmd, "CMGF") == 0){
strcpy(NextCmd, "CLIP");
puts("AT+CMGF=1");
putch(0X0D);
}
if (strcmp(NextCmd, "CLIP") == 0){
*NextCmd = 0;
puts("AT+CLIP=1");
putch(0X0D);
}
return;
}
if (strcmp(GSM_DATA, "ERROR") == 0){
Error = 1;
*GSM_DATA = 0;
return;
}
if(strlen(GSM_DATA) > 6){
lcd_clear();
lcd_goto(0);
lcd_puts(GSM_DATA);
}
*GSM_DATA = 0;
return;
} // end function showGSM_DATA
But following code executes only one time and sits.
(Just only I added substring function):
void substring(size_t start, size_t stop, char src[]){
int j = 0;
if (start >= stop){
return;
}
for(i = start;i < stop; i++){
substringOfInput[j] = src[i];
j++;
}
substringOfInput[j] = '\x00';
lcd_clear();
lcd_goto(0);
lcd_puts(substringOfInput);
*src=0;
*substringOfInput=0;
j=0;
return;
}
if(strlen(GSM_DATA) > 6){
substring(0,5,GSM_DATA);
//lcd_clear();
//lcd_goto(0);
//lcd_puts(GSM_DATA);
}
pmk_1969
8-Apr-11 8:36am
View
Hi Cpallini,
I have changed the code as follows to limit the chars. But still the same result.
default: // if characters received
if (i < 13){
gsmInput[i] = input;
i++;
}
break;
pmk_1969
8-Apr-11 5:12am
View
thanks. I am inexperienced for forum. Once again thanks.
pmk_1969
29-Jan-11 10:11am
View
OK. I will try. Thanks.
pmk_1969
14-Jan-11 11:56am
View
Ok. Why I posted this entire code here is that the code can help everyone who requires code in C to access GSM Modem. I searched lot and get tired till date, I could not able to find any useful information yet. Thats why I posted all the contents. Sorry, next time I can post specific code.
pmk_1969
14-Jan-11 11:53am
View
ok. Thanks. can you please give me some sample piece of code how to move IO to a separate thread.
pmk_1969
14-Jan-11 11:49am
View
I started learning synchronization. Thanks for your advice
pmk_1969
14-Jan-11 11:48am
View
John Simmons / outlaw,
I tried the method. But no result
Show More