SMART_COMPONENTS_SOCKET/GsmWithGnss.h

72 lines
1.4 KiB
C

//
// Created by cfif on 20.06.2024.
//
#ifndef SMART_COMPONENTS_GSMWITHGNSS_H
#define SMART_COMPONENTS_GSMWITHGNSS_H
#include "cmsis_os2.h"
#include "SerialPortIO.h"
#include "BaseTypes.h"
#include "SocketInterface.h"
#include "AtGsmSimComA7600.h"
#include "LoggerToSerialPort.h"
#include "Nmea0183Parser.h"
#include "SystemMutexCmsis.h"
#include "GsmSocketTimeouts.h"
typedef struct {
uint8_t contextId;
tString32 addr;
uint16_t port;
tString16 portStr;
osMessageQueueId_t rxDataQueue;
eSocketType type;
} tGsmSocketSlot;
#define GSM_SLOTS_COUNT 1
typedef struct {
char status;
tNmeaDateRmc date;
tNmeaTimeRmc time;
} tGsmWithGnssTimeStamp;
typedef struct {
tAtCmd *gsmAt;
tRtcIO *Rtc;
tLoggerToSerialPort *slog;
struct {
SystemMutexCmsis rmcAccess;
tNmeaGga currentGgaRmc;
tNmeaRmc currentRmc;
bool isRMC_Active;
bool isGGA_Active;
tGsmWithGnssTimeStamp gsmWithGnssTimeStamp;
} gnssRmcGga;
uint8_t bufLog[2048];
char bufLogHexString[260];
tGsmSocketSlot slots[256];
tSocketInterface socketIO;
tSerialPortIO srvIo;
bool isNav;
bool isDisconnect;
uint8_t codeResultOpen;
} tGsmWithGnss;
void GsmWithGnssInit(tGsmWithGnss *env);
uint8_t GnssGgaGetSat(tGsmWithGnss *env);
int32_t GnssGgaGetAlt(tGsmWithGnss *env);
void Gnss_GetFullNavData(tGsmWithGnss *env, tNmeaRmc *nmeaRmc);
#endif //SMART_COMPONENTS_GSMWITHGNSS_H