@@ -1061,6 +1061,10 @@ struct timeval {
1061
1061
#define MG_SET_MAC_ADDRESS (mac )
1062
1062
#endif
1063
1063
1064
+ #ifndef MG_TCPIP_DHCPNAME_SIZE
1065
+ #define MG_TCPIP_DHCPNAME_SIZE 18 // struct mg_tcpip_if :: dhcp_name size
1066
+ #endif
1067
+
1064
1068
#ifndef MG_SET_WIFI_CONFIG
1065
1069
#define MG_SET_WIFI_CONFIG (data )
1066
1070
#endif
@@ -3082,19 +3086,20 @@ typedef void (*mg_tcpip_event_handler_t)(struct mg_tcpip_if *ifp, int ev,
3082
3086
void *ev_data);
3083
3087
3084
3088
enum {
3085
- MG_TCPIP_EV_ST_CHG, // state change uint8_t * (&ifp->state)
3086
- MG_TCPIP_EV_DHCP_DNS, // DHCP DNS assignment uint32_t *ipaddr
3087
- MG_TCPIP_EV_DHCP_SNTP, // DHCP SNTP assignment uint32_t *ipaddr
3088
- MG_TCPIP_EV_ARP, // Got ARP packet struct mg_str *
3089
- MG_TCPIP_EV_TIMER_1S, // 1 second timer NULL
3090
- MG_TCPIP_EV_WIFI_SCAN_RESULT, // Wi-Fi scan results struct mg_wifi_scan_bss_data *
3091
- MG_TCPIP_EV_WIFI_SCAN_END, // Wi-Fi scan has finished NULL
3092
- MG_TCPIP_EV_WIFI_CONNECT_ERR, // Wi-Fi connect has failed driver and chip specific
3093
- MG_TCPIP_EV_DRIVER, // Driver event driver specific
3094
- MG_TCPIP_EV_USER // Starting ID for user events
3089
+ MG_TCPIP_EV_ST_CHG, // state change uint8_t * (&ifp->state)
3090
+ MG_TCPIP_EV_DHCP_DNS, // DHCP DNS assignment uint32_t *ipaddr
3091
+ MG_TCPIP_EV_DHCP_SNTP, // DHCP SNTP assignment uint32_t *ipaddr
3092
+ MG_TCPIP_EV_ARP, // Got ARP packet struct mg_str *
3093
+ MG_TCPIP_EV_TIMER_1S, // 1 second timer NULL
3094
+ MG_TCPIP_EV_WIFI_SCAN_RESULT, // Wi-Fi scan results struct
3095
+ // mg_wifi_scan_bss_data *
3096
+ MG_TCPIP_EV_WIFI_SCAN_END, // Wi-Fi scan has finished NULL
3097
+ MG_TCPIP_EV_WIFI_CONNECT_ERR, // Wi-Fi connect has failed driver and
3098
+ // chip specific
3099
+ MG_TCPIP_EV_DRIVER, // Driver event driver specific
3100
+ MG_TCPIP_EV_USER // Starting ID for user events
3095
3101
};
3096
3102
3097
-
3098
3103
// Network interface
3099
3104
struct mg_tcpip_if {
3100
3105
uint8_t mac[6 ]; // MAC address. Must be set to a valid MAC
@@ -3114,8 +3119,8 @@ struct mg_tcpip_if {
3114
3119
mg_tcpip_event_handler_t fn; // User-specified event handler function
3115
3120
struct mg_mgr *mgr; // Mongoose event manager
3116
3121
struct mg_queue recv_queue; // Receive queue
3117
- char dhcp_name[12 ]; // Name reported to DHCP, "mip" if unset
3118
- uint16_t mtu; // Interface MTU
3122
+ char dhcp_name[MG_TCPIP_DHCPNAME_SIZE ]; // Name for DHCP, "mip" if unset
3123
+ uint16_t mtu; // Interface MTU
3119
3124
#define MG_TCPIP_MTU_DEFAULT 1500
3120
3125
3121
3126
// Internal state, user can use it but should not change it
@@ -3168,7 +3173,6 @@ struct mg_tcpip_spi {
3168
3173
uint8_t (*txn)(void *, uint8_t ); // SPI transaction: write 1 byte, read reply
3169
3174
};
3170
3175
3171
-
3172
3176
#endif
3173
3177
3174
3178
0 commit comments