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

📄 nmea_glc.c

📁 the example file that can decode the NMEA protocol
💻 C
字号:
#include <stdlib.h>#include <string.h>#include "NMEA_Lib.h"#if (NMEA_INCLUDE_GLC == 1)#include "NMEA_GLC.h"BOOL NMEA_ParseGLCSentence(CHAR * sentence, struct NMEAObject_t * NMEAObject, UINT32 * flags){    UINT32 sentence_index = 3;    BOOL ret_val = NMEA_FAILURE;    if('G' == sentence[0] && 'L' == sentence[1] && 'C' == sentence[2])    {        sentenceToUINT32(sentence, &NMEAObject->GLCObject.GRIMicrosecondsPer10, &sentence_index, NMEA_GLC_GRIMICROSECONDSPER10, flags);        sentenceToPOINT(sentence, &NMEAObject->GLCObject.MasterTOAMicroseconds, &sentence_index, NMEA_GLC_MASTERTOAMICROSECONDS, flags);        sentenceToCHAR(sentence, &NMEAObject->GLCObject.MasterTOASignalStatus, &sentence_index, NMEA_GLC_MASTERTOASIGNALSTATUS, flags);        sentenceToPOINT(sentence, &NMEAObject->GLCObject.TimeDifference1Microseconds, &sentence_index, NMEA_GLC_TIMEDIFFERENCE1MICROSECONDS, flags);        sentenceToCHAR(sentence, &NMEAObject->GLCObject.TimeDifference1SignalStatus, &sentence_index, NMEA_GLC_TIMEDIFFERENCE1SIGNALSTATUS, flags);        sentenceToPOINT(sentence, &NMEAObject->GLCObject.TimeDifference2Microseconds, &sentence_index, NMEA_GLC_TIMEDIFFERENCE2MICROSECONDS, flags);        sentenceToCHAR(sentence, &NMEAObject->GLCObject.TimeDifference2SignalStatus, &sentence_index, NMEA_GLC_TIMEDIFFERENCE2SIGNALSTATUS, flags);        sentenceToPOINT(sentence, &NMEAObject->GLCObject.TimeDifference3Microseconds, &sentence_index, NMEA_GLC_TIMEDIFFERENCE3MICROSECONDS, flags);        sentenceToCHAR(sentence, &NMEAObject->GLCObject.TimeDifference3SignalStatus, &sentence_index, NMEA_GLC_TIMEDIFFERENCE3SIGNALSTATUS, flags);        sentenceToPOINT(sentence, &NMEAObject->GLCObject.TimeDifference4Microseconds, &sentence_index, NMEA_GLC_TIMEDIFFERENCE4MICROSECONDS, flags);        sentenceToCHAR(sentence, &NMEAObject->GLCObject.TimeDifference4SignalStatus, &sentence_index, NMEA_GLC_TIMEDIFFERENCE4SIGNALSTATUS, flags);        sentenceToPOINT(sentence, &NMEAObject->GLCObject.TimeDifference5Microseconds, &sentence_index, NMEA_GLC_TIMEDIFFERENCE5MICROSECONDS, flags);        sentenceToCHAR(sentence, &NMEAObject->GLCObject.TimeDifference5SignalStatus, &sentence_index, NMEA_GLC_TIMEDIFFERENCE5SIGNALSTATUS, flags);    }    return ret_val;}BOOL NMEA_CreateGLCSentence(CHAR * sentence, struct NMEAObject_t * NMEAObject, UINT32 * flags){    UINT32 sentence_index = 3;    BOOL ret_val = NMEA_FAILURE;    sentence[0] = 'G';    sentence[1] = 'L';    sentence[2] = 'C';    sentenceFromUINT32(sentence, &NMEAObject->GLCObject.GRIMicrosecondsPer10, &sentence_index, NMEA_GLC_GRIMICROSECONDSPER10, flags);    sentenceFromPOINT(sentence, &NMEAObject->GLCObject.MasterTOAMicroseconds, &sentence_index, NMEA_GLC_MASTERTOAMICROSECONDS, flags);    sentenceFromCHAR(sentence, &NMEAObject->GLCObject.MasterTOASignalStatus, &sentence_index, NMEA_GLC_MASTERTOASIGNALSTATUS, flags);    sentenceFromPOINT(sentence, &NMEAObject->GLCObject.TimeDifference1Microseconds, &sentence_index, NMEA_GLC_TIMEDIFFERENCE1MICROSECONDS, flags);    sentenceFromCHAR(sentence, &NMEAObject->GLCObject.TimeDifference1SignalStatus, &sentence_index, NMEA_GLC_TIMEDIFFERENCE1SIGNALSTATUS, flags);    sentenceFromPOINT(sentence, &NMEAObject->GLCObject.TimeDifference2Microseconds, &sentence_index, NMEA_GLC_TIMEDIFFERENCE2MICROSECONDS, flags);    sentenceFromCHAR(sentence, &NMEAObject->GLCObject.TimeDifference2SignalStatus, &sentence_index, NMEA_GLC_TIMEDIFFERENCE2SIGNALSTATUS, flags);    sentenceFromPOINT(sentence, &NMEAObject->GLCObject.TimeDifference3Microseconds, &sentence_index, NMEA_GLC_TIMEDIFFERENCE3MICROSECONDS, flags);    sentenceFromCHAR(sentence, &NMEAObject->GLCObject.TimeDifference3SignalStatus, &sentence_index, NMEA_GLC_TIMEDIFFERENCE3SIGNALSTATUS, flags);    sentenceFromPOINT(sentence, &NMEAObject->GLCObject.TimeDifference4Microseconds, &sentence_index, NMEA_GLC_TIMEDIFFERENCE4MICROSECONDS, flags);    sentenceFromCHAR(sentence, &NMEAObject->GLCObject.TimeDifference4SignalStatus, &sentence_index, NMEA_GLC_TIMEDIFFERENCE4SIGNALSTATUS, flags);    sentenceFromPOINT(sentence, &NMEAObject->GLCObject.TimeDifference5Microseconds, &sentence_index, NMEA_GLC_TIMEDIFFERENCE5MICROSECONDS, flags);    sentenceFromCHAR(sentence, &NMEAObject->GLCObject.TimeDifference5SignalStatus, &sentence_index, NMEA_GLC_TIMEDIFFERENCE5SIGNALSTATUS, flags);    return ret_val;}#endif

⌨️ 快捷键说明

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