code: protected final void setConnected(boolean value) {
          if (value && !isConnected) {
              isConnected = value;
              if (connectionListener != null) {
                  connectionListener.onIoDeviceConnected(this);
              }
          } else if (!value && isConnected) {
              isConnected = value;
              if (connectionListener != null) {
                  connectionListener.onIoDeviceDisconnected(this);
              }
          }
      }
docs: Use this from a subclass of {@link IoDevice} to indicate the connection status of
  the hardware associated with the {@link IoDevice}. For cases like a connected
  bluetooth or USB device this can be set <code>true</code> when Bluetooth or USB
  connection
  is made and <code>false</code> when disconnected. If the hardware device is always
  available the value can be set to <code>true</code> in the constructor and no calls to
  this method are required. A {@link IoDevice} is only attached to a {@link Cursor}
  if the {@link IoDevice#isConnected} value is true. On passing a
  <code>false</code>
  value here the {@link IoDevice} is removed from the {@link Cursor}.
  
  @param value <code>true</code> for connected and <code>false</code> for disconnected