低功耗设计,智能手表之GU620通信处理,其中基站定位功能不错。
用到GU620进行拨话,与短信、GPS、GPRS服务,需要对模块返回来的信息进行处理,
源程序如下:
#include"GU620.h"
#include"stdio.h"
#include"string.h"
#include"usart.h"
#include"ff.h"
#include"includes.h"
#include"rtc.h"
#include"i2c_ee.h"
#include"includes.h"
u8Sim_Battery[4]; //电池
u8Sim_RSSI[3]; //信号强度
u8Sim_Operator = 0; //运营商 1为中国移动
u8GSM_Response[10];
u8RingNumber[20]; //来电号码
u8Messagenum; //保存短信数目
u8Messagebuff[50]; //保存短信状态 0 空 1 未读 2 命令短信 3非命令短信
charADMINISTRATORPHONE[20] = "13729058953";
charIPADDR[20] = "220.170.79.210";
charCOM[6] = "40487";
charPASSWORD[10] = "0000000000";
u8LOCATION[30];
MessagestrMES_STR;
GPSStructGPS_STR;
/*
函数名:GU620_IOConfig
描述: 复位
输入: 无
输出: 无
*/
void GU620_IOConfig(void )
{
GPIO_InitTypeDef GPIO_InitStructure;
RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOA, ENABLE);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOA, &GPIO_InitStructure);
}
void GU620_Reset(void )
{
OS_ERR err;
GPIO_SetBits(GPIOA, GPIO_Pin_1);
OSTimeDlyHMSM( 0, 0, 2, 0, OS_OPT_TIME_HMSM_STRICT,&err);
GPIO_ResetBits(GPIOA, GPIO_Pin_1);
}
/*
函数名:GU620_SendCmd
描述: 发送at命令,并检验是否收到想要的响应
输入: u8 *cmd 要发送的命令
u8 *ack 期待的响应
u16 waittime 等待时间 单位10ms
u8 *pBuff 接收响应的缓存区地址 为NULL则不保存响应数据
输出:
*/
u8 GU620_SendCmd(u8*cmd, u8 *ack, u16 waittime, u8 *pBuff)
{
u8 res = SIM_ERR_OTHER;
u8 *pdata = NULL;
CPU_TS ts;
OS_ERR err;
OS_MSG_SIZE msg_size;
OSMutexPend(&Mutex_USART2, 30000, OS_OPT_PEND_BLOCKING,&ts, &err);
if( (u32)cmd <= 0xff ) //用于发送结束标志 0x1A
{
USART2->DR = (u32)cmd;
}
else
{
printf("%s\r\n", (char *)cmd);
}
if(ack != NULL)
{
strcpy((char*)&GSM_Response[0], (char *)ack);
while(waittime--)
{
//OSSemPend(&Sem_GSMResponse, 10, OS_OPT_PEND_BLOCKING, &ts,&err); //等待信号量
pdata = OSQPend(&Q_GSMResponse, 10, OS_OPT_PEND_BLOCKING, &msg_size,&ts, &err);
if(err == OS_ERR_NONE)
{
if((NULL != pBuff)&&(NULL != pdata))
{
strcpy((char *)pBuff,(char *)pdata);
}
OSMemPut(&MyPartition, pdata, &err);
res = SIM_ERR_NONE;
break;
}
}
if(err != OS_ERR_NONE)
{
res = SIM_ERR_TIMEOUT;
}
}
OSMutexPost(&Mutex_USART2, OS_OPT_POST_NONE, &err);
return res;
}
/*
函数名:GU620_ReadMessage
描述: 读短信
输入: u8 addr 短信位置
u8 mode 1: 英文短信 0:中文短信
输出: 0 发送失败 1 发送成功
*/
u8 GU620_ReadMessage(u8addr, u8 mode)
{
u8 res = SIM_ERR_OTHER;
u8 messageaddr[20];
u8 address[3];
u8 *p1 = NULL;
u8 *p2 = NULL;
if(addr > 50 || addr < 1)
{
return 0;
}
if(addr < 10)
{
address[0] = addr + '0';
address[1] = '\0';
}
else
{
address[0] = addr/10 + '0';
address[1] = addr%10 + '0';
address[2] = '\0';
}
if( mode ) //英文短信
{
u8 databuff[350];
GU620_SendCmd("AT+CMGF=1","OK", 100, NULL);
GU620_SendCmd("AT+CSCS=\"GSM\"","OK", 100, NULL);
sprintf((char *)messageaddr,"AT+CMGR=%s", address);
if(SIM_ERR_NONE == GU620_SendCmd(messageaddr,"+CMGR:", 250, &databuff[0]))
{
p1= (u8 *)strstr((char *)&databuff[0], ",");
p2= (u8 *)strstr((char *)(p1+2), "\"");
p2[0] = '\0'; //添加结束符
strcpy((char *)MES_STR.Phonenum, (char *)(p1+2)); //保存电话号码
p1= (u8 *)strstr((char *)(p2+1), "/");
p2= (u8 *)strstr((char *)(p1), "+");
p2[0] = '\0';
strcpy((char *)MES_STR.Time, (char *)(p1-2)); //保存接收时间
p1= (u8 *)strstr((char *)(p2+1), "\r");
p2= (u8 *)strstr((char *)(p1+1), "\r");
p2[0] = '\0';
strcpy((char *)MES_STR.Message, (char *)(p1+2));
if(SIM_ERR_NONE == GU620_JudgeMessage( &MES_STR ))
{
res = SIM_ERR_NONE;
}
}
}
else //中文短信
{
u8 databuff[350];
u8 number[80];
u8 messtr[256];
GU620_SendCmd("AT+CMGF=1","OK", 100, NULL);
GU620_SendCmd("AT+CSCS=\"UCS2\"","OK", 100, NULL);
sprintf((char *)messageaddr,"AT+CMGR=%s", address);
if(SIM_ERR_NONE == GU620_SendCmd(messageaddr,"+CMGR:", 300, &databuff[0]))
{
p1= (u8 *)strstr((char *)databuff, ",");
p2= (u8 *)strstr((char *)(p1+2), "\"");
p2[0] = '\0'; //添加结束符
GU620_UCS2GBK((char*)number, (char *)(p1+2));
strcpy((char *)MES_STR.Phonenum, (char *)number); //保存电话号码
//LCD_ShowChEnStr(10, 10, MES_STR.Phonenum, RED, 16, 1);
p1= (u8 *)strstr((char *)(p2+1), "/");
p2= (u8 *)strstr((char *)(p1), "+");
p2[0] = '\0';
strcpy((char *)MES_STR.Time, (char *)(p1-2)); //保存接收时间
p1= (u8 *)strstr((char *)(p2+1), "\r");
p2= (u8 *)strstr((char *)(p1+1), "\r");
p2[0] = '\0';
GU620_UCS2GBK((char*)messtr, (char *)(p1+2));
strcpy((char *)MES_STR.Message, (char *)messtr);
//LCD_ShowChEnStr(10, 40, MES_STR.Message, RED, 16, 1);
res = SIM_ERR_NONE;
}
}
return res;
}
/*
函数名:GU620_SendMessage
描述: 发送短信
输入: char *number 要发送的电话号码
char *message 要发送的短信内容
u8 mode 1为英文短信
0为中文短信
输出: 1:发送成功
0:发送失败
*/
u8 GU620_SendMessage(char*number, char *message, u8 mode)
{
char phonenumber[100];
u8 res = SIM_ERR_OTHER;
if( mode ) //英文短信
{
GU620_SendCmd("AT+CMGF=1","OK", 100, NULL);
GU620_SendCmd("AT+CSCS=\"GSM\"","OK", 100, NULL);
sprintf(phonenumber,"AT+CMGS=\"%s\"", number); //合并命令
if(SIM_ERR_NONE == GU620_SendCmd((u8*)phonenumber, ">", 300, NULL))
{
USART_printf(USART2, "%s", message); //发送内容
if(SIM_ERR_NONE == GU620_SendCmd((u8 *)0x1A, "+CMGS:", 1000,NULL))
{
res = SIM_ERR_NONE;
}
}
}
else //中文短信
{
char ucs2buff[256];
GU620_SendCmd("AT+CMGF=1","OK", 100, NULL);
GU620_SendCmd("AT+CSCS=\"UCS2\"","OK", 100, NULL);
GU620_SendCmd("AT+CSMP=17,0,2,25","OK", 100, NULL);
GU620_GBK2UCS(ucs2buff,number);
sprintf(phonenumber,"AT+CMGS=\"%s\"", ucs2buff); //合并命令
if(SIM_ERR_NONE == GU620_SendCmd((u8*)phonenumber, ">", 300, NULL))
{
GU620_GBK2UCS(ucs2buff,message);
USART_printf(USART2, "%s", ucs2buff); //发送内容
if(SIM_ERR_NONE == GU620_SendCmd((u8 *)0x1A, "+CMGS:", 1000,NULL))
{
res = SIM_ERR_NONE;
}
}
}
return res;
}
/*
函数名:GU620_Call
描述: 打电话
输入: u8 * number //电话号码
输出: 0 拨打失败 1 拨打成功
*/
u8 GU620_Call(u8 *number )
{
char phonenum[30];
u8 res = SIM_ERR_OTHER;
sprintf(phonenum, "ATD%s;", number);
if(SIM_ERR_NONE == GU620_SendCmd(( u8 *)phonenum, NULL,500, NULL))
{
res = SIM_ERR_NONE;
}
return res;
}
/*
函数名:GU620_Hangup
描述: 挂电话
输入: 无
输出: 0 操作失败 1 操作成功
*/
u8 GU620_Hangup(void )
{
u8 res = SIM_ERR_OTHER;
if(SIM_ERR_NONE == GU620_SendCmd("ATH","OK", 100, NULL))
{
res = SIM_ERR_NONE;
}
return res;
}
/*
函数名:GU620_AnswerPhone
描述: 接电话
输入: 无
输出:
*/
u8 GU620_AnswerPhone(void )
{
u8 res = SIM_ERR_OTHER;
if(SIM_ERR_NONE == GU620_SendCmd("ATA","OK", 100, NULL))
{
res = SIM_ERR_OTHER;
}
return res;
}
/*
函数名:GU620_DeleteMes
描述: 删除短信
输入: u8 addr 要删除的短信编号 1~50 (实际最大为16)
输出: 0 删除失败 1 删除成功
*/
u8 GU620_DeleteMes(u8addr)
{
u8 address[3];
u8 deletecmd[15];
u8 res = SIM_ERR_OTHER;
if(addr > 50 || addr < 1)
{
return 0;
}
if(addr < 10)
{
address[0] = addr + '0';
address[1] = '\0';
}
else
{
address[0] = addr/10 + '0';
address[1] = addr%10 + '0';
address[2] = '\0';
}
sprintf((char *)deletecmd, "AT+CMGD=%s", (char*)address);
if(SIM_ERR_NONE == GU620_SendCmd(deletecmd,"OK", 100, NULL))
{
res = SIM_ERR_NONE;
}
return res;
}
/*
函数名:GU620_GPSSet
描述: 开关GPS
输入: u8 status 1:开GPS 0:关GPS
输出: 1:操作成功 0:操作失败
*/
u8 GU620_GPSSet(u8 status )
{
u8 res = SIM_ERR_OTHER;
if( status )
{
if(SIM_ERR_NONE == GU620_SendCmd("AT+CGPSPWR=1","OK", 100, NULL))
{
if(SIM_ERR_NONE == GU620_SendCmd("AT+CGPSRST=1", "OK", 100,NULL))
{
res = SIM_ERR_NONE;
}
}
}
else
{
if(SIM_ERR_NONE == GU620_SendCmd("AT+CGPSPWR=0","OK", 100, NULL))
{
res = SIM_ERR_NONE;
}
}
return res;
}
/*
函数名:GU620_TCPConnect
描述: 建立tcp连接
输入: u8 *ipaddr 要连接的ip地址
u8 *com 要连接的端口
输出: 1 连接成功
0 连接失败
*/
u8 GU620_TCPConnect(u8*ipaddr, u8 *com)
{
u8 cmd[50];
OS_ERR err;
u8 res = SIM_ERR_OTHER;
sprintf(cmd,"AT+CIPSTART=\"TCP\",\"%s\",\"%s\"",ipaddr, com);
if(SIM_ERR_NONE != GU620_SendCmd("AT+CGCLASS=\"B\"","OK", 200, NULL))
{
return SIM_ERR_CGCLASS;
}
if(SIM_ERR_NONE != GU620_SendCmd("AT+CGDCONT=1,\"IP\",\"CMNET\"","OK", 200, NULL))
{
return SIM_ERR_CGDCONT;
}
if(SIM_ERR_NONE != GU620_SendCmd("AT+CGATT=1","OK", 200, NULL))
{
return SIM_ERR_CGATT;
}
if(SIM_ERR_NONE != GU620_SendCmd("AT+CIPCSGP=1,\"CMNET\"","OK", 200, NULL))
{
return SIM_ERR_CIPCSGP;
}
if(SIM_ERR_NONE != GU620_SendCmd("AT+CLPORT=\"TCP\",\"2000\"","OK", 200, NULL))
{
return SIM_ERR_CLPORT;
}
if(SIM_ERR_NONE != GU620_SendCmd(cmd, "CONNECTOK", 1000, NULL))
{
return SIM_ERR_CIPSTART;
}
else
{
OSFlagPost(&GPRSFlagGrp,FlagGPRSConnect, OS_OPT_POST_FLAG_SET, &err);
res = SIM_ERR_NONE;
}
return res;
}
/*
函数名:GU620_TCPSendData
描述: 在TCP建立连接成功后 调用此函数发送数据
输入: u8 *data 要发送的数据
输出: 1 发送成功
0 发送失败
*/
u8 GU620_TCPSendData(u8 * data)
{
u8 res = SIM_ERR_NONE;
if(NULL == data)
{
return 0;
}
if(SIM_ERR_NONE == GU620_SendCmd("AT+CIPSEND",">", 1000, NULL))
{
//GU620_SendCmd(data, NULL, 1);
USART_printf(USART2,"%s", data);
if(SIM_ERR_NONE == GU620_SendCmd((u8*)0x1A, "SEND OK", 1000, NULL))
{
res = SIM_ERR_NONE;
}
}
else
{
res = SIM_ERR_CGATT;
}
return res;
}
/*
函数名:GU620_TCPClose
描述: 关闭TCP连接
输入: 无
输出: 1 操作成功
0 操作失败
*/
u8 GU620_TCPClose(void )
{
OS_ERR err;
u8 res = SIM_ERR_OTHER;
GU620_SendCmd("AT+CIPCLOSE=1", "CLOSEOK", 100, NULL);
if(SIM_ERR_NONE == GU620_SendCmd("AT+CIPSHUT","SHUT OK", 100, NULL))
{
//OSFlagPost(&GPRSFlagGrp,FlagGPRSConnect, OS_OPT_POST_FLAG_CLR, &err);
res = SIM_ERR_NONE;
}
return res;
}
/*
函数名:GU620_char2hex
描述: 把字符转换成16进制字符
输入: char ch 字符
输出: 16进制数值
*/
u8 GU620_char2hex(charch)
{
if(ch>='0'&&ch<='9')
{
return ch-'0';
}
else if(ch>='A'&&ch<='F')
{
return (ch-'A'+10);
}
else if(ch>='a'&&ch<='f')
{
return (ch-'a'+10);
}
return 0;
}
/*
函数名:GU620_hex2char
描述: 将一个16进制值转换为对应的字符
输入: u8 hex 16进制值 0~F
输出: 对应的字符
*/
u8 GU620_hex2char(u8hex)
{
if(hex <= 9)
{
return (hex + '0');
}
else if(hex >= 10 && hex <= 15)
{
return (hex - 10 + 'A');
}
return '0';
}
/*
函数名:GU620_GBK2UCS
描述: 将GBK编码转换为UCS编码
输入: char *ucs ucs编码缓冲区指针
char *gbk GBK编码缓冲区指针
输出: 无
*/
void GU620_GBK2UCS(char*ucs, char *gbk)
{
u16 temp;
u8 buff[2];
while(*gbk != 0)
{
if(*gbk < 0x81) //非汉字
{
temp = (u16)ff_convert((WCHAR)*gbk, 1);
gbk++;
}
else //汉字
{
buff[1] = *gbk++;
buff[0] = *gbk++;
temp = (u16)ff_convert((WCHAR)*(u16 *)buff, 1);
}
*ucs++ = GU620_hex2char((temp>> 12)&0x0F);
*ucs++ = GU620_hex2char((temp>> 8)&0x0F);
*ucs++ = GU620_hex2char((temp>> 4)&0x0F);
*ucs++ = GU620_hex2char(temp& 0x0F);
}
*ucs = 0;
}
/*
函数名:GU620_UCS2GBK
描述: unicode码转换为GBK码
输入: char *ucs 保存unicode的缓冲区指针
char *gbk 保存gbk码的缓冲区指针
输出: 无
*/
void GU620_UCS2GBK(char*gbk, char *ucs)
{
u16 temp;
u8 buff[2];
while(*ucs != 0)
{
buff[1] = GU620_char2hex(*ucs++)* 16;
buff[1] += GU620_char2hex(*ucs++);
buff[0] = GU620_char2hex(*ucs++)* 16;
buff[0] += GU620_char2hex(*ucs++);
temp =(u16)ff_convert((WCHAR)*(u16 *)buff, 0);
if(temp < 0x80)
{
*gbk = temp;
gbk++;
}
else
{
*(u16 *)gbk = swap16(temp);
gbk += 2;
}
}
*gbk = 0;
}
/*
函数名:GU620_JudgeMessage
描述: 判断短信内容
输入: u8 *message 保存短信内容的数组指针
输出: 无
*/
u8 GU620_JudgeMessage(Messagestr*mes_str)
{
u8 res = SIM_ERR_OTHER;
if(NULL != strstr((char *)mes_str->Message,"DW"))
{
if(SIM_ERR_NONE == GU620_GetGPSInformation(&GPS_STR,NULL))
{
GU620_GPSConvert(GPS_STR.Latitude,GPS_STR.Longtude, LOCATION);
GU620_SendMessage(ADMINISTRATORPHONE,(char *)LOCATION, 1);
}
res = SIM_ERR_NONE;
}
else if(NULL != strstr((char *)mes_str->Message,"GMM"))
{
u8 *p1 = NULL;
//USART_printf(USART1,"\r\n 修改密码\r\n");
p1 = strstr((char*)mes_str->Phonenum, ADMINISTRATORPHONE);
if(NULL == p1)
{
res = SIM_ERR_MESCMD;
//USART_printf(USART1, "\r\n phonenum is %s \r\n",mes_str->Phonenum);
//USART_printf(USART1, "\r\n ADMINISTRATORPHONE is %s \r\n",ADMINISTRATORPHONE);
GU620_SendMessage((char*)(mes_str->Phonenum), "you are not the administrator", 1);
}
else
{
char mm[30];
u8*p1 = NULL;
u8*p2 = NULL;
p1= strstr((char *)mes_str->Message, "\"");
p2= strstr((char *)(p1+1), "\"");
p2[0] = 0;
strcpy(PASSWORD, (char *)(p1+1));
//USART_printf(USART1, "\r\n new PASSWORD is $%s$ \r\n", PASSWORD);
I2C_EE_BufferWrite(PASSWORD, PASSWORD_FLASH_ADDR, sizeof(PASSWORD));
sprintf(mm, "new password is %s", PASSWORD);
GU620_SendMessage((char*)ADMINISTRATORPHONE, mm, 1);
res = SIM_ERR_NONE;
}
}
else if(NULL != strstr((char *)mes_str->Message,"MM"))
{
u8 *p1 = NULL;
u8 *p2 = NULL;
p1 = strstr((char*)mes_str->Message, "\"");
p2 = strstr((char *)(p1+1),"\"");
p2[0] = 0;
// USART_printf(USART1,"\r\n right is $%s$ \r\n", PASSWORD);
// USART_printf(USART1,"\r\n error is $%s$ \r\n", p1+1);
if(NULL != strstr(PASSWORD,p1+1))
{
// USART_printf(USART1, "\r\n password is right \r\n");
strcpy(ADMINISTRATORPHONE, (char *)mes_str->Phonenum);
I2C_EE_BufferWrite(ADMINISTRATORPHONE, PHONE_FLASH_ADDR,sizeof(ADMINISTRATORPHONE));
GU620_SendMessage(ADMINISTRATORPHONE,"new administrator has builded", 1);
res = SIM_ERR_NONE;
}
else
{
// USART_printf(USART1, "\r\n password is error \r\n");
GU620_SendMessage((char*)(mes_str->Phonenum), "password ERROR", 1);
res = SIM_ERR_MESCMD;
}
}
else if(NULL != strstr((char *)mes_str->Message,"GPRS"))
{
u8 *p1 = NULL;
u8 *p2 = NULL;
p1 = (u8 *)strstr((char*)mes_str->Message, "IP");
if(NULL == p1)
{
// USART_printf(USART1, "\r\n IP eeror \r\n");
res = SIM_ERR_MESCMD;
}
p2 = (u8 *)strstr((char*)mes_str->Message, "COM");
if(NULL == p2)
{
// USART_printf(USART1, "\r\n COM eeror \r\n");
res = SIM_ERR_MESCMD;
}
p1 = (u8 *)strstr((char*)mes_str->Message, "\"");
p2 = (u8 *)strstr((char*)(p1+1), "\"");
GU620_CopyStr((u8 *)IPADDR,p1+1, p2);
p1 = (u8 *)strstr((char*)(p2+1), "\"");
p2 = (u8 *)strstr((char*)(p1+1), "\"");
GU620_CopyStr((u8 *)COM, p1+1,p2);
GU620_TCPClose();
GU620_TCPConnect((u8 *)IPADDR,(u8 *)COM);
res = SIM_ERR_NONE;
}
return res;
}
/*
函数名:GU620_CopyStr
描述: 将指针former和指针later中的内容复制到des源地址
输入: u8 * str 源数组
u8 Ch 指定的元素
u8 * des
输出: 操作成功则返回Ch在str的指针,失败则返回NULL
*/
void GU620_CopyStr(u8*des, u8 *former, u8 *later)
{
if(former > later)
{
return;
}
while(former != later)
{
*des = *former;
former++;
des++;
}
*des = '\0';
}
/*
函数名:GU620_GetGPSInformation
描述: 获取GPS的相关数据
输入: GPSStruct *gpsstruct 保存gps数据的结构体
u8 *str 保存gps数据的数组指针
输出: 1 操作成功 0 操作失败
*/
u8 GU620_GetGPSInformation(GPSStruct*gpsstrucr, u8 *pdatabuff)
{
u8 *p1 = NULL;
u8 *p2 = NULL;
u8 res = SIM_ERR_OTHER;
u8 gpsdatabuff[100];
if(SIM_ERR_NONE == GU620_SendCmd("AT+CGPSSTATUS?","D Fix", 200, NULL))
{
if(SIM_ERR_NONE == GU620_SendCmd("AT+CGPSINF=32",",A,", 200, &gpsdatabuff[0]))
{
if(NULL != pdatabuff)
{
strcpy(pdatabuff, gpsdatabuff);
}
p1= (u8 *)strstr((char *)gpsdatabuff, ",");
p2= (u8 *)strstr((char *)(p1+1), ",");
GU620_CopyStr(gpsstrucr->Time,p1+1, p2);
p1= (u8 *)strstr((char *)(p2+1), ",");
p2= (u8 *)strstr((char *)(p1+1), ",");
GU620_CopyStr(gpsstrucr->Latitude,p1+1, p2+2);
p1= p2 + 3;
p2= (u8 *)strstr((char *)p1, ",");
GU620_CopyStr(gpsstrucr->Longtude,p1, p2+2);
p1= p2 + 3;
p2= (u8 *)strstr((char *)p1, ",");
GU620_CopyStr(gpsstrucr->Speed,p1, p2);
p1= p2 + 1;
p2= (u8 *)strstr((char *)p1, ",");
GU620_CopyStr(gpsstrucr->Direction,p1, p2);
p1= p2 + 1;
p2= (u8 *)strstr((char *)p1, ",");
GU620_CopyStr(gpsstrucr->Data,p1, p2);
res = SIM_ERR_NONE;
}
}
else
{
res = SIM_ERR_GPSNOTFIX;
}
return res;
}
/*
函数名:GU620_GPSConvert
描述: GPS单位转换 GPS读出的数据单位是 (ddmm.mmmm) 要转换为d
输入: u8 *latitude 转换前的纬度
u8 *longtude 转换前的经度
u8 *location 转换后的经纬度信息
输出: 无
*/
void GU620_GPSConvert(u8*latitude, u8 *longtude, u8 *location )
{
u8 *p1 = NULL;
u8 *p2 = NULL;
u32 data = 0;
u8 i = 0;
u8 j = 0;
u8 a = 0;
&nbs