getUnitId method
If request
has its own unitId defined, then it will override this
client unitId. If both unitId are not defined the a 0 is returned.
Implementation
int getUnitId(ModbusRequest request) => request.unitId != null
? request.unitId!
: unitId != null
? unitId!
: 0;