Skip to content

Commit 17a163f

Browse files
author
Peter Wegmann
committed
Measurement Messages are now only sent every t_transmit_min if the error bits are differ
1 parent 94e63f9 commit 17a163f

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

Gascounter_main.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ deltaType delta = {.Volume_since_last_send = 0,.Pressure_since_last_send = 0,.t_
108108
*
109109
* Timestamps and Pressurevalues for last send/display-reset/ping - Event
110110
*/
111-
lastType last= {.Pressure_on_send = 0,.time_send = 0,.time_display_reset = 0, .time_Pressure_Temp_meas = 0,.time_valid_time_reading = 0};
111+
lastType last= {.Pressure_on_send = 0,.time_send = 0,.time_display_reset = 0, .time_Pressure_Temp_meas = 0,.time_valid_time_reading = 0, .Status_on_Send = 0};
112112

113113

114114

@@ -447,6 +447,8 @@ void Collect_Measurement_Data(void){
447447
// network error is not reset on send/store
448448
if(BIT_CHECK(get_status(),NETWORK_ERROR)){BIT_SET(curr_Stat,status_bit_Network_err_91);}
449449

450+
451+
last.Status_on_Send = status_reset_on_send;
450452

451453

452454
sendbuffer[22] = curr_Stat;
@@ -2031,10 +2033,11 @@ int main(void)
20312033
if((delta.t_send >= options.t_transmission_max * 60)|| //
20322034
(delta.t_send >= options.t_transmission_min && delta.Volume_since_last_send > options.delta_V)||
20332035
(delta.t_send >= options.t_transmission_min && delta.Pressure_since_last_send > options.delta_p)||
2034-
(delta.t_send >= options.t_transmission_min && status_reset_on_send) )
2036+
(delta.t_send >= options.t_transmission_min && status_reset_on_send && status_reset_on_send != last.Status_on_Send) )
20352037
{
20362038

2037-
2039+
2040+
20382041

20392042
Collect_Measurement_Data();
20402043

Gascounter_main.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ typedef struct {
148148
* Absolute Times/Pressure of the last time an action was executetd i.e: Pinging the Server
149149
*/
150150
typedef struct {
151+
uint16_t Status_on_Send;
151152
uint32_t Pressure_on_send; /**< @brief Pressure the last time Data was sent/stored to the Server/memory (in 0.1 mbar)*/
152153
uint32_t time_send; /**< @brief Absolute time of last sending of Data*/
153154
uint32_t time_display_reset; /**< @brief Absolute time of last Display Reset*/

0 commit comments

Comments
 (0)