@Test public void getSamplingRate() throws IOException { Mma7660Fc driver = new Mma7660Fc(mI2c); driver.getSamplingRate(); Mockito.verify(mI2c).readRegByte(0x08); }
@SuppressWarnings("ResourceType") public @SamplingRate int getSamplingRate() throws IOException, IllegalStateException { if (mDevice == null) { throw new IllegalStateException("device not connected"); } return mDevice.readRegByte(REG_SAMPLING_RATE); }
Mma7660Fc implements AutoCloseable { @SuppressWarnings("ResourceType") public @SamplingRate int getSamplingRate() throws IOException, IllegalStateException { if (mDevice == null) { throw new IllegalStateException("device not connected"); } return mDevice.readRegByte(REG_SAMPLING_RATE); } }
Mma7660Fc implements AutoCloseable { @SuppressWarnings("ResourceType") public @SamplingRate int getSamplingRate() throws IOException, IllegalStateException { if (mDevice == null) { throw new IllegalStateException("device not connected"); } return mDevice.readRegByte(REG_SAMPLING_RATE); } Mma7660Fc(String bus);   Mma7660Fc(I2cDevice device); }
Mma7660Fc implements AutoCloseable { @SuppressWarnings("ResourceType") public @SamplingRate int getSamplingRate() throws IOException, IllegalStateException { if (mDevice == null) { throw new IllegalStateException("device not connected"); } return mDevice.readRegByte(REG_SAMPLING_RATE); } 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 { @SuppressWarnings("ResourceType") public @SamplingRate int getSamplingRate() throws IOException, IllegalStateException { if (mDevice == null) { throw new IllegalStateException("device not connected"); } return mDevice.readRegByte(REG_SAMPLING_RATE); } 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; }