Add method to get Device ID to Can Jaguar (fixes artf3613)

Change-Id: I7b0cb555a56ee97cf90ea32a3080b7c14bb5ca56
This commit is contained in:
Kevin O'Connor
2014-10-15 16:11:29 -04:00
parent 08c8723174
commit 4e31b68008
3 changed files with 10 additions and 0 deletions

View File

@@ -143,6 +143,7 @@ public:
bool IsSafetyEnabled();
void SetSafetyEnabled(bool enabled);
void GetDescription(char *desc);
uint8_t GetDeviceID();
protected:
// Control mode helpers

View File

@@ -2036,6 +2036,11 @@ void CANJaguar::GetDescription(char *desc)
sprintf(desc, "CANJaguar ID %d", m_deviceNumber);
}
uint8_t CANJaguar::GetDeviceID()
{
return m_deviceNumber;
}
/**
* Common interface for stopping the motor
* Part of the MotorSafety interface

View File

@@ -2103,6 +2103,10 @@ public class CANJaguar implements MotorSafety, PIDOutput, SpeedController, LiveW
public String getDescription() {
return "CANJaguar ID "+m_deviceNumber;
}
public int getDeviceID() {
return (int)m_deviceNumber;
}
/**
* Common interface for stopping a motor.