This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

BQ27Z561: what is way to detect slave address of bq27z561 is not present on open i2c bus or not ?

Part Number: BQ27Z561

i have read that  " ioctl(file, I2C_SLAVE, addr); doesn't try and detect if a device with the given address is present ".

Actually i have connected 2 slave device on " /dev/i2c-2" .   one is BQ27Z561 and another is ADC.

I need to integrate code such that if slave address of BQ27Z561 is not present on this bus (" /dev/i2c-2") then i have to use ADC to show battery percentage.

But i have  need code that tell me 'slave address of BQ27Z561 is not present on this bus (" /dev/i2c-2")'

So please provide me way to detect if a device with the given address is present on " /dev/i2c-2".