mbfunc.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. * SPDX-FileCopyrightText: 2006 Christian Walter
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. *
  6. * SPDX-FileContributor: 2016-2021 Espressif Systems (Shanghai) CO LTD
  7. */
  8. /*
  9. * FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU.
  10. * Copyright (c) 2006 Christian Walter <wolti@sil.at>
  11. * All rights reserved.
  12. *
  13. * Redistribution and use in source and binary forms, with or without
  14. * modification, are permitted provided that the following conditions
  15. * are met:
  16. * 1. Redistributions of source code must retain the above copyright
  17. * notice, this list of conditions and the following disclaimer.
  18. * 2. Redistributions in binary form must reproduce the above copyright
  19. * notice, this list of conditions and the following disclaimer in the
  20. * documentation and/or other materials provided with the distribution.
  21. * 3. The name of the author may not be used to endorse or promote products
  22. * derived from this software without specific prior written permission.
  23. *
  24. * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  25. * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  26. * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  27. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  28. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  29. * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  30. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  31. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  32. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  33. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  34. *
  35. * File: $Id: mbfunc.h,v 1.12 2006/12/07 22:10:34 wolti Exp $
  36. */
  37. #ifndef _MB_FUNC_H
  38. #define _MB_FUNC_H
  39. #ifdef __cplusplus
  40. PR_BEGIN_EXTERN_C
  41. #endif
  42. #if MB_FUNC_OTHER_REP_SLAVEID_BUF > 0
  43. eMBException eMBFuncReportSlaveID( UCHAR * pucFrame, USHORT * usLen );
  44. #endif
  45. #if MB_FUNC_READ_INPUT_ENABLED > 0
  46. eMBException eMBFuncReadInputRegister( UCHAR * pucFrame, USHORT * usLen );
  47. #endif
  48. #if MB_FUNC_READ_HOLDING_ENABLED > 0
  49. eMBException eMBFuncReadHoldingRegister( UCHAR * pucFrame, USHORT * usLen );
  50. #endif
  51. #if MB_FUNC_WRITE_HOLDING_ENABLED > 0
  52. eMBException eMBFuncWriteHoldingRegister( UCHAR * pucFrame, USHORT * usLen );
  53. #endif
  54. #if MB_FUNC_WRITE_MULTIPLE_HOLDING_ENABLED > 0
  55. eMBException eMBFuncWriteMultipleHoldingRegister( UCHAR * pucFrame, USHORT * usLen );
  56. #endif
  57. #if MB_FUNC_READ_COILS_ENABLED > 0
  58. eMBException eMBFuncReadCoils( UCHAR * pucFrame, USHORT * usLen );
  59. #endif
  60. #if MB_FUNC_WRITE_COIL_ENABLED > 0
  61. eMBException eMBFuncWriteCoil( UCHAR * pucFrame, USHORT * usLen );
  62. #endif
  63. #if MB_FUNC_WRITE_MULTIPLE_COILS_ENABLED > 0
  64. eMBException eMBFuncWriteMultipleCoils( UCHAR * pucFrame, USHORT * usLen );
  65. #endif
  66. #if MB_FUNC_READ_DISCRETE_INPUTS_ENABLED > 0
  67. eMBException eMBFuncReadDiscreteInputs( UCHAR * pucFrame, USHORT * usLen );
  68. #endif
  69. #if MB_FUNC_READWRITE_HOLDING_ENABLED > 0
  70. eMBException eMBFuncReadWriteMultipleHoldingRegister( UCHAR * pucFrame, USHORT * usLen );
  71. #endif
  72. #ifdef __cplusplus
  73. PR_END_EXTERN_C
  74. #endif
  75. #endif