add log messages for bad pronto codes (#3738)

Co-authored-by: Samuel Sieb <samuel@sieb.net>
This commit is contained in:
Samuel Sieb 2022-08-22 18:26:36 -07:00 committed by GitHub
parent 3d0a85ee78
commit 5dec9d88f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View file

@ -106,6 +106,7 @@ void ProntoProtocol::send_pronto_(RemoteTransmitData *dst, const std::vector<uin
ESP_LOGD(TAG, "Send Pronto: intros=%d", intros);
ESP_LOGD(TAG, "Send Pronto: repeats=%d", repeats);
if (NUMBERS_IN_PREAMBLE + intros + repeats != data.size()) { // inconsistent sizes
ESP_LOGE(TAG, "Inconsistent data, not sending");
return;
}

View file

@ -113,6 +113,10 @@ void RemoteTransmitterComponent::send_internal(uint32_t send_times, uint32_t sen
this->rmt_temp_.push_back(rmt_item);
}
if ((this->rmt_temp_.data() == nullptr) || this->rmt_temp_.empty()) {
ESP_LOGE(TAG, "Empty data");
return;
}
for (uint32_t i = 0; i < send_times; i++) {
esp_err_t error = rmt_write_items(this->channel_, this->rmt_temp_.data(), this->rmt_temp_.size(), true);
if (error != ESP_OK) {