@@ -21,7 +21,6 @@ typedef enum _mb_comm_mode mb_mode_type_t;
2121
2222#include "driver/uart.h"
2323
24- __attribute__((__packed__ ))
2524struct _port_serial_opts {
2625 mb_mode_type_t mode ; /*!< Modbus communication mode */
2726 uart_port_t port ; /*!< Modbus communication port (UART) number */
@@ -32,7 +31,7 @@ struct _port_serial_opts {
3231 uart_word_length_t data_bits ; /*!< Modbus number of data bits */
3332 uart_stop_bits_t stop_bits ; /*!< Modbus number of stop bits */
3433 uart_parity_t parity ; /*!< Modbus UART parity settings */
35- } ;
34+ } __attribute__(( __packed__ )) ;
3635
3736typedef struct _port_serial_opts mb_serial_opts_t ;
3837
@@ -44,16 +43,15 @@ typedef enum _addr_type_enum {
4443 MB_IPV6 = 2 /*!< TCP IPV6 addressing */
4544} mb_addr_type_t ;
4645
47- __attribute__(( __packed__ ))
46+
4847struct _port_common_opts {
4948 mb_mode_type_t mode ; /*!< Modbus communication mode */
5049 uint16_t port ; /*!< Modbus communication port (UART) number */
5150 uint8_t uid ; /*!< Modbus slave address field (dummy for master) */
5251 uint32_t response_tout_ms ; /*!< Modbus slave response timeout */
5352 uint64_t test_tout_us ; /*!< Modbus test timeout (reserved) */
54- } ;
53+ } __attribute__(( __packed__ )) ;
5554
56- __attribute__((__packed__ ))
5755struct _port_tcp_opts {
5856 mb_mode_type_t mode ; /*!< Modbus communication mode */
5957 uint16_t port ; /*!< Modbus communication port (UART) number */
@@ -65,7 +63,7 @@ struct _port_tcp_opts {
6563 void * ip_netif_ptr ; /*!< Modbus network interface */
6664 char * dns_name ; /*!< Modbus node DNS name */
6765 bool start_disconnected ; /*!< (Master only option) do not wait for connection to all nodes before polling */
68- } ;
66+ } __attribute__(( __packed__ )) ;
6967
7068typedef struct _port_tcp_opts mb_tcp_opts_t ;
7169
@@ -100,7 +98,7 @@ typedef struct _uid_info {
10098 uint16_t uid ; /*!< node unit ID (UID) field for MBAP frame */
10199 uint16_t port ; /*!< node port number */
102100 mb_comm_mode_t proto ; /*!< protocol type */
103- _Atomic mb_sock_state_t state ; /*!< node state */
101+ atomic_int state ; /*!< node state */
104102 void * inst ; /*!< pointer to linked instance */
105103} mb_uid_info_t ;
106104
0 commit comments