Hi,
I want my application to work on FX30 (WP77xx, legato 18.10) and mangOH Red (WP77xx, legato 18.10) without recompiling source every time, I want to change a unit.
I should have one .update file for both units. Unfortunately, mangOH Red uses I2C-5 and FX30 I2C-4.
When I add to .adef file:
requires:
{
device:
{
[rw] /dev/i2c-4 /dev/i2c-4
[rw] /dev/i2c-5 /dev/i2c-5
}
}
application crashes on FX30, because /dev/i2c-5 does not exist. Error - file does not exist.
Based on documentation (https://docs.legato.io/latest/defFilesFormat.html) I changed .adef file to:
requires:
{
device:
{
#if file_exists(/dev/i2c-5)
[rw] /dev/i2c-5 /dev/i2c-5
#else
[rw] /dev/i2c-4 /dev/i2c-4
#endif
}
}
It would work if function file_exists worked. The function returns false even if /dev/i2c-5 exists.