110 lines
4.1 KiB
C
110 lines
4.1 KiB
C
|
#ifdef __cplusplus
|
|||
|
extern "C" {
|
|||
|
#endif
|
|||
|
#ifndef _PARSEDATA_H_
|
|||
|
#define _PARSEDATA_H_
|
|||
|
|
|||
|
#include "pdr_sensor.h"
|
|||
|
|
|||
|
#define NAEA_LAST_TIME 500
|
|||
|
#define IMU_LAST_COUNT 10
|
|||
|
|
|||
|
#define FLOAT_TO_INT 1000000
|
|||
|
|
|||
|
/**************************************************************************
|
|||
|
* Description : NMEA<EFBFBD><EFBFBD><EFBFBD>ݺʹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݽ<EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* : NMEA<EFBFBD><EFBFBD><EFBFBD>ݰ<EFBFBD><EFBFBD><EFBFBD>RMC,GGA,GSA,GSV,<EFBFBD>Լ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD>Ϣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ٶȼƣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
**************************************************************************/
|
|||
|
|
|||
|
char * strtok_ct(char * s, const char * delim);
|
|||
|
|
|||
|
/**************************************************************************
|
|||
|
* Description : <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* Input : pt<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>
|
|||
|
ts<EFBFBD><EFBFBD> <EFBFBD>ֻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ms
|
|||
|
sstp<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͱ<EFBFBD>ʶ<EFBFBD><EFBFBD>
|
|||
|
* Output : imu_p<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ṹ<EFBFBD><EFBFBD>
|
|||
|
**************************************************************************/
|
|||
|
void parseIMU(char* pt, imu *imu_p, double ts, int sstp);
|
|||
|
|
|||
|
/**************************************************************************
|
|||
|
* Description : <EFBFBD><EFBFBD><EFBFBD><EFBFBD>NMEA<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* Input : pt<EFBFBD><EFBFBD> NMEA<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>
|
|||
|
ts<EFBFBD><EFBFBD> <EFBFBD>ֻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ms
|
|||
|
* Output : ln<EFBFBD><EFBFBD> NMEA<EFBFBD><EFBFBD><EFBFBD>ݽṹ<EFBFBD><EFBFBD>
|
|||
|
**************************************************************************/
|
|||
|
void parseNMEA(char* pt, lct_nmea *ln, double ts);
|
|||
|
|
|||
|
/**************************************************************************
|
|||
|
* Description : <EFBFBD><EFBFBD><EFBFBD><EFBFBD>GGAЭ<EFBFBD><EFBFBD>
|
|||
|
* Input : pt<EFBFBD><EFBFBD> NMEA<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>
|
|||
|
ts<EFBFBD><EFBFBD> <EFBFBD>ֻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ms
|
|||
|
* Output : ln<EFBFBD><EFBFBD> NMEA<EFBFBD><EFBFBD><EFBFBD>ݽṹ<EFBFBD><EFBFBD>
|
|||
|
**************************************************************************/
|
|||
|
void parseGGA(char* pt, lct_nmea *ln, double ts);
|
|||
|
|
|||
|
/**************************************************************************
|
|||
|
* Description : <EFBFBD><EFBFBD><EFBFBD><EFBFBD>RMCЭ<EFBFBD><EFBFBD>
|
|||
|
* Input : pt<EFBFBD><EFBFBD> NMEA<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>
|
|||
|
ts<EFBFBD><EFBFBD> <EFBFBD>ֻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ms
|
|||
|
* Output : ln<EFBFBD><EFBFBD> NMEA<EFBFBD><EFBFBD><EFBFBD>ݽṹ<EFBFBD><EFBFBD>
|
|||
|
**************************************************************************/
|
|||
|
void parseRMC(char* pt, lct_nmea *ln, double ts);
|
|||
|
|
|||
|
/**************************************************************************
|
|||
|
* Description : <EFBFBD><EFBFBD><EFBFBD><EFBFBD>GSVЭ<EFBFBD><EFBFBD>
|
|||
|
* Input : pt<EFBFBD><EFBFBD> NMEA<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>
|
|||
|
ts<EFBFBD><EFBFBD> <EFBFBD>ֻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ms
|
|||
|
* Output : ln<EFBFBD><EFBFBD> NMEA<EFBFBD><EFBFBD><EFBFBD>ݽṹ<EFBFBD><EFBFBD>
|
|||
|
**************************************************************************/
|
|||
|
void parseGSV(char* pt, lct_nmea *ln, double ts);
|
|||
|
|
|||
|
/**************************************************************************
|
|||
|
* Description : <EFBFBD><EFBFBD><EFBFBD><EFBFBD>GSAЭ<EFBFBD><EFBFBD>
|
|||
|
* Input : pt<EFBFBD><EFBFBD> NMEA<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>
|
|||
|
ts<EFBFBD><EFBFBD> <EFBFBD>ֻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ms
|
|||
|
* Output : ln<EFBFBD><EFBFBD> NMEA<EFBFBD><EFBFBD><EFBFBD>ݽṹ<EFBFBD><EFBFBD>
|
|||
|
**************************************************************************/
|
|||
|
void parseGSA(char* pt, lct_nmea *ln, double ts);
|
|||
|
|
|||
|
/**----------------------------------------------------------------------
|
|||
|
* Function : parseLocAccuracy
|
|||
|
* Description : <EFBFBD><EFBFBD><EFBFBD><EFBFBD>GPS<EFBFBD><EFBFBD>Accuracy<EFBFBD><EFBFBD><EFBFBD>Ȳ<EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* Date : 2020/7/9 yuanlin@vivo.com &zhanli@vivo.com
|
|||
|
*---------------------------------------------------------------------**/
|
|||
|
void parseLocAccuracy(char* pt, lct_nmea *ln, double ts);
|
|||
|
|
|||
|
/**************************************************************************
|
|||
|
* Description : <EFBFBD><EFBFBD><EFBFBD><EFBFBD>NMEA<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* Input : ln<EFBFBD><EFBFBD> NMEA<EFBFBD><EFBFBD><EFBFBD>ݽṹ<EFBFBD><EFBFBD>
|
|||
|
**************************************************************************/
|
|||
|
void preprocessNMEA(lct_nmea *ln);
|
|||
|
|
|||
|
int pdr_parseLineStr(char* line, imu* imu_p, lct_nmea* ln);
|
|||
|
|
|||
|
/**----------------------------------------------------------------------
|
|||
|
* Function : pdr_hexToDec
|
|||
|
* Description : ʮ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><EFBFBD>Ϊʮ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* Date : 2020/7/9 zhanli@vivo.com
|
|||
|
*---------------------------------------------------------------------**/
|
|||
|
long pdr_hexToDec(char *source);
|
|||
|
|
|||
|
/**----------------------------------------------------------------------
|
|||
|
* Function : pdr_int2Hex
|
|||
|
* Description : ʮ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><EFBFBD>Ϊʮ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* Date : 2020/7/9 yuanlin@vivo.com & zhanli@vivo.com
|
|||
|
*---------------------------------------------------------------------**/
|
|||
|
char * pdr_int2Hex(int a, char *buffer);
|
|||
|
|
|||
|
|
|||
|
/**----------------------------------------------------------------------
|
|||
|
* Function : pdr_getIndexOfSigns
|
|||
|
* Description : <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ch<EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>sign<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* Date : 2020/7/9 yuanlin@vivo.com &zhanli@vivo.com
|
|||
|
*---------------------------------------------------------------------**/
|
|||
|
int pdr_getIndexOfSigns(char ch);
|
|||
|
#endif
|
|||
|
#ifdef __cplusplus
|
|||
|
}
|
|||
|
#endif
|