/* ======================================== * * Copyright YOUR COMPANY, THE YEAR * All Rights Reserved * UNPUBLISHED, LICENSED SOFTWARE. * * CONFIDENTIAL AND PROPRIETARY INFORMATION * WHICH IS THE PROPERTY OF your company. * * ========================================*/#include <project.h>#include<cypins.h>#include<string.h>void system_init(void);void trans(char[],int);void delay(uint32);void ring(void);char AT_check[]="AT\r";char ok[]="OK";char rec[]="";int main(){
CyGlobalIntEnable;/* Place your initialization/startup code here (e.g. MyInst_Start()) *//* CyGlobalIntEnable; *//* Uncomment this line to enable global interrupts. */for(;;){
system_init();//trans(AT_check,3);//puts(AT_check);
UART_PutString("A");int i=0;while((rec[i]= UART_ReadRxData())!='\0'){
i++;}//gets(rec);
LCD_PrintString("Checking");
delay(2000);
LCD_PrintString(rec);
delay(2000);
LCD_ClearDisplay();if(strcmp( ok , rec )||strcmp("\r", rec)){
LCD_Position(0,0);
LCD_PrintString("GSM not Connected");
delay(2000);
LCD_ClearDisplay();}else{
LCD_Position(0,0);
LCD_PrintString("GSM Connected");
delay(2000);
LCD_ClearDisplay();}/* Place your application code here. */}//ring();}void system_init(){
UART_Start();
LCD_Start();
LCD_PrintString("Hii");
delay(2000);
LCD_ClearDisplay();}void trans(char tx[],int n){int i;for(i=0; i<n; i++){
UART_WriteTxData(tx[i]);
delay(2000);}}void delay(uint32 d){uint32 i,j;for(i=1; i<=d; i++){for(j=1;j<=i;j++);}}/*void ring(){ int i=0; while( (rec[i] = UART_GetChar())!='\0') { i++; } LCD_PrintString(rec);}*//* [] END OF FILE */
i have copied string.h in directory and used in code.....