Direct base class for Tezzeret applications. Includes the main event queue, general command logic, and support for some of the basic event types and sources, in particular Geometrics::GmAppEvent.
More...
#include <GmLoggingApp.hpp>
|
| | GmLoggingApp (Semaphore_Handle shCommandAvailable, Semaphore_Handle shCommandQueueAvailable, Semaphore_Handle appEventsAvailable, GmLoggingAppState *loggingAppState) |
| | Constructor, called only in the context of the constructor for the final application class. More...
|
| |
|
virtual int | Initialize () |
| |
|
void | MainLoop () |
| |
|
int | SetupAppQueues () |
| |
|
void | DequeueCommands () |
| |
|
int | QueueCommand (UInt32 iCommand, UInt8 commandSource, UInt8 *pui8AddedInfo, UInt32 uiAddedInfoSize) |
| |
|
int | HandleMqttSynchCommand (int messageId, char *strTmp) |
| |
|
virtual UInt32 | ProcessCommand (UInt32 iCommand, UInt8 commandSource, UInt8 *pui8AddedInfo, UInt32 uiAddedInfoSize) |
| |
|
int | ListSurveys (GmSessionNames *psnSessions) |
| |
|
int | SetHostSyncTimes (int64_t hostTimeInMilliseconds, int64_t thisTimeInMilliseconds) |
| |
|
Bool | LogToFile () |
| |
|
Bool | LogToSerial () |
| |
|
double | OnPps (Seconds_Time *timestamp) |
| |
|
int | SetApproximateTimeInfo (double dSeconds) |
| |
|
virtual GmLoggingAppState * | GetLoggingAppState ()=0 |
| |
|
CGmAppConfig * | GetConfigInfo () |
| |
|
GmRingBufferFileStorage * | GetStorage () |
| |
|
int | StartLogAnnotation () |
| |
|
void | EndLogAnnotation () |
| |
|
int | LogUnindexedAppEvent (GmAppEvent *appEvent, const char *strTextData, int loggingMode) |
| |
|
Int | RequestDeleteSegment (const int messageId, char *commandJson) |
| |
|
Int | MarkTarget (const int messageId, char *commandJson) |
| |
|
Int | RequestSynch (const int messageId) |
| |
|
int | SelectAcquisition (const int messageId, char *commandJson) |
| |
|
int | SendMqttOKMessage (const int messageId) |
| |
|
int | SendMqttSynchResponseMessage (const int messageId, const char *message) |
| |
|
int | MqttSendDataFileSynch (const int messageId, char *commandJson) |
| |
|
struct _GeoMachineProvisioning * | GetBasicProvisioning () |
| |
|
int | AddEvent (UInt32 uiEventCode, UInt32 uiEventInfo, UInt32 uiDataLength, char *caData) |
| |
|
|
Bool | m_bPendingSecondRecord |
| |
|
int | m_iPendingMode |
| |
|
double | m_dTimeAtNextSecond |
| |
|
int64_t | mHostTimeAtSyncInMilliseconds |
| |
|
int64_t | mThisTimeAtSyncInMilliseconds |
| |
|
bool | mHostTimeSynced |
| |
|
CTivaGpsUartSensor * | mGps |
| |
|
GmMqttPublisher * | mMqttPublisher |
| |
|
CGmMqttConfig * | m_pcmmMqttParams |
| |
|
|
static GmLoggingApp * | m_static_plaTheSingleApp = NULL |
| |
|
static char | s_ApplicationName [MAX_APPLICATION_NAME_LN+1] |
| |
|
static char | s_ApplicationVersionString [MAX_APPLICATION_VERSION_STRING_LN+1] |
| |
|
static char | s_MachineSerialNumber [MAX_APPLICATION_MACHINE_SERIAL_NUMBER_STRING_LN+1] |
| |
|
|
UInt32 | StartLogging () |
| |
|
UInt32 | StopLogging () |
| |
|
UInt32 | SetFileLogging (Bool bSet) |
| |
|
UInt32 | SetMqttLogging (Bool bSet) |
| |
|
UInt32 | SetTextMode () |
| |
|
UInt32 | SetBinaryMode () |
| |
|
uint32_t | DisconnectKeepLogging () |
| |
|
uint32_t | ReconnectKeepLogging () |
| |
|
virtual UInt32 | CheckCommandContext (UInt32 iCommand) |
| | When a command is presented to the application, the application needs to check whether the event is legal in the current context. This is a guard-rail function: the application shouldn't create events that don't make sense in a particular context, but Tezzeret is a distributed application, running in at least 2 different devices at one time (the embedded device and a separate UI device such as a tablet or browser), and sometimes things get out of sync.
|
| |
|
virtual UInt32 | FlushInputQueue ()=0 |
| |
|
int | PrepLogSession () |
| |
|
int | StartSerialPort (int iUartPortEnum) |
| |
|
void | StopLogSession () |
| |
|
int | SetupSDStorage (int iSpiEnum, UInt32 uiBitRate) |
| |
|
int | SetupUsbStorage (int iUsbEnum) |
| |
| int | AddStorageSensorMode (int iStorageMode, GmEventSource *pSensor, GmStorage *pStorage, UInt32 iFormat, UInt32 iTopic, UInt32 iDownsampleRate, UInt32 iOtherInfo) |
| | AddStorageSensorMode : Record the system's intention to handle (usuall to store or send) event and sensor information when in a particular mode. More...
|
| |
|
SensorStorageModeInfo * | GetModeSensorLoggingInfo (GmEventSource *psSensor, int iStorageMode) |
| |
|
int | WriteSensorToStorageList (GmEventSource *psSensor, SensorStorageModeInfo ssmiStorageList[], char *pData, UInt32 iSize) |
| |
|
int | WriteSensorToStorageList (GmEventSource *psSensor, SensorStorageModeInfo ssmiStorageList[], char *pData, UInt32 iSize, std::function< Bool(SensorStorageModeInfo *pInfo)> storageFilter) |
| |
|
void | SetSensorId (GmEventSource *psSensor) |
| |
|
|
GmLoggingAppState * | mLoggingAppState = nullptr |
| | State information about the application at this level (Geometrics::GmLoggingApp); This state is normally part of a derived application state that also includes state about the final application.
|
| |
|
GmStorage * | mSurveyStorage |
| | At any particular time, the application has no more than one main local storage, into which survey data is being stored.
|
| |
|
GmPpsEventSensor * | mPpsEvents |
| |
|
GmAppEventSource * | mAppEvents |
| | Every application include AppEvents, which can include such generic functionality as start/stop, as well as any other events that are useful to the application.
|
| |
|
CTivaUartOut * | m_uoUartOut |
| |
|
CRingBuffer * | mCommandQueue |
| |
|
GmManagedArrayRingBuffer< uint8_t, GM_SIZE_OF_APP_DATA_QUEUE > * | mMainEventQueue |
| | This is the queue through which almost all events and data in a Tezzeret application pass. When a sensor reads a datum, it places its ID (the sensor's ID) into this queue, from which it is eventually read and handled by the application.
|
| |
|
CGmAppConfig * | m_cfgAppSetup |
| |
|
struct _GeoMachineProvisioning | m_basicProvisioning |
| |
|
Semaphore_Handle | m_shCommandAvailable |
| |
|
Semaphore_Handle | m_shCommandQueueAvailable |
| |
|
Semaphore_Handle | mAppEventsAvailable |
| |
|
int | m_iCountSensorIds |
| |
|
| static SensorStorageModeInfo | mStorageModeInfo [GEO_MAX_APP_STORAGE_MODES][GEO_MAX_APP_SENSORS][GEO_MAX_APP_STORAGES] |
| | A list of storages x sensors x modes. "Mode" is an application-specific state; Tezzeret isn't really designed as a state machine, but if it were then mode would be the state. Various modes encapsulate such ideas as "dormant mode", "log everything mode", "monitor mode", etc. More...
|
| |
|
|
static char * | GetApplicationName () |
| |
|
static Bool | GetApplicationShortName (char *buffer, int bufferSize) |
| |
|
static Bool | GetApplicationLongName (char *buffer, int bufferSize) |
| |
|
static Bool | GetApplicationVersionString (char *buffer, int bufferSize) |
| |
|
static Bool | GetMachineSerialNumber (char *buffer, int bufferSize) |
| |
|
static Bool | CompareVersionStrings (char *nameOne, char *nameTwo) |
| |
Direct base class for Tezzeret applications. Includes the main event queue, general command logic, and support for some of the basic event types and sources, in particular Geometrics::GmAppEvent.
◆ GmLoggingApp()
| GmLoggingApp::GmLoggingApp |
( |
Semaphore_Handle |
shCommandAvailable, |
|
|
Semaphore_Handle |
shCommandQueueAvailable, |
|
|
Semaphore_Handle |
appEventsAvailable, |
|
|
GmLoggingAppState * |
loggingAppState |
|
) |
| |
Constructor, called only in the context of the constructor for the final application class.
- Parameters
-
| semaphores | Various semaphores; see sources for synchronizing queues |
| loggingAppState | The final application class has a state object that's derived from GmLoggingAppState. That object exists in the main object, but not here, so it needs to be passed in from the final object. It's OK to do it in this context. |
◆ AddStorageSensorMode()
| int GmLoggingApp::AddStorageSensorMode |
( |
int |
iStorageMode, |
|
|
GmEventSource * |
pSensor, |
|
|
GmStorage * |
pStorage, |
|
|
UInt32 |
iFormat, |
|
|
UInt32 |
iTopic, |
|
|
UInt32 |
iDownsampleRate, |
|
|
UInt32 |
iOtherInfo |
|
) |
| |
|
protected |
AddStorageSensorMode : Record the system's intention to handle (usuall to store or send) event and sensor information when in a particular mode.
- Parameters
-
| iStorageMode | An application value, indicating monitorMode, writeToFiles, standby, etc. |
| pSensor | - The sensor to which this configuration applies. |
| pStorage | - The storage to which this configuration applies. |
| iFormat | - How to write the data. This is a code specific to the sensor, and may inlude text v binary, version, whether or not to include header information, etc. The receiver of this data must be able to decode the data. |
| iTopic | - Used by storage such as MQTT, to add a header or other information for routing or other purposes. |
| iDownsampleRate | - In some modes the target storage may not want to get all of the data. |
| iOtherInfo | - Other information of use to the sensor or storage. |
See also Geometrics::GmLoggingApp::mStorageModeInfo
◆ mStorageModeInfo
A list of storages x sensors x modes. "Mode" is an application-specific state; Tezzeret isn't really designed as a state machine, but if it were then mode would be the state. Various modes encapsulate such ideas as "dormant mode", "log everything mode", "monitor mode", etc.
This structure associates event source<==>handler interactions; in a particular mode, the data from a particular event source or sensor will be handled a certain way.
These relations are set up in the final application. In Geometrics::TezzeretApp, each application has its own setup function: Geometrics::TezzeretApp::SetupMagArrowLoggingModes, etc.
The documentation for this class was generated from the following files:
- /home/kddev/dev/AppDev/GmCommon/include/GmLoggingApp.hpp
- /home/kddev/dev/AppDev/GmCommon/GmApp/GmLoggingApp.cpp