22#include <linux/can/bcm.h>
25#include <sys/socket.h>
90 struct bcm_msg_head msg_head;
91 struct can_frame frame[NUM_MEDIUM_CYCLE_MESSAGES];
98 struct bcm_msg_head msg_head;
99 struct can_frame frame[NUM_SLOW_CYCLE_MESSAGES];
Class that handles message scheduling over a SocketCAN interface.
Definition: can_scheduler.h:44
void update_afe3_status_v1(uint16_t v1_value)
Update the CAN value for afe3_status v1.
Definition: can_scheduler.cc:447
void update_battery_vt_current(uint16_t current_value)
Update the CAN value for battery_vt current.
Definition: can_scheduler.cc:208
static const constexpr unsigned int MEDIUM_CYCLE_SPEED_MS
Definition: can_scheduler.h:49
void update_medium_one_shot_msg_sig1(uint16_t sig1_value)
Update the CAN value for medium_one_shot_msg sig1.
Definition: can_scheduler.cc:512
void update_afe3_status_temp(uint8_t temp_value)
Update the CAN value for afe3_status temp.
Definition: can_scheduler.cc:435
void update_cc_steering_input_cc(uint8_t input_cc_value)
Update the CAN value for cc_steering input_cc.
Definition: can_scheduler.cc:654
CanScheduler()
Constructs a CanScheduler object.
Definition: can_scheduler.cc:22
static const constexpr unsigned int SLOW_CAN_COMMUNICATION_SLOW_ONE_SHOT_MSG_FRAME_INDEX
Definition: can_scheduler.h:76
void update_battery_status_fault(uint16_t fault_value)
Update the CAN value for battery_status fault.
Definition: can_scheduler.cc:144
void update_afe2_status_v1(uint16_t v1_value)
Update the CAN value for afe2_status v1.
Definition: can_scheduler.cc:384
static const constexpr unsigned int SLOW_BMS_CARRIER_AFE1_STATUS_FRAME_INDEX
Definition: can_scheduler.h:73
void update_battery_status_aux_batt_v(uint16_t aux_batt_v_value)
Update the CAN value for battery_status aux_batt_v.
Definition: can_scheduler.cc:170
void update_battery_vt_batt_perc(uint16_t batt_perc_value)
Update the CAN value for battery_vt batt_perc.
Definition: can_scheduler.cc:234
std::atomic< bool > m_isConnected
Definition: can_scheduler.h:103
void update_battery_info_max_cell_v(uint16_t max_cell_v_value)
Update the CAN value for battery_info max_cell_v.
Definition: can_scheduler.cc:271
void update_medium_one_shot_msg_sig2(uint16_t sig2_value)
Update the CAN value for medium_one_shot_msg sig2.
Definition: can_scheduler.cc:525
void update_afe1_status_v2(uint16_t v2_value)
Update the CAN value for afe1_status v2.
Definition: can_scheduler.cc:334
void update_afe3_status_id(uint8_t id_value)
Update the CAN value for afe3_status id.
Definition: can_scheduler.cc:423
void update_afe2_status_temp(uint8_t temp_value)
Update the CAN value for afe2_status temp.
Definition: can_scheduler.cc:372
const std::string CAN_INTERFACE_NAME
Definition: can_scheduler.h:46
void update_afe1_status_v3(uint16_t v3_value)
Update the CAN value for afe1_status v3.
Definition: can_scheduler.cc:347
static const constexpr unsigned int SLOW_CYCLE_BCM_ID
Definition: can_scheduler.h:52
static const constexpr unsigned int MEDIUM_CAN_COMMUNICATION_MEDIUM_ONE_SHOT_MSG_FRAME_INDEX
Definition: can_scheduler.h:67
void update_cc_info_hazard_enabled(uint8_t hazard_enabled_value)
Update the CAN value for cc_info hazard_enabled.
Definition: can_scheduler.cc:642
void update_battery_info_fan2(uint8_t fan2_value)
Update the CAN value for battery_info fan2.
Definition: can_scheduler.cc:259
static const constexpr unsigned int SLOW_CYCLE_SPEED_MS
Definition: can_scheduler.h:50
void update_battery_status_fault_val(uint16_t fault_val_value)
Update the CAN value for battery_status fault_val.
Definition: can_scheduler.cc:157
void update_battery_info_min_cell_v(uint16_t min_cell_v_value)
Update the CAN value for battery_info min_cell_v.
Definition: can_scheduler.cc:284
void update_cc_info_regen_braking(uint8_t regen_braking_value)
Update the CAN value for cc_info regen_braking.
Definition: can_scheduler.cc:630
static const constexpr unsigned int FAST_CYCLE_BCM_ID
Definition: can_scheduler.h:54
static const constexpr unsigned int MEDIUM_BMS_CARRIER_BATTERY_STATUS_FRAME_INDEX
Definition: can_scheduler.h:66
struct can_frame frame[NUM_FAST_CYCLE_MESSAGES]
Definition: can_scheduler.h:83
static const constexpr unsigned int NUM_TOTAL_MESSAGES
Definition: can_scheduler.h:59
static const constexpr unsigned int SLOW_BMS_CARRIER_AFE3_STATUS_FRAME_INDEX
Definition: can_scheduler.h:75
void update_cc_info_cruise_control(uint8_t cruise_control_value)
Update the CAN value for cc_info cruise_control.
Definition: can_scheduler.cc:618
void update_cc_info_drive_state(uint8_t drive_state_value)
Update the CAN value for cc_info drive_state.
Definition: can_scheduler.cc:606
void update_afe2_status_v3(uint16_t v3_value)
Update the CAN value for afe2_status v3.
Definition: can_scheduler.cc:410
static const constexpr unsigned int FAST_CAN_COMMUNICATION_FAST_ONE_SHOT_MSG_FRAME_INDEX
Definition: can_scheduler.h:63
static const constexpr unsigned int NUM_SLOW_CYCLE_MESSAGES
Definition: can_scheduler.h:58
void update_cc_pedal_throttle_output(uint32_t throttle_output_value)
Update the CAN value for cc_pedal throttle_output.
Definition: can_scheduler.cc:564
void update_cc_info_target_velocity(uint32_t target_velocity_value)
Update the CAN value for cc_info target_velocity.
Definition: can_scheduler.cc:591
static const constexpr unsigned int SLOW_BMS_CARRIER_AFE2_STATUS_FRAME_INDEX
Definition: can_scheduler.h:74
static const constexpr unsigned int NUM_FAST_CYCLE_MESSAGES
Definition: can_scheduler.h:56
void update_cc_steering_input_lights(uint8_t input_lights_value)
Update the CAN value for cc_steering input_lights.
Definition: can_scheduler.cc:666
static const constexpr unsigned int MEDIUM_CENTRE_CONSOLE_CC_REGEN_PERCENTAGE_FRAME_INDEX
Definition: can_scheduler.h:70
void update_slow_one_shot_msg_sig2(uint16_t sig2_value)
Update the CAN value for slow_one_shot_msg sig2.
Definition: can_scheduler.cc:551
static const constexpr unsigned int FAST_BMS_CARRIER_BATTERY_VT_FRAME_INDEX
Definition: can_scheduler.h:62
static const constexpr unsigned int NUM_MEDIUM_CYCLE_MESSAGES
Definition: can_scheduler.h:57
void update_afe2_status_v2(uint16_t v2_value)
Update the CAN value for afe2_status v2.
Definition: can_scheduler.cc:397
void update_battery_status_afe_status(uint8_t afe_status_value)
Update the CAN value for battery_status afe_status.
Definition: can_scheduler.cc:183
struct CanScheduler::@14 canSlowCycleBCM
Slow cycle Broadcast Manager message for the Linux Kernel.
struct bcm_msg_head msg_head
Definition: can_scheduler.h:82
void update_afe2_status_id(uint8_t id_value)
Update the CAN value for afe2_status id.
Definition: can_scheduler.cc:360
int m_bcmCanSocket
Definition: can_scheduler.h:102
void update_battery_info_fan1(uint8_t fan1_value)
Update the CAN value for battery_info fan1.
Definition: can_scheduler.cc:247
void startCanScheduler()
Starts the CAN scheduler and sets all messages to 0. Must only be called once.
Definition: can_scheduler.cc:116
static const constexpr unsigned int MEDIUM_CENTRE_CONSOLE_CC_STEERING_FRAME_INDEX
Definition: can_scheduler.h:69
void update_fast_one_shot_msg_sig1(uint16_t sig1_value)
Update the CAN value for fast_one_shot_msg sig1.
Definition: can_scheduler.cc:486
static const constexpr unsigned int MEDIUM_CENTRE_CONSOLE_CC_INFO_FRAME_INDEX
Definition: can_scheduler.h:68
static const constexpr unsigned int SLOW_BMS_CARRIER_BATTERY_INFO_FRAME_INDEX
Definition: can_scheduler.h:72
void update_afe1_status_v1(uint16_t v1_value)
Update the CAN value for afe1_status v1.
Definition: can_scheduler.cc:321
void update_slow_one_shot_msg_sig1(uint16_t sig1_value)
Update the CAN value for slow_one_shot_msg sig1.
Definition: can_scheduler.cc:538
void update_cc_regen_percentage_percent(uint32_t percent_value)
Update the CAN value for cc_regen_percentage percent.
Definition: can_scheduler.cc:678
void scheduleCanMessages()
Schedules all CAN data by updating the Broacast Manager socket.
Definition: can_scheduler.cc:27
static const constexpr unsigned int MEDIUM_CYCLE_BCM_ID
Definition: can_scheduler.h:53
void update_battery_vt_voltage(uint16_t voltage_value)
Update the CAN value for battery_vt voltage.
Definition: can_scheduler.cc:195
void update_battery_vt_temperature(uint16_t temperature_value)
Update the CAN value for battery_vt temperature.
Definition: can_scheduler.cc:221
void update_afe1_status_id(uint8_t id_value)
Update the CAN value for afe1_status id.
Definition: can_scheduler.cc:297
static const constexpr unsigned int FAST_CENTRE_CONSOLE_CC_PEDAL_FRAME_INDEX
Definition: can_scheduler.h:64
static const constexpr unsigned int MAX_MESSAGE_LENGTH
Definition: can_scheduler.h:60
void update_afe1_status_temp(uint8_t temp_value)
Update the CAN value for afe1_status temp.
Definition: can_scheduler.cc:309
void update_fast_one_shot_msg_sig2(uint16_t sig2_value)
Update the CAN value for fast_one_shot_msg sig2.
Definition: can_scheduler.cc:499
static const constexpr unsigned int FAST_CYCLE_SPEED_MS
Definition: can_scheduler.h:48
struct CanScheduler::@12 canFastCycleBCM
Fast cycle Broadcast Manager message for the Linux Kernel.
struct CanScheduler::@13 canMediumCycleBCM
Medium cycle Broadcast Manager message for the Linux Kernel.
void update_afe3_status_v2(uint16_t v2_value)
Update the CAN value for afe3_status v2.
Definition: can_scheduler.cc:460
void update_cc_pedal_brake_output(uint8_t brake_output_value)
Update the CAN value for cc_pedal brake_output.
Definition: can_scheduler.cc:579
void update_afe3_status_v3(uint16_t v3_value)
Update the CAN value for afe3_status v3.
Definition: can_scheduler.cc:473