164 lines
3.9 KiB
C
164 lines
3.9 KiB
C
//
|
|
// Created by xemon on 02.09.22.
|
|
//
|
|
|
|
#ifndef GNSSTELITLE910_GNSSTELITLE910_H
|
|
#define GNSSTELITLE910_GNSSTELITLE910_H
|
|
|
|
#include "NmeaACPParser.h"
|
|
#include "SerialPortIO.h"
|
|
#include "AtGsmTelitLe910.h"
|
|
#include "EraGlonassUveos.h"
|
|
#include "LoggerInterface.h"
|
|
#include "BaseTypes.h"
|
|
#include <AudioPlayerInterface.h>
|
|
#include <AudioRecorderInterface.h>
|
|
#include "ControllableSwitch.h"
|
|
#include "RtcIO.h"
|
|
#include "Nmea0183Parser.h"
|
|
|
|
#include "LoggerToSerialPort.h"
|
|
#include "SocketInterface.h"
|
|
#include "GsmSocketTimeouts.h"
|
|
#include "Gsm_SockInt.h"
|
|
#include "CmsisRtosThreadUtils.h"
|
|
|
|
typedef struct {
|
|
|
|
tAtCmd gsmAt;
|
|
tNavDataProvider navDataProvider;
|
|
tEraGlonassEcallProvider ecallProvider;
|
|
tEraGlonassSmsProvider smsProvider;
|
|
tLoggerInterface *logger;
|
|
tString32 *smsCenter;
|
|
tRtcIO *Rtc;
|
|
|
|
tAudioPlayerInterface audioPlayer;
|
|
tAudioRecorderInterface audioRecorder;
|
|
|
|
tControllableSwitch useInternalAntennaSwitch;
|
|
tControllableSwitch enableNetworkSwitch;
|
|
bool *enableGnssUpdate;
|
|
|
|
struct {
|
|
bool msdSuccess;
|
|
bool msdPull;
|
|
bool ring;
|
|
} urc;
|
|
|
|
struct {
|
|
uint32_t next;
|
|
uint16_t *dataRateHz;
|
|
bool success;
|
|
tNmeaRmc currentRmc;
|
|
tNmeaRmc prevRmc;
|
|
|
|
tNmeaAcp currentAcp;
|
|
|
|
} gnss;
|
|
|
|
struct {
|
|
uint8_t gsmRx[512];
|
|
uint8_t gsmTx[512];
|
|
} mem;
|
|
|
|
bool isBusy;
|
|
|
|
bool isNav;
|
|
|
|
|
|
#ifdef UVEOS_ADD_TELEMATICA
|
|
|
|
tLoggerToSerialPort *slog;
|
|
|
|
struct {
|
|
osMutexId_t rmcAccess;
|
|
// tNmeaGga currentGgaRmc;
|
|
tNmeaRmc currentRmc;
|
|
} gnssRmcGga;
|
|
|
|
bool isDisconnect;
|
|
uint8_t codeResultOpen;
|
|
tSocketGsm socketGsm;
|
|
|
|
bool isRtcACP;
|
|
|
|
#endif
|
|
|
|
} tGsmWithGnss;
|
|
|
|
//Common
|
|
void GsmWithGnssInit(
|
|
tGsmWithGnss *env,
|
|
tSerialPortIO *gsmIo,
|
|
tString32 *smsCenter,
|
|
uint16_t *gnssDataRateHz,
|
|
tRtcIO *Rtc,
|
|
bool *enableGnssUpdate,
|
|
bool isBusy
|
|
);
|
|
|
|
bool GsmWithGnss_GetBusyState(tGsmWithGnss *env);
|
|
|
|
bool GsmWithGnssWaitStartup(tGsmWithGnss *env);
|
|
|
|
bool GsmWithGnss_InvalidateNetworkEnable(tGsmWithGnss *env, uint32_t currentState, bool targetState);
|
|
|
|
void GsmWithGnss_SetNetworkRegistration(tGsmWithGnss *env, bool value);
|
|
|
|
bool GsmWithGnss_WaitNetworkRegistration(tGsmWithGnss *env, uint32_t timeReg);
|
|
|
|
void GsmWithGnss_UseInternalAntenna(tGsmWithGnss *env, bool value);
|
|
|
|
//Gnss ops
|
|
AtCommandResult GsmWithGnssInitGnss(tGsmWithGnss *env);
|
|
|
|
void GsmWithGnss_GetNevData(tGsmWithGnss *env, uint32_t timeout);
|
|
|
|
void AtGsm_Gsnss_GetNMEA_Pack(tGsmWithGnss *env, uint32_t timeout);
|
|
|
|
void AtGsm_Gsnss_NavData_Processing(tGsmWithGnss *env);
|
|
|
|
AtCommandResult GsmWithGnss_GetCCID(tAtCmd *env, char *ccidString, size_t *acpStringLen);
|
|
|
|
AtCommandResult GsmWithGnss_GetCGSN(tAtCmd *env, char *acpString, size_t *acpStringLen);
|
|
|
|
AtCommandResult GsmWithGnss_StopRMCThread(tAtCmd *env);
|
|
|
|
AtCommandResult GsmWithGnss_StartRMCThread(tAtCmd *env);
|
|
|
|
AtCommandResult GsmWithGnss_SelectStandartNetwork(tAtCmd *env, uint8_t standatr);
|
|
|
|
AtCommandResult GsmWithGnss_ActivateRMCPort(tAtCmd *env);
|
|
|
|
void GsmWithGnssHoldStart(tGsmWithGnss *env, uint32_t timeOut);
|
|
|
|
bool GsmWithGnss_IsGnssReady(tGsmWithGnss *env);
|
|
|
|
//Audio ops
|
|
void GsmWithGnss_InitAudio(tGsmWithGnss *env);
|
|
|
|
//Ring ops
|
|
bool GsmWithGnss_IsRing(tGsmWithGnss *env);
|
|
|
|
//Ring reset
|
|
void GsmWithGnss_ResetRing(tGsmWithGnss *env);
|
|
|
|
bool GsmWithGnss_isOutCallActive(tGsmWithGnss *env);
|
|
|
|
bool GsmWithGnss_isInpCallActive(tGsmWithGnss *env);
|
|
|
|
void Gsm_WaitGsmBoot(tGsmWithGnss *env);
|
|
|
|
void AtGsm_Gsnss_NavData_Incorrect(tGsmWithGnss *env);
|
|
|
|
void AtGsm_Gsnss_GetLastActualNavData(tGsmWithGnss *env, EraGlonassUveosNavData *location, bool locSourse);
|
|
|
|
AtCommandResult GsmWithGnss_NetworkReconnect(tAtCmd *env, uint8_t cuontReg);
|
|
|
|
AtCommandResult GsmWithGnss_NetworkEnableInnaterups(tGsmWithGnss *env, uint8_t cuontReg, uint32_t timeOut);
|
|
|
|
void Gnss_GetFullNavData(tGsmWithGnss *env, tNmeaRmc *nmeaRmc);
|
|
|
|
#endif //GNSSTELITLE910_GNSSTELITLE910_H
|