串口直接打印数据可以UartPrintf(Save_Data.longitude);可以输出模块的经纬度,但是使用子函数
void Second_AT_Command(u8 *b,u8 *a,u8 wait_time)
{
u8 i;
u8 *c;
c = b; //保存字符串地址到c
CLR_Buf2();
i = 0;
while(i == 0)
{
if(!Find(a))
{
if(Timer0_start == 0)
{
b = c; //将字符串地址给b
for (b; *b!='\0';b++)
{
UART2_SendData(*b);
}
UART2_SendLR();
Times = 0;
shijian = wait_time;
Timer0_start = 1;
}
}
else
{
i = 1;
Timer0_start = 0;
}
}
CLR_Buf2();
}发送到GSM模块不能发送请大神指导一下
通过 strncpy (str,Save_Data.longitude,12);
strcat (str,"A");
strcat (str,Save_Data.latitude);
strcat (str,"\32\0");
UartPrintf(str);拼接的字段然后发送的Second_AT_Command(str,"SEND OK",8);
|