@Test public void testGetPin() throws IOException { pcf8574.getPin(1); Mockito.verify(device).read(Matchers.any(byte[].class), Matchers.eq(1)); }
public boolean getPin(int pin) { if (pin < 0 || pin > 7) return false; int value = readByte(); return ((value & BV(pin)) == BV(pin)); }
Pcf8574 implements AutoCloseable { public boolean getPin(int pin) { if (pin < 0 || pin > 7) return false; int value = readByte(); return ((value & BV(pin)) == BV(pin)); } }
Pcf8574 implements AutoCloseable { public boolean getPin(int pin) { if (pin < 0 || pin > 7) return false; int value = readByte(); return ((value & BV(pin)) == BV(pin)); } @VisibleForTesting  Pcf8574(I2cDevice device); }
Pcf8574 implements AutoCloseable { public boolean getPin(int pin) { if (pin < 0 || pin > 7) return false; int value = readByte(); return ((value & BV(pin)) == BV(pin)); } @VisibleForTesting  Pcf8574(I2cDevice device); static Pcf8574 create(int address, boolean isPcf8574); static Pcf8574 create(int address, String bus, boolean isPcf8574); static int BV(int pin); @Override void close(); boolean writeByte(int mask, int data); int readValue(); void setPin(int pin, boolean state); boolean getPin(int pin); int readByte(); }
Pcf8574 implements AutoCloseable { public boolean getPin(int pin) { if (pin < 0 || pin > 7) return false; int value = readByte(); return ((value & BV(pin)) == BV(pin)); } @VisibleForTesting  Pcf8574(I2cDevice device); static Pcf8574 create(int address, boolean isPcf8574); static Pcf8574 create(int address, String bus, boolean isPcf8574); static int BV(int pin); @Override void close(); boolean writeByte(int mask, int data); int readValue(); void setPin(int pin, boolean state); boolean getPin(int pin); int readByte();  }