1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-29 22:24:26 +00:00

[packet_transport] Make some arguments const (#8700)

Co-authored-by: clydeps <U5yx99dok9>
This commit is contained in:
Clyde Stubbs
2025-05-08 08:22:56 +10:00
committed by GitHub
parent 213648564c
commit d60e1f02c0
7 changed files with 8 additions and 9 deletions

View File

@@ -74,7 +74,7 @@ void UARTTransport::write_byte_(uint8_t byte) const {
this->parent_->write_byte(byte);
}
void UARTTransport::send_packet(std::vector<uint8_t> &buf) const {
void UARTTransport::send_packet(const std::vector<uint8_t> &buf) const {
this->parent_->write_byte(FLAG_BYTE);
for (uint8_t byte : buf) {
this->write_byte_(byte);

View File

@@ -29,7 +29,7 @@ class UARTTransport : public packet_transport::PacketTransport, public UARTDevic
protected:
void write_byte_(uint8_t byte) const;
void send_packet(std::vector<uint8_t> &buf) const override;
void send_packet(const std::vector<uint8_t> &buf) const override;
bool should_send() override { return true; };
size_t get_max_packet_size() override { return MAX_PACKET_SIZE; }
std::vector<uint8_t> receive_buffer_{};