mirror of
				https://github.com/esphome/esphome.git
				synced 2025-11-04 00:51:49 +00:00 
			
		
		
		
	Fix small index compare bug in modbus
This commit is contained in:
		@@ -47,7 +47,7 @@ bool Modbus::parse_modbus_byte_(uint8_t byte) {
 | 
				
			|||||||
  uint8_t function_code = raw[1];
 | 
					  uint8_t function_code = raw[1];
 | 
				
			||||||
  // Byte 2: Size (with modbus rtu function code 4/3)
 | 
					  // Byte 2: Size (with modbus rtu function code 4/3)
 | 
				
			||||||
  // See also https://en.wikipedia.org/wiki/Modbus
 | 
					  // See also https://en.wikipedia.org/wiki/Modbus
 | 
				
			||||||
  if (at == 2)
 | 
					  if (at <= 2)
 | 
				
			||||||
    return true;
 | 
					    return true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  uint8_t data_len = raw[2];
 | 
					  uint8_t data_len = raw[2];
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user