PDR/1.Software/PDR 1.0/include/parseData.h

110 lines
4.1 KiB
C
Raw Normal View History

2022-09-15 16:35:25 +08:00
#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 &logzhan
*---------------------------------------------------------------------**/
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 : HexToDec
* Description : ʮ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD><EFBFBD>Ϊʮ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* Date : 2022-09-15 logzhan
*---------------------------------------------------------------------**/
long 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 & logzhan
*---------------------------------------------------------------------**/
char * 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 &logzhan
*---------------------------------------------------------------------**/
int pdr_getIndexOfSigns(char ch);
#endif
#ifdef __cplusplus
}
#endif