@@ -21,7 +21,6 @@ typedef enum _mb_comm_mode mb_mode_type_t;
21
21
22
22
#include "driver/uart.h"
23
23
24
- __attribute__((__packed__ ))
25
24
struct _port_serial_opts {
26
25
mb_mode_type_t mode ; /*!< Modbus communication mode */
27
26
uart_port_t port ; /*!< Modbus communication port (UART) number */
@@ -32,7 +31,7 @@ struct _port_serial_opts {
32
31
uart_word_length_t data_bits ; /*!< Modbus number of data bits */
33
32
uart_stop_bits_t stop_bits ; /*!< Modbus number of stop bits */
34
33
uart_parity_t parity ; /*!< Modbus UART parity settings */
35
- } ;
34
+ } __attribute__(( __packed__ )) ;
36
35
37
36
typedef struct _port_serial_opts mb_serial_opts_t ;
38
37
@@ -44,16 +43,15 @@ typedef enum _addr_type_enum {
44
43
MB_IPV6 = 2 /*!< TCP IPV6 addressing */
45
44
} mb_addr_type_t ;
46
45
47
- __attribute__(( __packed__ ))
46
+
48
47
struct _port_common_opts {
49
48
mb_mode_type_t mode ; /*!< Modbus communication mode */
50
49
uint16_t port ; /*!< Modbus communication port (UART) number */
51
50
uint8_t uid ; /*!< Modbus slave address field (dummy for master) */
52
51
uint32_t response_tout_ms ; /*!< Modbus slave response timeout */
53
52
uint64_t test_tout_us ; /*!< Modbus test timeout (reserved) */
54
- } ;
53
+ } __attribute__(( __packed__ )) ;
55
54
56
- __attribute__((__packed__ ))
57
55
struct _port_tcp_opts {
58
56
mb_mode_type_t mode ; /*!< Modbus communication mode */
59
57
uint16_t port ; /*!< Modbus communication port (UART) number */
@@ -65,7 +63,7 @@ struct _port_tcp_opts {
65
63
void * ip_netif_ptr ; /*!< Modbus network interface */
66
64
char * dns_name ; /*!< Modbus node DNS name */
67
65
bool start_disconnected ; /*!< (Master only option) do not wait for connection to all nodes before polling */
68
- } ;
66
+ } __attribute__(( __packed__ )) ;
69
67
70
68
typedef struct _port_tcp_opts mb_tcp_opts_t ;
71
69
@@ -100,7 +98,7 @@ typedef struct _uid_info {
100
98
uint16_t uid ; /*!< node unit ID (UID) field for MBAP frame */
101
99
uint16_t port ; /*!< node port number */
102
100
mb_comm_mode_t proto ; /*!< protocol type */
103
- _Atomic mb_sock_state_t state ; /*!< node state */
101
+ atomic_int state ; /*!< node state */
104
102
void * inst ; /*!< pointer to linked instance */
105
103
} mb_uid_info_t ;
106
104
0 commit comments