The number you get is the number of bytes that was ACKed by the device at that address.
When you get a return of 2 you will see that the third byte was NACKed…
The scan code doesn’t make sense as it is for a scanner. You create an I2C_Device with address X, then you send the address X to the device and a byte 0?
You end up writing 3 bytes to the device. You only need to send one byte to see if it gets ACKed. That is also the safest. As the code is it will write garbage to a I2C_Eprom as the device address.(if eeprom is at address 0x91 on the bus then it will write zero into addres 0x91 of eeprom)