83 lines
No EOL
2.3 KiB
C
83 lines
No EOL
2.3 KiB
C
// header files
|
|
#include "StateDataUtility.h"
|
|
|
|
/* Data Structures
|
|
typedef struct StateStruct
|
|
{
|
|
char name[ STD_STR_LEN ];
|
|
|
|
double averageTemp, lowestTemp, highestTemp;
|
|
|
|
bool inUse;
|
|
} StateDataType;
|
|
Data Structures */
|
|
|
|
// function definitions
|
|
|
|
/*
|
|
Name: setDataNodeFromData
|
|
Process: sets given values into a given StateDataType struct,
|
|
using individual struct data
|
|
Function input/parameters: provided name (const char *),
|
|
average, lowest, and highest temperatures (double),
|
|
and node in use state
|
|
Function output/parameters: updated state data pointer (StateDataType *)
|
|
Function output/returned: none
|
|
Device input/---: none
|
|
Device output/---: none
|
|
Dependencies: privateCopyString
|
|
*/
|
|
void setDataNodeFromData( StateDataType *nodePtr, const char *name,
|
|
double avgTemp, double lowTemp, double highTemp, bool nodeState )
|
|
{
|
|
// no return, void.
|
|
}
|
|
|
|
/*
|
|
Name: setDataNodeFromStruct
|
|
Process: sets given values into a given StateDataType struct,
|
|
using another data struct
|
|
Function input/parameters: provided state data source struct
|
|
(const StateDataType)
|
|
Function output/parameters: updated state data pointer (StateDataType *)
|
|
Function output/returned: none
|
|
Device input/---: none
|
|
Device output/---: none
|
|
Dependencies: setDataNodeFromData
|
|
*/
|
|
void setDataNodeFromStruct( StateDataType *nodePtr,
|
|
const StateDataType source )
|
|
{
|
|
// no return, void.
|
|
}
|
|
|
|
/*
|
|
Name: stateDataToString
|
|
Process: creates string from StateDataType data
|
|
Function input/parameters: provided state data (const StateDataType)
|
|
Function output/parameters: output string (char *)
|
|
Function output/returned: none
|
|
Device input/---: none
|
|
Device output/---: none
|
|
Dependencies: sprintf, or other options
|
|
*/
|
|
void stateDataToString( char *outStr, const StateDataType state )
|
|
{
|
|
// no return, void.
|
|
}
|
|
|
|
/*
|
|
Name: setEmptyDataNode
|
|
Process: sets given node values to string "---", zero values,
|
|
and Boolean in use variable to false
|
|
Function input/parameters: state data struct (StateDataType *)
|
|
Function output/parameters: updated state data struct (StateDataType *)
|
|
Function output/returned: none
|
|
Device input/---: none
|
|
Device output/---: none
|
|
Dependencies: privateCopyString
|
|
*/
|
|
void setEmptyDataNode( StateDataType *node )
|
|
{
|
|
// no return, void.
|
|
} |