Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ static void resync_wrapper(tcp_bridge_resync_type_t type, const uint8_t *data, i
case TCP_BRIDGE_RESYNC_BAD_END: s_pool_state.resyncs_bad_end++; break;
case TCP_BRIDGE_RESYNC_BAD_DATA_CHECKSUM: s_pool_state.resyncs_bad_data_checksum++; break;
case TCP_BRIDGE_RESYNC_BUFFER_OVERFLOW: s_pool_state.resyncs_buffer_overflow++; break;
default: s_pool_state.resyncs_unexpected++; break;
}
xSemaphoreGive(s_pool_state_mutex);

Expand Down
5 changes: 5 additions & 0 deletions main/message_decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -2899,6 +2899,11 @@ static bool handle_pump_buttons(

static bool dispatch_message(const uint8_t *data, int len, const uint8_t *payload, int payload_len, const char *addr_info, message_decoder_context_t *ctx);

// This function assumes the framing layer has validated that the message buffer
// has valid checksums, start and stop bytes etc. It does not repeat the validation.
// Note also that this function can be called directly by the test harness and from
// the TX-echo path - in these cases it is incumbent on the caller to ensure that
// messages are valid.
bool decode_message(const uint8_t *data, int len, message_decoder_context_t *ctx)
{
if (!ctx || !ctx->pool_state) {
Expand Down
1 change: 1 addition & 0 deletions main/pool_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ typedef struct {
uint32_t resyncs_bad_end; // End byte != 0x03 at declared length
uint32_t resyncs_bad_data_checksum; // Data checksum mismatch
uint32_t resyncs_buffer_overflow; // Buffer filled without a complete frame
uint32_t resyncs_unexpected; // Resync for unexpected reason - this should be investigated

// Timers (up to MAX_TIMERS)
timer_state_t timers[MAX_TIMERS];
Expand Down
1 change: 1 addition & 0 deletions main/web_handlers.c
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,7 @@ static esp_err_t status_get_handler(httpd_req_t *req)
cJSON_AddNumberToObject(resyncs, "bad_end", state.resyncs_bad_end);
cJSON_AddNumberToObject(resyncs, "data_checksum", state.resyncs_bad_data_checksum);
cJSON_AddNumberToObject(resyncs, "buffer_overflow", state.resyncs_buffer_overflow);
cJSON_AddNumberToObject(resyncs, "unexpected", state.resyncs_unexpected);
cJSON_AddItemToObject(root, "resyncs", resyncs);

// Devices observed on the bus
Expand Down