Skip to content

Commit

Permalink
Parse AWS sentences first as they are the most commonly received
Browse files Browse the repository at this point in the history
  • Loading branch information
mill1000 committed Nov 7, 2023
1 parent 8350a8e commit 35c06e2
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions components/winix_c545/winix_c545.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,12 @@ void WinixC545Component::parse_sentence_(const char *sentence) {
// Advance past prefix
sentence += RX_PREFIX.size();

// Parse AWS sentences from MCU
if (strncmp(sentence, "AWS_SEND", strlen("AWS_SEND")) == 0) {
this->parse_aws_sentence_(sentence);
return;
}

// Handle MCU_READY message
if (strncmp(sentence, "MCU_READY", strlen("MCU_READY")) == 0) {
ESP_LOGI(TAG, "MCU_READY");
Expand Down Expand Up @@ -201,11 +207,7 @@ void WinixC545Component::parse_sentence_(const char *sentence) {
return;
}

// Parse AWS sentences from MCU
if (strncmp(sentence, "AWS_SEND", strlen("AWS_SEND")) == 0)
this->parse_aws_sentence_(sentence);
else
ESP_LOGW(TAG, "Unsupported sentence: %s", sentence);
ESP_LOGW(TAG, "Unsupported sentence: %s", sentence);
}

bool WinixC545Component::readline_(char data, char *buffer, int max_length) {
Expand Down

0 comments on commit 35c06e2

Please sign in to comment.