找回密码
 注册
搜索
查看: 1042|回复: 0

[讨论] 请各位高手指点关于AT命令的书写方法

[复制链接]
发表于 2006-10-27 20:07:50 | 显示全部楼层 |阅读模式
我现在在做的是让两台手机通过AT命令让A机控制、操作B机。
出现的问题是:从A机发给B机的AT命令只响应了两次,其他时间都不响应,因此,请问是否是我输出的AT命令的书写格式不正确?
前提:1、通过超级终端,手机响应AT命令都是正常的。(从电脑——》A机 ——》B机,B机响应AT命令也是正常的,说明硬件连接正确)。
          2、让A机发送字符串给B机,在B机上显示要传输的字符串,显示结果也是正确的,这说明串口参数配置没问题。
         3、我现在尝试了以下几种操作,都不行,请帮看下,并指点。谢谢!
kal_uint8  ATCommand_ATD[64]="ATD112;";  //打紧急电话
kal_uint8  ATCommand_ATH[40]="ATH0";  //打紧急电话
kal_uint8  ATCommand_0D[32]="0x0D";
kal_uint8  ATCommand_0A[32]="0x0A";
kal_uint8  ATCommand_ATD_ARRAY[64] = {"41,54,44,31,31,32,3B"};
kal_uint8  ATCommand_0D_ARRAY[4]={"0x0D"};
kal_uint8  ATCommand_0A_ARRAY[4]={"0x0A"};
kal_uint8  ATCommand_A[24]="41";
kal_uint8  ATCommand_T[24]="54";
kal_uint8  ATCommand_D[24]="44";
kal_uint8  ATCommand_1[24]="31";
kal_uint8  ATCommand_2[24]="32";
kal_uint8  ATCommand_FH[24]="3B";
kal_uint8  ATCommand_ATD_Simple[7]={"ATD112;"};  //打紧急电话


void AT_Delay(time)
{
kal_uint16 i ,j ;

for( i = 0 ; i < time ;i ++)
{
  j = 0;
}
}
方法一
void Mmi_ATCommand_ATD(void)
{
rmmi_write_to_uart( ATCommand_ATD,  64, KAL_TRUE);
rmmi_write_to_uart( ATCommand_0D,  32, KAL_TRUE);
rmmi_write_to_uart( ATCommand_0A,  32, KAL_TRUE);}
方法二
void Mmi_ATCommand_ATD_Simple(void)
{
  rmmi_write_to_uart( ATCommand_ATD_Simple,  7, KAL_TRUE);
rmmi_write_to_uart( ATCommand_0D_ARRAY, 4, KAL_TRUE);
rmmi_write_to_uart( ATCommand_0A_ARRAY, 4, KAL_TRUE); }
方法三
void Mmi_ATCommand_ATD_CR_DIGTAL(void)
{
rmmi_write_to_uart( ATCommand_ATD,  64, KAL_TRUE);
rmmi_write_to_uart( ATCommand_0D_ARRAY,  4, KAL_TRUE);
rmmi_write_to_uart( ATCommand_0A_ARRAY,  4, KAL_TRUE);
}
方法四
void Mmi_ATCommand_ATD_ARRAY(void)
{
rmmi_write_to_uart( ATCommand_ATD_ARRAY,  64, KAL_TRUE);
rmmi_write_to_uart( ATCommand_0D,  32, KAL_TRUE);
rmmi_write_to_uart( ATCommand_0A,  32, KAL_TRUE);
}
方法五
void Mmi_ATCommand_ATD_DIGTAL(void)
{
  rmmi_write_to_uart( ATCommand_A,  24, KAL_TRUE);
rmmi_write_to_uart( ATCommand_T,  24, KAL_TRUE);
rmmi_write_to_uart( ATCommand_D,  24, KAL_TRUE);
rmmi_write_to_uart( ATCommand_1,  24, KAL_TRUE);
rmmi_write_to_uart(ATCommand_1,  24, KAL_TRUE);
rmmi_write_to_uart( ATCommand_2,  24, KAL_TRUE);
rmmi_write_to_uart( ATCommand_FH,  24, KAL_TRUE);
rmmi_write_to_uart( ATCommand_0D,  24, KAL_TRUE);
rmmi_write_to_uart( ATCommand_0A,  24, KAL_TRUE);
}
方法六
void Mmi_ATCommand_ATD_DIGTAL_CR_DIGTAL(void)
{
rmmi_write_to_uart( ATCommand_A,  24, KAL_TRUE);
rmmi_write_to_uart( ATCommand_T,  24, KAL_TRUE);
rmmi_write_to_uart( ATCommand_D,  24, KAL_TRUE);
rmmi_write_to_uart( ATCommand_1,  24, KAL_TRUE);
rmmi_write_to_uart(ATCommand_1,  24, KAL_TRUE);
rmmi_write_to_uart( ATCommand_2,  24, KAL_TRUE);
rmmi_write_to_uart( ATCommand_FH,  24, KAL_TRUE);
rmmi_write_to_uart( ATCommand_0D,  24, KAL_TRUE);
rmmi_write_to_uart( ATCommand_0A,  24, KAL_TRUE);

rmmi_write_to_uart( ATCommand_0D_ARRAY,  4, KAL_TRUE);
rmmi_write_to_uart( ATCommand_0A_ARRAY,  4, KAL_TRUE);
}
高级模式
B Color Image Link Quote Code Smilies

本版积分规则

Archiver|手机版|小黑屋|52RD我爱研发网 ( 沪ICP备2022007804号-2 )

GMT+8, 2024-12-23 23:02 , Processed in 0.062587 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表