mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Rename IP_ADDR_LEN to IPV4_ADDR_LEN.
This commit is contained in:
parent
4a0e2f042b
commit
9fd585f304
@ -67,7 +67,7 @@ static int client_fd = -1;
|
||||
static int server_fd = -1;
|
||||
static int udpbcast_fd = -1;
|
||||
static int udpbcast_time = 0;
|
||||
static uint8_t ip_addr[WINC_IP_ADDR_LEN] = {};
|
||||
static uint8_t ip_addr[WINC_IPV4_ADDR_LEN] = {};
|
||||
static char udpbcast_string[UDPCAST_STRING_SIZE] = {};
|
||||
static winc_socket_buf_t sockbuf;
|
||||
|
||||
@ -98,7 +98,7 @@ int wifidbg_init(wifidbg_config_t *config)
|
||||
return -3;
|
||||
}
|
||||
|
||||
memcpy(ip_addr, ifconfig.ip_addr, WINC_IP_ADDR_LEN);
|
||||
memcpy(ip_addr, ifconfig.ip_addr, WINC_IPV4_ADDR_LEN);
|
||||
|
||||
} else { // AP Mode
|
||||
|
||||
@ -115,7 +115,7 @@ int wifidbg_init(wifidbg_config_t *config)
|
||||
return -2;
|
||||
}
|
||||
|
||||
memcpy(ip_addr, SERVER_ADDR, WINC_IP_ADDR_LEN);
|
||||
memcpy(ip_addr, SERVER_ADDR, WINC_IPV4_ADDR_LEN);
|
||||
}
|
||||
|
||||
snprintf(udpbcast_string, UDPCAST_STRING_SIZE, UDPCAST_STRING,
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
#define __WINC_H__
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#define WINC_IP_ADDR_LEN (4)
|
||||
#define WINC_IPV4_ADDR_LEN (4)
|
||||
#define WINC_MAC_ADDR_LEN (6)
|
||||
#define WINC_MAX_SSID_LEN (33)
|
||||
#define WINC_MAX_PSK_LEN (65)
|
||||
@ -51,10 +51,10 @@ typedef enum {
|
||||
} winc_security_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t ip_addr[WINC_IP_ADDR_LEN];
|
||||
uint8_t subnet_addr[WINC_IP_ADDR_LEN];
|
||||
uint8_t gateway_addr[WINC_IP_ADDR_LEN];
|
||||
uint8_t dns_addr[WINC_IP_ADDR_LEN];
|
||||
uint8_t ip_addr[WINC_IPV4_ADDR_LEN];
|
||||
uint8_t subnet_addr[WINC_IPV4_ADDR_LEN];
|
||||
uint8_t gateway_addr[WINC_IPV4_ADDR_LEN];
|
||||
uint8_t dns_addr[WINC_IPV4_ADDR_LEN];
|
||||
} winc_ifconfig_t;
|
||||
|
||||
typedef struct {
|
||||
|
||||
@ -316,10 +316,10 @@ static void wifi_callback_sta(uint8_t msg_type, void *msg)
|
||||
ip_obtained = true;
|
||||
async_request_done = true;
|
||||
tstrM2MIPConfig *ipconfig = (tstrM2MIPConfig*)msg;
|
||||
memcpy(ifconfig.ip_addr, &ipconfig->u32StaticIP, WINC_IP_ADDR_LEN);
|
||||
memcpy(ifconfig.subnet_addr, &ipconfig->u32SubnetMask, WINC_IP_ADDR_LEN);
|
||||
memcpy(ifconfig.gateway_addr, &ipconfig->u32Gateway, WINC_IP_ADDR_LEN);
|
||||
memcpy(ifconfig.dns_addr, &ipconfig->u32DNS, WINC_IP_ADDR_LEN);
|
||||
memcpy(ifconfig.ip_addr, &ipconfig->u32StaticIP, WINC_IPV4_ADDR_LEN);
|
||||
memcpy(ifconfig.subnet_addr, &ipconfig->u32SubnetMask, WINC_IPV4_ADDR_LEN);
|
||||
memcpy(ifconfig.gateway_addr, &ipconfig->u32Gateway, WINC_IPV4_ADDR_LEN);
|
||||
memcpy(ifconfig.dns_addr, &ipconfig->u32DNS, WINC_IPV4_ADDR_LEN);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -564,10 +564,10 @@ int winc_ifconfig(winc_ifconfig_t *rifconfig, bool set)
|
||||
memcpy(&ifconfig, rifconfig, sizeof(winc_ifconfig_t));
|
||||
} else {
|
||||
// Copy the ifconfig info stored from the DHCP request.
|
||||
memcpy(rifconfig->ip_addr, ifconfig.ip_addr, WINC_IP_ADDR_LEN);
|
||||
memcpy(rifconfig->subnet_addr, ifconfig.subnet_addr, WINC_IP_ADDR_LEN);
|
||||
memcpy(rifconfig->gateway_addr, ifconfig.gateway_addr, WINC_IP_ADDR_LEN);
|
||||
memcpy(rifconfig->dns_addr, ifconfig.dns_addr, WINC_IP_ADDR_LEN);
|
||||
memcpy(rifconfig->ip_addr, ifconfig.ip_addr, WINC_IPV4_ADDR_LEN);
|
||||
memcpy(rifconfig->subnet_addr, ifconfig.subnet_addr, WINC_IPV4_ADDR_LEN);
|
||||
memcpy(rifconfig->gateway_addr, ifconfig.gateway_addr, WINC_IPV4_ADDR_LEN);
|
||||
memcpy(rifconfig->dns_addr, ifconfig.dns_addr, WINC_IPV4_ADDR_LEN);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user