Skip to content

CAN messages set to extended by default in only one constructorΒ #1178

@calebchalmers

Description

@calebchalmers

Inside can_message.hpp, there are three constructors for modm::can::Message: The first one leaves the message data initialized with all zeros and keep the default flags; this results in extended being true by default. The remaining two constructors allow for initializing with data and have an extended parameter which is false by default.

I realize this is a relatively small and breaking change, but I think it would be ideal if extended was always false by default, and if the first constructor had an extended parameter, to avoid having to declare an extra array like this:

uint8_t inData[8]{};  // all zeros array
modm::can::Message message(MESSAGE_IDENTIFIER, MESSAGE_LENGTH, inData, false);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions