nana

CANMsg.h

Committer:
kurobikari
Date:
2021-09-01
Revision:
5:d037e8c6ce88
Parent:
4:5017a65ff423

File content as of revision 5:d037e8c6ce88:


#include "CAN.h"

class CANMsg : public mbed::CANMessage
{
public:
    /** Creates empty CAN message.
     */
    CANMsg() :
        CANMessage(){ }

    /** Creates CAN message with specific content.
     */
    CANMsg(int _id, const char *_data, char _len = 8, CANType _type = CANData, CANFormat _format = CANStandard) :
        CANMessage(_id, _data, _len, _type, _format){ }

    /** Creates CAN remote message.
     */
    CANMsg(int _id, CANFormat _format = CANStandard) :
        CANMessage(_id, _format){ }

    /** Clears CAN message content
     */
    void clear(void) {
        len    = 0;
        type   = CANData;
        format = CANStandard;
        id     = 0;
        memset(data, 0, 8);
    };
};