Encoder allowed to fail, preparation for upcoming CAN transmit

This commit is contained in:
Paul Hollinsky
2018-10-18 13:42:20 -04:00
parent 92839c22a5
commit 912b11ce30
4 changed files with 24 additions and 21 deletions
+3 -3
View File
@@ -18,9 +18,9 @@ namespace icsneo {
class Encoder {
public:
Encoder(std::shared_ptr<Packetizer> packetizerInstance) : packetizer(packetizerInstance) {}
std::vector<uint8_t> encode(const std::shared_ptr<Message>& message);
std::vector<uint8_t> encode(Command cmd, bool boolean) { return encode(cmd, std::vector<uint8_t>({ (uint8_t)boolean })); }
std::vector<uint8_t> encode(Command cmd, std::vector<uint8_t> arguments = {});
bool encode(std::vector<uint8_t>& result, const std::shared_ptr<Message>& message);
bool encode(std::vector<uint8_t>& result, Command cmd, bool boolean) { return encode(result, cmd, std::vector<uint8_t>({ (uint8_t)boolean })); }
bool encode(std::vector<uint8_t>& result, Command cmd, std::vector<uint8_t> arguments = {});
private:
std::shared_ptr<Packetizer> packetizer;