frame.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Copyright 2016-2022 Michael Zillgith
  3. *
  4. * This file is part of lib60870-C
  5. *
  6. * lib60870-C is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * lib60870-C is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with lib60870-C. If not, see <http://www.gnu.org/licenses/>.
  18. *
  19. * See COPYING file for the complete license text.
  20. */
  21. #ifndef SRC_INC_FRAME_H_
  22. #define SRC_INC_FRAME_H_
  23. #include <stdint.h>
  24. #include "iec60870_common.h"
  25. typedef struct sFrameVFT* FrameVFT;
  26. struct sFrameVFT {
  27. void (*destroy)(Frame self);
  28. void (*resetFrame)(Frame self);
  29. void (*setNextByte)(Frame self, uint8_t byte);
  30. void (*appendBytes)(Frame self, const uint8_t* bytes, int numberOfBytes);
  31. int (*getMsgSize)(Frame self);
  32. uint8_t* (*getBuffer)(Frame self);
  33. int (*getSpaceLeft)(Frame self);
  34. };
  35. #endif /* SRC_INC_FRAME_H_ */