Hello,
i am using FEZ COBRA board with 7" LCD hardware
i am getting error in GSM modem communication, i am getting junk values when i read from modem with the help of command "AT+CMGR=1"
it can not read sms from sim card when i attempt first time, after that i am getting proper response of this command
my code is as follows
String Cmd = "AT+CMGR=1\r\n";
Thread.Sleep(1500);
byte[] Buffer = Encoding.UTF8.GetBytes(sendprotocol);
this.serialport.Write(Buffer, 0, Buffer.Length);
int readcount = this.serialport.BytesToRead;
if (readcount <= 0)
{
return "";
}
byte[] rx_byte = new byte[readcount];
rx_byte = new byte[readcount];
readcount = serialport.Read(rx_byte, 0, readcount);
string TempRecData = "";
char[] rechar = new char[readcount];
for (int i = 0; i < rx_byte.Length; i++)
{
Char schar = Convert.ToChar(Convert.ToUInt16(rx_byte[i].ToString()));
rechar[i] = schar;
TempRecData = TempRecData + schar;
}
string RecData = "";
RecData = new string(rechar);
i m doing pin high/low and modem on off at every reading
anyone can give solution ?
code was working before continously from so long