Blame view

3rdparty/libmodbus/modbus-rtu-private.h 762 Bytes
500c015a   Peter M. Groen   Setting up workin...
1
  
783ce3c5   Peter M. Groen   Setting up workin...
2
  #pragma once
500c015a   Peter M. Groen   Setting up workin...
3
  
500c015a   Peter M. Groen   Setting up workin...
4
  #include <stdint.h>
500c015a   Peter M. Groen   Setting up workin...
5
  #include <termios.h>
500c015a   Peter M. Groen   Setting up workin...
6
7
8
9
10
11
12
  
  #define _MODBUS_RTU_HEADER_LENGTH      1
  #define _MODBUS_RTU_PRESET_REQ_LENGTH  6
  #define _MODBUS_RTU_PRESET_RSP_LENGTH  2
  
  #define _MODBUS_RTU_CHECKSUM_LENGTH    2
  
783ce3c5   Peter M. Groen   Setting up workin...
13
14
  typedef struct _modbus_rtu
  {
500c015a   Peter M. Groen   Setting up workin...
15
16
17
18
19
20
21
22
23
24
      /* Device: "/dev/ttyS0", "/dev/ttyUSB0" or "/dev/tty.USA19*" on Mac OS X. */
      char *device;
      /* Bauds: 9600, 19200, 57600, 115200, etc */
      int baud;
      /* Data bit */
      uint8_t data_bit;
      /* Stop bit */
      uint8_t stop_bit;
      /* Parity: 'N', 'O', 'E' */
      char parity;
500c015a   Peter M. Groen   Setting up workin...
25
26
      /* Save old termios settings */
      struct termios old_tios;
783ce3c5   Peter M. Groen   Setting up workin...
27
  
500c015a   Peter M. Groen   Setting up workin...
28
29
30
  #if HAVE_DECL_TIOCSRS485
      int serial_mode;
  #endif
783ce3c5   Peter M. Groen   Setting up workin...
31
  
500c015a   Peter M. Groen   Setting up workin...
32
33
34
      /* To handle many slaves on the same link */
      int confirmation_to_ignore;
  } modbus_rtu_t;