How to set up a command-based communication using I2C

Please show your modifications. Multiple masters on the same bus must work.