com.qualcomm.robotcore.hardware

## Class I2cDeviceSynchDevice<DEVICE_CLIENT extends I2cDeviceSynchSimple>

- java.lang.Object
- - com.qualcomm.robotcore.hardware.I2cDeviceSynchDevice<DEVICE_CLIENT>

- All Implemented Interfaces:
    HardwareDevice
  Direct Known Subclasses:
    I2cDeviceSynchDeviceWithParameters

      public abstract class I2cDeviceSynchDevice<DEVICE_CLIENT extends I2cDeviceSynchSimple>
      extends java.lang.Object
      implements HardwareDevice

  `I2cDeviceSynchDevice` instances are I2c devices which are built on top of I2cDeviceSynchSimple instances or subclasses thereof. The class provides common and handy utility services for such devices.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface com.qualcomm.robotcore.hardware.HardwareDevice

      `HardwareDevice.Manufacturer`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected DEVICE_CLIENT` | `deviceClient`
    `protected boolean` | `deviceClientIsOwned`
    `protected boolean` | `isInitialized`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `I2cDeviceSynchDevice(DEVICE_CLIENT deviceClient, boolean deviceClientIsOwned)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Closes this device
    `protected void` | `disengage()`
    `protected abstract boolean` | `doInitialize()` Actually carries out the initialization of the instance.
    `protected void` | `engage()`
    `java.lang.String` | `getConnectionInfo()` Get connection information about this device in a human readable format
    `DEVICE_CLIENT` | `getDeviceClient()`
    `int` | `getVersion()` Version
    `boolean` | `initialize()`
    `protected void` | `initializeIfNecessary()`
    `void` | `onModuleStateChange(RobotArmingStateNotifier module, RobotArmingStateNotifier.ARMINGSTATE state)`
    `protected void` | `registerArmingStateCallback(boolean doInitialCallback)`
    `void` | `resetDeviceConfigurationForOpMode()` Resets the device's configuration to that which is expected at the beginning of an OpMode.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface com.qualcomm.robotcore.hardware.HardwareDevice

      `getDeviceName, getManufacturer`

- - ### Field Detail

    - #### deviceClient

          protected DEVICE_CLIENT extends I2cDeviceSynchSimple deviceClient

    - #### deviceClientIsOwned

          protected boolean deviceClientIsOwned

    - #### isInitialized

          protected boolean isInitialized

  - ### Constructor Detail

    - #### I2cDeviceSynchDevice

          protected I2cDeviceSynchDevice(DEVICE_CLIENT deviceClient,
                                         boolean deviceClientIsOwned)

  - ### Method Detail

    - #### registerArmingStateCallback

          protected void registerArmingStateCallback(boolean doInitialCallback)

    - #### engage

          protected void engage()

    - #### disengage

          protected void disengage()

    - #### getDeviceClient

          public DEVICE_CLIENT getDeviceClient()

    - #### onModuleStateChange

          public void onModuleStateChange(RobotArmingStateNotifier module,
                                          RobotArmingStateNotifier.ARMINGSTATE state)

    - #### initializeIfNecessary

          protected void initializeIfNecessary()

    - #### initialize

          public boolean initialize()

    - #### doInitialize

          protected abstract boolean doInitialize()

      Actually carries out the initialization of the instance.
      Returns:
        Whether the initialization was successful or not

    - #### resetDeviceConfigurationForOpMode

          public void resetDeviceConfigurationForOpMode()

      Description copied from interface: `HardwareDevice`
      Resets the device's configuration to that which is expected at the beginning of an OpMode. For example, motors will reset the their direction to 'forward'.
      Specified by:
        `resetDeviceConfigurationForOpMode` in interface `HardwareDevice`

    - #### close

          public void close()

      Description copied from interface: `HardwareDevice`
      Closes this device
      Specified by:
        `close` in interface `HardwareDevice`

    - #### getVersion

          public int getVersion()

      Description copied from interface: `HardwareDevice`
      Version
      Specified by:
        `getVersion` in interface `HardwareDevice`
      Returns:
        get the version of this device

    - #### getConnectionInfo

          public java.lang.String getConnectionInfo()

      Description copied from interface: `HardwareDevice`
      Get connection information about this device in a human readable format
      Specified by:
        `getConnectionInfo` in interface `HardwareDevice`
      Returns:
        connection info