0

I'm sending this PDU to GSM modem and the modem returns

ERROR at+cmgs=70 0051000C918909414095640008A77E050003C8010106A9062F002006280627063206CC0627062806CC002006AF0630063106480627069806470020062D06A906450020062206460644062706CC0646000D000A064606270645002006A9062706310628063106CC003A0020006500780070006C006F00730069006F006E000D000A003900380035003300300030

My modem is DWM-156(D-Link). This command works for other modems but not for DWM-156

I'm using this class to produce PDU strings:

SMSPDULib.SMS sms = new SMSPDULib.SMS();
sms.MessageEncoding = SMSPDULib.SMS.SMSEncoding.UCS2;  
sms.PhoneNumber = "+98" + to;
sms.Direction = SMSPDULib.SMSDirection.Submited;
sms.Message = text;
sms.ValidityPeriod = new TimeSpan(1, 0, 0, 0);
string[] pdus = sms.ComposeLongSMS();
WriteLintToModem("AT+CMGS=" + pdus[0].Length / 4 + Environment.NewLine);
Peter David Carter
  • 2,548
  • 8
  • 25
  • 44
  • Should the last line be WriteLineToModem and not WriteLintToModem? – hlovdal May 22 '16 at 21:58
  • You should not use `Environment.NewLine` to terminate AT command lines, see [this answer](http://stackoverflow.com/a/33266839/23118) for details. Not sure if this your main problem, but it is definitely wrong and should be fixed. – hlovdal May 22 '16 at 22:05

0 Answers0