PDR/1.Software/PDR 1.04/include/ParseData.h

110 lines
4.1 KiB
C
Raw Permalink Normal View History

2022-10-07 23:49:43 +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_t *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, Nmea_t *ln, double ts);
2022-10-07 23:49:43 +08:00
/**************************************************************************
* 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, Nmea_t *ln, double ts);
2022-10-07 23:49:43 +08:00
/**************************************************************************
* 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, Nmea_t *ln, double ts);
2022-10-07 23:49:43 +08:00
/**************************************************************************
* 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, Nmea_t *ln, double ts);
2022-10-07 23:49:43 +08:00
/**************************************************************************
* 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, Nmea_t *ln, double ts);
2022-10-07 23:49:43 +08:00
/**----------------------------------------------------------------------
* 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, Nmea_t *ln, double ts);
2022-10-07 23:49:43 +08:00
/**************************************************************************
* 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(Nmea_t *ln);
2022-10-07 23:49:43 +08:00
int ParseLineStr(char* line, IMU_t* imu_p, Nmea_t* ln);
2022-10-07 23:49:43 +08:00
/**----------------------------------------------------------------------
* 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