@Test public void setMode() throws IOException { Mma7660Fc driver = new Mma7660Fc(mI2c); driver.setMode(Mma7660Fc.MODE_ACTIVE); Mockito.verify(mI2c).writeRegByte(0x07, (byte) Mma7660Fc.MODE_ACTIVE); Mockito.reset(mI2c); driver.setMode(Mma7660Fc.MODE_STANDBY); Mockito.verify(mI2c).writeRegByte(0x07, (byte) Mma7660Fc.MODE_STANDBY); }
public void setMode(@Mode int mode) throws IOException, IllegalStateException { if (mDevice == null) { throw new IllegalStateException("device not connected"); } mDevice.writeRegByte(REG_MODE, (byte) mode); }
Mma7660Fc implements AutoCloseable { public void setMode(@Mode int mode) throws IOException, IllegalStateException { if (mDevice == null) { throw new IllegalStateException("device not connected"); } mDevice.writeRegByte(REG_MODE, (byte) mode); } }
Mma7660Fc implements AutoCloseable { public void setMode(@Mode int mode) throws IOException, IllegalStateException { if (mDevice == null) { throw new IllegalStateException("device not connected"); } mDevice.writeRegByte(REG_MODE, (byte) mode); } Mma7660Fc(String bus);   Mma7660Fc(I2cDevice device); }
Mma7660Fc implements AutoCloseable { public void setMode(@Mode int mode) throws IOException, IllegalStateException { if (mDevice == null) { throw new IllegalStateException("device not connected"); } mDevice.writeRegByte(REG_MODE, (byte) mode); } Mma7660Fc(String bus);   Mma7660Fc(I2cDevice device); @Override void close(); void setMode(@Mode int mode); @SuppressWarnings("ResourceType") @Mode int getMode(); void setSamplingRate(@SamplingRate int rate); @SuppressWarnings("ResourceType") @SamplingRate int getSamplingRate(); float[] readSample(); }
Mma7660Fc implements AutoCloseable { public void setMode(@Mode int mode) throws IOException, IllegalStateException { if (mDevice == null) { throw new IllegalStateException("device not connected"); } mDevice.writeRegByte(REG_MODE, (byte) mode); } Mma7660Fc(String bus);   Mma7660Fc(I2cDevice device); @Override void close(); void setMode(@Mode int mode); @SuppressWarnings("ResourceType") @Mode int getMode(); void setSamplingRate(@SamplingRate int rate); @SuppressWarnings("ResourceType") @SamplingRate int getSamplingRate(); float[] readSample(); static final int I2C_ADDRESS; static final int RATE_120HZ; static final int RATE_64HZ; static final int RATE_32HZ; static final int RATE_16HZ; static final int RATE_8HZ; static final int RATE_4HZ; static final int RATE_2HZ; static final int RATE_1HZ; static final int MODE_STANDBY; static final int MODE_ACTIVE; }