Add CAN API constructor that takes explicit manufacturer and device type (#1311)

Useful for vendors wanting to use the API and make their own device parameters
This commit is contained in:
Thad House
2018-09-19 21:40:47 -07:00
committed by Peter Johnson
parent a846ed062f
commit 59386635e7
3 changed files with 46 additions and 1 deletions

View File

@@ -32,13 +32,30 @@ public class CAN implements Closeable {
/**
* Create a new CAN communication interface with the specific device ID.
* The device ID is 6 bits (0-63)
* This uses the team manufacturer and device types.
* The device ID is 6 bits (0-63).
*
* @param deviceId The device id
*/
public CAN(int deviceId) {
m_handle = CANAPIJNI.initializeCAN(kTeamManufacturer, deviceId, kTeamDeviceType);
HAL.report(tResourceType.kResourceType_CAN, deviceId);
}
/**
* Create a new CAN communication interface with a specific device ID,
* manufacturer and device type. The device ID is 6 bits, the
* manufacturer is 8 bits, and the device type is 5 bits.
*
* @param deviceId The device ID
* @param deviceManufacturer The device manufacturer
* @param deviceType The device type
*/
public CAN(int deviceId, int deviceManufacturer, int deviceType) {
m_handle = CANAPIJNI.initializeCAN(deviceManufacturer, deviceId, deviceType);
HAL.report(tResourceType.kResourceType_CAN, deviceId);
}
/**
* Closes the CAN communication.
*/