|
@ -64,11 +64,11 @@ AT_STATUS at_cmd_test(unsigned char *p, unsigned char len) |
|
|
AT_STATUS at_cmd_ip(unsigned char *p, unsigned char len) |
|
|
AT_STATUS at_cmd_ip(unsigned char *p, unsigned char len) |
|
|
{ |
|
|
{ |
|
|
ip4_addr_t int_addr; |
|
|
ip4_addr_t int_addr; |
|
|
// char *ip_address; |
|
|
|
|
|
// ip_address = (char *)malloc(len); |
|
|
|
|
|
// memcpy(ip_address, p, len); |
|
|
|
|
|
// printf("ip_address:%s\r\n", ip_address); |
|
|
|
|
|
inet_aton("192.168.8.10", &int_addr); |
|
|
|
|
|
|
|
|
char *ip_address; |
|
|
|
|
|
ip_address = (char *)malloc(len); |
|
|
|
|
|
memcpy(ip_address, p, len); |
|
|
|
|
|
printf("ip_address:%s\r\n", ip_address); |
|
|
|
|
|
inet_aton(ip_address, &int_addr); |
|
|
printf("int_addr:%d\r\n", int_addr.addr); |
|
|
printf("int_addr:%d\r\n", int_addr.addr); |
|
|
if (*p == '?') |
|
|
if (*p == '?') |
|
|
{ |
|
|
{ |
|
@ -80,7 +80,7 @@ AT_STATUS at_cmd_ip(unsigned char *p, unsigned char len) |
|
|
// printf("ip address:%s\r\n", p); |
|
|
// printf("ip address:%s\r\n", p); |
|
|
printf("AT+OK\r\n"); |
|
|
printf("AT+OK\r\n"); |
|
|
} |
|
|
} |
|
|
// free(ip_address); |
|
|
|
|
|
|
|
|
free(ip_address); |
|
|
return AT_SUCCESS; |
|
|
return AT_SUCCESS; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|