#ifndef __ENCODER_H_ #define __ENCODER_H_ #include "icsneo/communication/message/message.h" #include "icsneo/communication/message/canmessage.h" #include "icsneo/communication/packet.h" #include "icsneo/communication/command.h" #include "icsneo/communication/network.h" #include "icsneo/communication/packetizer.h" #include #include #include namespace icsneo { class Encoder { public: Encoder(device_eventhandler_t report, std::shared_ptr p) : packetizer(p), report(report) {} bool encode(std::vector& result, const std::shared_ptr& message); bool encode(std::vector& result, Command cmd, bool boolean) { return encode(result, cmd, std::vector({ (uint8_t)boolean })); } bool encode(std::vector& result, Command cmd, std::vector arguments = {}); bool supportCANFD = false; private: std::shared_ptr packetizer; device_eventhandler_t report; }; } #endif