mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 15:12:06 +00:00 
			
		
		
		
	Merge branch 'zero_copy' into integration
This commit is contained in:
		| @@ -732,7 +732,6 @@ message SubscribeLogsResponse { | ||||
|  | ||||
|   LogLevel level = 1; | ||||
|   bytes message = 3; | ||||
|   bool send_failed = 4; | ||||
| } | ||||
|  | ||||
| // ==================== NOISE ENCRYPTION ==================== | ||||
|   | ||||
| @@ -1342,8 +1342,6 @@ bool APIConnection::try_send_log_message(int level, const char *tag, const char | ||||
|   SubscribeLogsResponse msg; | ||||
|   msg.level = static_cast<enums::LogLevel>(level); | ||||
|   msg.set_message(reinterpret_cast<const uint8_t *>(line), message_len); | ||||
|   msg.send_failed = false; | ||||
|  | ||||
|   return this->send_message_(msg, SubscribeLogsResponse::MESSAGE_TYPE); | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -823,12 +823,10 @@ bool SubscribeLogsRequest::decode_varint(uint32_t field_id, ProtoVarInt value) { | ||||
| void SubscribeLogsResponse::encode(ProtoWriteBuffer buffer) const { | ||||
|   buffer.encode_uint32(1, static_cast<uint32_t>(this->level)); | ||||
|   buffer.encode_bytes(3, this->message_ptr_, this->message_len_); | ||||
|   buffer.encode_bool(4, this->send_failed); | ||||
| } | ||||
| void SubscribeLogsResponse::calculate_size(uint32_t &total_size) const { | ||||
|   ProtoSize::add_enum_field(total_size, 1, static_cast<uint32_t>(this->level)); | ||||
|   ProtoSize::add_bytes_field(total_size, 1, this->message_len_); | ||||
|   ProtoSize::add_bool_field(total_size, 1, this->send_failed); | ||||
| } | ||||
| #ifdef USE_API_NOISE | ||||
| bool NoiseEncryptionSetKeyRequest::decode_length(uint32_t field_id, ProtoLengthDelimited value) { | ||||
|   | ||||
| @@ -965,7 +965,7 @@ class SubscribeLogsRequest : public ProtoDecodableMessage { | ||||
| class SubscribeLogsResponse : public ProtoMessage { | ||||
|  public: | ||||
|   static constexpr uint8_t MESSAGE_TYPE = 29; | ||||
|   static constexpr uint8_t ESTIMATED_SIZE = 13; | ||||
|   static constexpr uint8_t ESTIMATED_SIZE = 11; | ||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | ||||
|   const char *message_name() const override { return "subscribe_logs_response"; } | ||||
| #endif | ||||
| @@ -976,7 +976,6 @@ class SubscribeLogsResponse : public ProtoMessage { | ||||
|     this->message_ptr_ = data; | ||||
|     this->message_len_ = len; | ||||
|   } | ||||
|   bool send_failed{false}; | ||||
|   void encode(ProtoWriteBuffer buffer) const override; | ||||
|   void calculate_size(uint32_t &total_size) const override; | ||||
| #ifdef HAS_PROTO_MESSAGE_DUMP | ||||
|   | ||||
| @@ -1670,10 +1670,6 @@ void SubscribeLogsResponse::dump_to(std::string &out) const { | ||||
|   out.append("  message: "); | ||||
|   out.append(format_hex_pretty(this->message_ptr_, this->message_len_)); | ||||
|   out.append("\n"); | ||||
|  | ||||
|   out.append("  send_failed: "); | ||||
|   out.append(YESNO(this->send_failed)); | ||||
|   out.append("\n"); | ||||
|   out.append("}"); | ||||
| } | ||||
| #ifdef USE_API_NOISE | ||||
|   | ||||
| @@ -130,15 +130,15 @@ script: | ||||
|       - logger.log: "=== Test 5: Empty name retry ===" | ||||
|       - lambda: |- | ||||
|           auto *component = id(test_sensor); | ||||
|           App.scheduler.set_retry(component, "", 50, 5, | ||||
|           App.scheduler.set_retry(component, "", 100, 5, | ||||
|             [](uint8_t retry_countdown) { | ||||
|               id(empty_name_retry_counter)++; | ||||
|               ESP_LOGI("test", "Empty name retry attempt %d", id(empty_name_retry_counter)); | ||||
|               return RetryResult::RETRY; | ||||
|             }); | ||||
|  | ||||
|           // Try to cancel after 75ms | ||||
|           App.scheduler.set_timeout(component, "empty_cancel_timer", 75, []() { | ||||
|           // Try to cancel after 150ms | ||||
|           App.scheduler.set_timeout(component, "empty_cancel_timer", 150, []() { | ||||
|             bool cancelled = App.scheduler.cancel_retry(id(test_sensor), ""); | ||||
|             ESP_LOGI("test", "Empty name retry cancel result: %s", | ||||
|                      cancelled ? "true" : "false"); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user