PDA

View Full Version : دریافت پیام delivary با gsmcomm



mohsen4727
پنج شنبه 16 اردیبهشت 1395, 10:39 صبح
سلام من برای دریافت پیغام delivary report در رویداد message recevied کد زیر را نوشتم ولی با پیغام message service error 321 در دستور DecodedShortMessage msg = comm.ReadMessage(loc.Index, loc.Storage) مواجه شدم



private void comm_MessageReceived(object sender, GsmComm.GsmCommunication.MessageReceivedEventArgs e)
{

try
{

IMessageIndicationObject obj = e.IndicationObject;

//Get status report for this condition
if (obj is MemoryLocation)
{
MemoryLocation loc = (MemoryLocation)obj;
Output(string.Format("New message received in storage \"{0}\", index {1}.",
loc.Storage, loc.Index));
Output("");
DecodedShortMessage msg = comm.ReadMessage(loc.Index, loc.Storage);

if (((SmsPdu)msg.Data) is SmsStatusReportPdu)
{
SmsStatusReportPdu data = (SmsStatusReportPdu)msg.Data;
Output("rec msg ref #: " + data.MessageReference);
}
Output(msg.Status.ToString());


}

}

catch (Exception ex)
{
MessageBox.Show(ex.Message);
}

reza_ali202000
پنج شنبه 16 اردیبهشت 1395, 19:35 عصر
سلام دوست عزیز
این خطا مربوط به کمبود و یا مشکل در مموری هست.
ببینید زمان تعریف حافظه کجا رو اشتباه نوشتید.
یه تست هم بکنید برنامه رو ران از ادمین کنید ببینید بازم همینطوره.
ببینید روی مودم دکمه رید اونلی نیس.

mohsen4727
دوشنبه 20 اردیبهشت 1395, 20:32 عصر
خیای ممنون از راهنمایتون
ولی من می خواهم از روی مودم gsm پیغام deleivary را دریافت کنم پیغام delelivary روی حافظه sr bodvi می شود ولی در خط 13 نمی تواند از حافظه sr بخواند علت خطا را نمی دانم