mirror of https://github.com/ArduPilot/ardupilot
SITL: allow disabling CAN interfaces
Also corrects an issue where setting an invalid type could result in undefined behavior.
This commit is contained in:
parent
501d0d8759
commit
ca0cd9a7e8
|
@ -133,7 +133,7 @@ const AP_Param::GroupInfo SIM::var_info[] = {
|
|||
// @Param: CAN_TYPE1
|
||||
// @DisplayName: transport type for first CAN interface
|
||||
// @Description: transport type for first CAN interface
|
||||
// @Values: 0:MulticastUDP,1:SocketCAN
|
||||
// @Values: 0:None,1:MulticastUDP,2:SocketCAN
|
||||
// @User: Advanced
|
||||
AP_GROUPINFO("CAN_TYPE1", 30, SIM, can_transport[0], uint8_t(CANTransport::MulticastUDP)),
|
||||
#endif
|
||||
|
@ -142,7 +142,7 @@ const AP_Param::GroupInfo SIM::var_info[] = {
|
|||
// @Param: CAN_TYPE2
|
||||
// @DisplayName: transport type for second CAN interface
|
||||
// @Description: transport type for second CAN interface
|
||||
// @Values: 0:MulticastUDP,1:SocketCAN
|
||||
// @Values: 0:None,1:MulticastUDP,2:SocketCAN
|
||||
// @User: Advanced
|
||||
AP_GROUPINFO("CAN_TYPE2", 31, SIM, can_transport[1], uint8_t(CANTransport::MulticastUDP)),
|
||||
#endif
|
||||
|
|
|
@ -229,8 +229,9 @@ public:
|
|||
|
||||
#if HAL_NUM_CAN_IFACES
|
||||
enum class CANTransport : uint8_t {
|
||||
MulticastUDP = 0,
|
||||
SocketCAN = 1
|
||||
None = 0,
|
||||
MulticastUDP = 1,
|
||||
SocketCAN = 2,
|
||||
};
|
||||
AP_Enum<CANTransport> can_transport[HAL_NUM_CAN_IFACES];
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue