#ifndef ISO_TP_FRAME #define ISO_TP_FRAME #include enum FrameType { // Explicit values, so it is apparent they correspond to the appropriate type values SF = 0, FF = 1, CF = 2, FC = 3 }; class Frame { FrameType type; unsigned char index; unsigned int size; unsigned int data_size; unsigned char* data; void parse_frame_str(const unsigned char* iso_tp_frame); void free(); void copyFrom(const Frame& other); public: Frame(const char* iso_tp_frame); /* Rule of 4 */ Frame() = default; ~Frame(); Frame(const Frame& other); Frame& operator=(const Frame& other); /* Getters */ FrameType get_type() const; unsigned char get_index() const; unsigned int get_size() const; unsigned int get_data_size() const; const unsigned char* get_data() const; /* IO */ friend std::ostream& operator<<(std::ostream& os, const Frame& f); }; std::ostream& operator<<(std::ostream& os, const Frame& f); #endif /* ISO_TP_FRAME */