Class DevicePolice

java.lang.Object
xbot.common.injection.DevicePolice

@Singleton public class DevicePolice extends Object
Tracks how many devices are registered and prevents incorrectly re-using devices
  • Field Details

    • registeredChannels

      public Map<String,Object> registeredChannels
      A list of all the channels in use, and what device is using them.
    • registeredDevices

      public List<Object> registeredDevices
      A list of all the devices in use
  • Constructor Details

    • DevicePolice

      @Inject public DevicePolice(RobotAssertionManager assertionManager)
      Creates a new DevicePolice instance
  • Method Details

    • registerDevice

      @Deprecated public void registerDevice(DevicePolice.DeviceType type, int id)
      Deprecated.
      Register a device. Please use registerDevice(DeviceType, int, Object) instead
      Parameters:
      type - Device type
      id - Device id
    • registerDevice

      public String registerDevice(DevicePolice.DeviceType type, int id, Object device)
      Register a device
      Parameters:
      type - Device type
      id - Device id
    • registerDevice

      public String registerDevice(DevicePolice.DeviceType type, CANBusId busId, int id, Object device)
      Register a CAN device
      Parameters:
      type - Device type
      busId - Device CAN bus id
      id - Device id
      device - Device object
    • registerDevice

      public void registerDevice(DevicePolice.DeviceType type, int id, int minId, int maxId)
      Register a device with an id falling into an allowable range
      Parameters:
      type - Device type
      id - Device id
      minId - Minimum allowable id
      maxId - Maximum allowable id
    • registerDevice

      public void registerDevice(DevicePolice.DeviceType type, int id, int minId, int maxId, Object device)
      Register a device with an id falling into an allowable range
      Parameters:
      type - Device type
      id - Device id
      minId - Minimum allowable id
      maxId - Maximum allowable id