I use the ComPort component to send SMS messages through a modem, the problem is that sometimes I get sms, sometimes sometimes I donβt get the at command in the text of the text message.
Here is my code:
procedure SendSmsCosmote(numar,text : string); const buf : Byte = 26; begin Form1.ComPort1.WriteStr('AT+CMGF=1'+#13#10); Form1.ComPort1.WriteStr('AT+CMGS="'+ numar + '"'+#13); Form1.ComPort1.WriteStr(text); Form1.ComPort1.Write(buf,1); end;
What am I doing wrong? And why, when I read from the modem, do I get what I sent on the tx line?
source share