autowp / arduino-canhacker

CanHacker (lawicel) CAN adapter on Arduino + MCP2515
MIT License
372 stars 114 forks source link

Extended can id error. #19

Open unrealex opened 2 years ago

unrealex commented 2 years ago

Hi,

Thanks for your hard work.

When I send extended can id ex: 0x0CF50401 the CAN MODULE actually sends 0x0EF50401

In CanHacker.cpp changed line 97.


CanHacker::ERROR CanHacker::writeCan(const struct can_frame *frame) {
    if (mcp2515->sendMessage(MCP2515::TXB1,frame) != MCP2515::ERROR_OK) { //added MCP2515::TXB1, 0x0CF50401
        return ERROR_MCP2515_SEND;
    }

    return ERROR_OK;
}

PS: Don't know about std ids only use ext.