Package xbot.common.injection
Class DevicePolice
java.lang.Object
xbot.common.injection.DevicePolice
Tracks how many devices are registered and prevents incorrectly re-using devices
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionA list of all the channels in use, and what device is using them.A list of all the devices in use -
Constructor Summary
ConstructorDescriptionDevicePolice
(RobotAssertionManager assertionManager) Creates a new DevicePolice instance -
Method Summary
Modifier and TypeMethodDescriptionvoid
registerDevice
(DevicePolice.DeviceType type, int id) Deprecated.void
registerDevice
(DevicePolice.DeviceType type, int id, int minId, int maxId) Register a device with an id falling into an allowable rangevoid
registerDevice
(DevicePolice.DeviceType type, int id, int minId, int maxId, Object device) Register a device with an id falling into an allowable rangeregisterDevice
(DevicePolice.DeviceType type, int id, Object device) Register a deviceregisterDevice
(DevicePolice.DeviceType type, CANBusId busId, int id, Object device) Register a CAN device
-
Field Details
-
registeredChannels
A list of all the channels in use, and what device is using them. -
registeredDevices
A list of all the devices in use
-
-
Constructor Details
-
DevicePolice
Creates a new DevicePolice instance
-
-
Method Details
-
registerDevice
Deprecated.Register a device. Please useregisterDevice(DeviceType, int, Object)
instead- Parameters:
type
- Device typeid
- Device id
-
registerDevice
Register a device- Parameters:
type
- Device typeid
- Device id
-
registerDevice
Register a CAN device- Parameters:
type
- Device typebusId
- Device CAN bus idid
- Device iddevice
- Device object
-
registerDevice
Register a device with an id falling into an allowable range- Parameters:
type
- Device typeid
- Device idminId
- Minimum allowable idmaxId
- 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 typeid
- Device idminId
- Minimum allowable idmaxId
- Maximum allowable id
-