allocateAddress method

void allocateAddress(
  1. int address
)

Check that the address can be used for I2C and that is has not already been allocated. This should be called by subclasses not clients.

Implementation

void allocateAddress(int address) {
  if (_allocatedAddresses.contains(address)) {
    throw I2CException('Already allocated', address);
  }
  _allocatedAddresses.add(address);
}