iec60870_master.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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_IEC60870_MASTER_H_
  22. #define SRC_IEC60870_MASTER_H_
  23. #include <stdint.h>
  24. #include <stdbool.h>
  25. #include "iec60870_common.h"
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29. /**
  30. * \file iec60870_master.h
  31. * \brief Common master side definitions for IEC 60870-5-101/104
  32. * These types are used by CS101/CS104 master
  33. */
  34. /**
  35. * \brief Callback handler for received ASDUs
  36. *
  37. * This callback handler will be called for each received ASDU.
  38. * The CS101_ASDU object that is passed is only valid in the context
  39. * of the callback function.
  40. *
  41. * \param parameter user provided parameter
  42. * \param address address of the sender (slave/other station) - undefined for CS 104
  43. * \param asdu object representing the received ASDU
  44. *
  45. * \return true if the ASDU has been handled by the callback, false otherwise
  46. */
  47. typedef bool (*CS101_ASDUReceivedHandler) (void* parameter, int address, CS101_ASDU asdu);
  48. #ifdef __cplusplus
  49. }
  50. #endif
  51. #endif /* SRC_IEC60870_MASTER_H_ */