void initMeterItems(void); unsigned long long getEpochTimeWithMs(void); #define NUMBER_OF_METERS 10 /* the number of meters we use */ #define METER_INDEX_GAS 0 /* index of the gas meter data */ typedef struct { portSHORT meterEnabled; /* 0: item not used, 1: meter enabled */ unsigned long long timeLastTick; /* when did the last tick occur? epoch time in seconds */ unsigned long long timeBeforeLastTick; /* when did the tick before the last tick occur? epoch time in seconds */ portLONG valueLastTick; /* what value did we have at the last tick? */ portLONG valueBeforeLastTick; /* what value did we have at the tick before the last tick? */ } meterItem; meterItem meterItems[NUMBER_OF_METERS]; /* the data for all the meters */