⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nmea_ztg.c

📁 the example file that can decode the NMEA protocol
💻 C
字号:
#include <stdlib.h>#include <string.h>#include "NMEA_Lib.h"#if (NMEA_INCLUDE_ZTG == 1)#include "NMEA_ZTG.h"BOOL NMEA_ParseZTGSentence(CHAR * sentence, struct NMEAObject_t * NMEAObject, UINT32 * flags){    UINT32 sentence_index = 3;    BOOL ret_val = NMEA_FAILURE;    if('Z' == sentence[0] && 'T' == sentence[1] && 'G' == sentence[2])    {        sentenceToUTC(sentence, &NMEAObject->ZTGObject.UniversalTimeCoordinatedUTC, &sentence_index, NMEA_ZTG_UNIVERSALTIMECOORDINATEDUTC, flags);        sentenceToTIME(sentence, &NMEAObject->ZTGObject.TimeRemaining, &sentence_index, NMEA_ZTG_TIMEREMAINING, flags);        sentenceToWPID(sentence, &NMEAObject->ZTGObject.DestinationWaypointID, &sentence_index, NMEA_ZTG_DESTINATIONWAYPOINTID, flags);    }    return ret_val;}BOOL NMEA_CreateZTGSentence(CHAR * sentence, struct NMEAObject_t * NMEAObject, UINT32 * flags){    UINT32 sentence_index = 3;    BOOL ret_val = NMEA_FAILURE;    sentence[0] = 'Z';    sentence[1] = 'T';    sentence[2] = 'G';    sentenceFromUTC(sentence, &NMEAObject->ZTGObject.UniversalTimeCoordinatedUTC, &sentence_index, NMEA_ZTG_UNIVERSALTIMECOORDINATEDUTC, flags);    sentenceFromTIME(sentence, &NMEAObject->ZTGObject.TimeRemaining, &sentence_index, NMEA_ZTG_TIMEREMAINING, flags);    sentenceFromWPID(sentence, &NMEAObject->ZTGObject.DestinationWaypointID, &sentence_index, NMEA_ZTG_DESTINATIONWAYPOINTID, flags);    return ret_val;}#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -