Example #1
0
 public boolean readBytes(final int register, final int count, final ByteBuffer buffer)
     throws IOException {
   buffer.clear();
   final int result = _device.read(register, _registerSize, buffer);
   if (result != count) {
     System.out.println("Failed to read " + count + " bytes.  Got " + result);
     return false;
   }
   return true;
 }
Example #2
0
 public void writeByte(final int register, final byte byteToWrite) throws IOException {
   _commandBuffer.clear();
   _commandBuffer.put(byteToWrite);
   _commandBuffer.rewind();
   _device.write(register, _registerSize, _commandBuffer);
 }