-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ELEC-575: Fix generation of fake data for driver display (#33)
- Add function to generate fake CAN messages with source and ID pre-specified. - Use codegen-tooling to generate new go package, canmsgdefs, that defines CAN message IDs. - Add function to generate uint64 rawData when passing in several uint8/uint16/uint32. - Update generation of CAN messages for publishing over message bus.
- Loading branch information
1 parent
c744d03
commit 78b9652
Showing
4 changed files
with
229 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
package canmsgdefs | ||
|
||
// NOTE: This file is generated by codegen-tooling, | ||
// with minor changes so that Golint doesn't complain. | ||
// Currently, this file is copy-pasted from codegen output. | ||
|
||
// TODO: Automate this process. | ||
|
||
// CanDeviceID is a 16-bit integer for the source of a CAN message | ||
type CanDeviceID uint16 | ||
|
||
// CanMsgID is a 32-bit integer for the type of CAN message | ||
type CanMsgID uint32 | ||
|
||
// For setting the CAN device | ||
const ( | ||
SystemCanDeviceReserved CanDeviceID = 0 | ||
SystemCanDevicePlutus CanDeviceID = 1 | ||
SystemCanDevicePlutusSlave CanDeviceID = 2 | ||
SystemCanDeviceChaos CanDeviceID = 3 | ||
SystemCanDeviceTelemetry CanDeviceID = 4 | ||
SystemCanDeviceLightsFront CanDeviceID = 5 | ||
SystemCanDeviceLightsRear CanDeviceID = 6 | ||
SystemCanDeviceMotorController CanDeviceID = 7 | ||
SystemCanDeviceDriverControls CanDeviceID = 8 | ||
SystemCanDeviceDriverDisplay CanDeviceID = 9 | ||
SystemCanDeviceSolarMasterFront CanDeviceID = 10 | ||
SystemCanDeviceSolarMasterRear CanDeviceID = 11 | ||
SystemCanDeviceSensorBoard CanDeviceID = 12 | ||
SystemCanDeviceCharger CanDeviceID = 13 | ||
) | ||
|
||
// For setting the CAN message ID | ||
const ( | ||
SystemCanMessageBpsHeartbeat CanMsgID = 0 | ||
SystemCanMessagePowerDistributionFault CanMsgID = 1 | ||
SystemCanMessageBatteryRelayMain CanMsgID = 2 | ||
SystemCanMessageBatteryRelaySlave CanMsgID = 3 | ||
SystemCanMessageMotorRelay CanMsgID = 4 | ||
SystemCanMessageSolarRelayRear CanMsgID = 5 | ||
SystemCanMessageSolarRelayFront CanMsgID = 6 | ||
SystemCanMessagePowerState CanMsgID = 7 | ||
SystemCanMessagePowertrainHeartbeat CanMsgID = 8 | ||
SystemCanMessageMotorControllerReset CanMsgID = 15 | ||
SystemCanMessageOvuvDcdcAux CanMsgID = 16 | ||
SystemCanMessageMcErrorLimits CanMsgID = 17 | ||
SystemCanMessageDriveOutput CanMsgID = 18 | ||
SystemCanMessageCruiseTarget CanMsgID = 19 | ||
SystemCanMessageFanControl CanMsgID = 20 | ||
SystemCanMessageSetDischargeBitset CanMsgID = 21 | ||
SystemCanMessageDischargeState CanMsgID = 22 | ||
SystemCanMessageLightsSync CanMsgID = 23 | ||
SystemCanMessageLightsState CanMsgID = 24 | ||
SystemCanMessageHorn CanMsgID = 25 | ||
SystemCanMessageChargerConnState CanMsgID = 26 | ||
SystemCanMessageChargerSetRelayState CanMsgID = 27 | ||
SystemCanMessageSteeringAngle CanMsgID = 28 | ||
SystemCanMessageBatterySoc CanMsgID = 31 | ||
SystemCanMessageBatteryVt CanMsgID = 32 | ||
SystemCanMessageBatteryAggregateVc CanMsgID = 33 | ||
SystemCanMessageMotorControllerVc CanMsgID = 35 | ||
SystemCanMessageMotorVelocity CanMsgID = 36 | ||
SystemCanMessageMotorDebug CanMsgID = 37 | ||
SystemCanMessageMotorTemps CanMsgID = 38 | ||
SystemCanMessageMotorAmpHr CanMsgID = 39 | ||
SystemCanMessageOdometer CanMsgID = 40 | ||
SystemCanMessageAuxDcdcVc CanMsgID = 43 | ||
SystemCanMessageDcdcTemps CanMsgID = 44 | ||
SystemCanMessageSolarDataFront CanMsgID = 45 | ||
SystemCanMessageSolarDataRear CanMsgID = 46 | ||
SystemCanMessageChargerInfo CanMsgID = 47 | ||
SystemCanMessageLinearAcceleration CanMsgID = 51 | ||
SystemCanMessageAngularRotation CanMsgID = 52 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.