Tezzeret  1
Tezzeret
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Static Protected Attributes | List of all members
Geometrics::GmPpsEventSensor Class Reference
Inheritance diagram for Geometrics::GmPpsEventSensor:
Inheritance graph
[legend]
Collaboration diagram for Geometrics::GmPpsEventSensor:
Collaboration graph
[legend]

Public Member Functions

 GmPpsEventSensor (UInt8 iSubjectId, GmManagedArrayRingBuffer< uint8_t, GM_SIZE_OF_APP_DATA_QUEUE > *mainEventQueue)
 
int Initialize (int iBoardPPSPinEnum, ti_sysbios_knl_Swi_Handle iPpsId)
 
void ReadDataInternal ()
 
void SetPpsCallback (GM_PPS_CallbackFxn callback)
 
virtual int WriteToStorage (UInt32 ui32Topic, char *pData, UInt32 iSize, GmStorage *psStorage, UInt32 ui32FormatId)
 
- Public Member Functions inherited from Geometrics::GmBufferedSensor
 GmBufferedSensor (UInt8 iSubjectId, int iRingCount, int iDataSize, GmManagedArrayRingBuffer< uint8_t, GM_SIZE_OF_APP_DATA_QUEUE > *mainEventQueue)
 Constructor for derived classes, when it's OK to allocate a local buffer dynamically. More...
 
 GmBufferedSensor (UInt8 iSubjectId, int iRingCount, int iDataSize, UInt8 *puiBuffer, UInt32 uiBufferSize, GmManagedArrayRingBuffer< uint8_t, GM_SIZE_OF_APP_DATA_QUEUE > *mainEventQueue)
 Constructor used by most derived classes on memory-constrained systems. In this case the derived class provides a buffer, usually static, so that the buffer doesn't need to be allocated dynamically. More...
 
int Start ()
 
int ResetBuffers ()
 
Bool HasData ()
 
int ReadRecord (char *pcDestination, int iSize)
 The main interface for consumers of a sensors data to get that data. It simply copies the data in the sensor's buffer into the caller's buffer. It is up to the caller to know what to do with that data, and how to free any local memory. (This function should have been name ReadNextRecord)
 
virtual int DeleteNextRecord ()
 DeleteNextRecord allows a caller to discard the next record without retrieving it. The subclasses that implement DeleteNextRecord must be able to deal with any memory that needs to be freed, or other such concerns.
 
- Public Member Functions inherited from Geometrics::GmEventSource
void SetSensorId (int iSensorId)
 
int GetSensorId ()
 

Static Public Member Functions

static void InitializingPpsCallback (unsigned int index)
 
static void PpsCallbackInternal (unsigned int index)
 

Public Attributes

uint64_t m_uiLastCounter
 
double m_dSeconds
 
- Public Attributes inherited from Geometrics::GmBufferedSensor
CChildRingBufferm_rbBuffer
 The local buffer into which the sensor or event source stores each of its events or measurements. When an item is committed to this buffer, it also adds an event (consisting of the sensor's subject ID) into the application main event queue. The full event or measurement remains here, until the application reads the subject ID out of the main queue and then asks this sensor object for the full information by calling ReadRecord.
 
UInt8 m_iSubjectId
 

Static Public Attributes

static int sPPSPinEnum = -1
 
static GmPpsEventSensorm_static_ppsTheOneSensor = NULL
 
static ti_sysbios_knl_Swi_Handle m_iPpsId
 

Static Protected Attributes

static GM_PPS_CallbackFxn m_static_callBack = NULL
 

Additional Inherited Members

- Protected Attributes inherited from Geometrics::GmEventSource
int m_iSensorId
 

Member Function Documentation

◆ InitializingPpsCallback()

void GmPpsEventSensor::InitializingPpsCallback ( unsigned int  index)
static

During initialization, use this callback. Afterward, switch to the main one. See C code for further information.

Until the system figures out the duty cycle, use this callback for PPS. When the duty cycle is figured out, then switch to the other callback

◆ WriteToStorage()

int GmPpsEventSensor::WriteToStorage ( UInt32  ui32Topic,
char *  pData,
UInt32  iSize,
GmStorage psStorage,
UInt32  ui32FormatId 
)
virtual

Virtual function, abstract in this class, called when a sensor should write its data to a storage or other event handler.

Parameters
ui32TopicHint to the storage (MQTT is one) about adding some topic or header information about the data. Not all storages use the hint.
pDataThe data to be written.
iSizeSize of the data to be written.
psStorageStorage or event handler to which the data will be written.
ui32FormatIdFormatting information to be used by the sensor. Within a single application, a sensor might be asked to write different formats to different storages or event handlers. Very likely the per-storage, per-mode information was stored in an instance of Geometrics::SensorStorageModeInfo.

Implements Geometrics::GmEventSource.


The documentation for this class was generated from the following files: