link_layer_paramete.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * link_layer_parameters.h
  3. *
  4. * Copyright 2017-2022 Michael Zillgith
  5. *
  6. * This file is part of lib60870-C
  7. *
  8. * lib60870-C is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * lib60870-C is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with lib60870-C. If not, see <http://www.gnu.org/licenses/>.
  20. *
  21. * See COPYING file for the complete license text.
  22. */
  23. #ifndef SRC_IEC60870_LINK_LAYER_LINK_LAYER_PARAMETERS_H_
  24. #define SRC_IEC60870_LINK_LAYER_LINK_LAYER_PARAMETERS_H_
  25. #include <stdbool.h>
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29. /**
  30. * \file link_layer_parameters.h
  31. *
  32. * \brief Parameters for serial link layers
  33. */
  34. /** \brief Parameters for the IEC 60870-5 link layer */
  35. typedef struct sLinkLayerParameters* LinkLayerParameters;
  36. struct sLinkLayerParameters {
  37. int addressLength; /** Length of link layer address (1 or 2 byte) */
  38. int timeoutForAck; /** timeout for link layer ACK in ms */
  39. int timeoutRepeat; /** timeout for repeated message transmission when no ACK received in ms */
  40. bool useSingleCharACK; /** use single char ACK for ACK (FC=0) or RESP_NO_USER_DATA (FC=9) */
  41. int timeoutLinkState; /** interval to repeat request status of link (FC=9) after response timeout */
  42. };
  43. #ifdef __cplusplus
  44. }
  45. #endif
  46. #endif /* SRC_IEC60870_LINK_LAYER_LINK_LAYER_PARAMETERS_H_ */