ByteStream.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * Copyright (C) 2007-2018 Siemens AG
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU Lesser General Public License as published
  6. * by the Free Software Foundation, either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public License
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. */
  17. /*******************************************************************
  18. *
  19. * @author Daniel.Peintner.EXT@siemens.com
  20. * @version 2017-03-02
  21. * @contact Richard.Kuntschke@siemens.com
  22. *
  23. * <p>Code generated by EXIdizer</p>
  24. * <p>Schema: V2G_CI_MsgDef.xsd</p>
  25. *
  26. *
  27. ********************************************************************/
  28. /**
  29. * \file ByteStream.h
  30. * \brief Byte Stream utilities
  31. *
  32. */
  33. #ifndef BYTE_STREAM_H
  34. #define BYTE_STREAM_H
  35. #ifdef __cplusplus
  36. extern "C" {
  37. #endif
  38. #include "EXITypes.h"
  39. /**
  40. * \brief Write bytes to file
  41. *
  42. * \param data byte array
  43. * \param len length
  44. * \param filename File name
  45. * \return Error-Code <> 0
  46. *
  47. */
  48. int writeBytesToFile(uint8_t* data, size_t len, const char * filename);
  49. /**
  50. * \brief Read bytes from file
  51. *
  52. * \param filename File name
  53. * \param data byte array
  54. * \param size byte array size
  55. * \param pos byte array position
  56. * \return Error-Code <> 0
  57. *
  58. */
  59. int readBytesFromFile(const char * filename, uint8_t* data, size_t size, size_t* pos);
  60. #ifdef __cplusplus
  61. }
  62. #endif
  63. #endif /* BYTE_STREAM_H */