【求助】用AT指令发送AT+COPS查询运营商状态出错

浅蓝Light_Blue 2013-12-24 09:22:37
如题,我用AT指令发送给短信猫查询卡的运营商状态

我发送SendAT("AT+COPS")给短信猫,返回的是AT+ERROR

但是我的卡没问题没欠费,短信猫信号也正常

可以正常的收发短信,但是差不了运营商状态

而且发送SendAT("AT+CPIN")返回的也是AT+CPINERROR

请大神给检查一下是什么问题啊,下面是SendAT()的代码

        public string SendAT(string ATCom)
{
string str = string.Empty;
//忽略接收缓冲区内容,准备发送
this.sp.DiscardInBuffer();
//注销事件关联,为发送做准备
this.sp.DataReceived -= this.sp_DataReceived;
try
{
this.sp.Write(ATCom + "\r");
}
catch (Exception ex)
{
this.sp.DataReceived += this.sp_DataReceived;
throw ex;
}
try
{
string temp = string.Empty;
while ((temp.Trim() != "OK") && (temp.Trim() != "ERROR"))
{
temp = this.sp.ReadLine();
str += temp;
}
}
catch (Exception ex)
{
throw ex;
}
finally
{
this.sp.DataReceived += this.sp_DataReceived;
}
return str;
}
...全文
1304 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

791

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 其他移动相关
社区管理员
  • 移动开发其他问题社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧