Hello. I'm trying to connect a server with DNS name. I found an example about that in the wikia page of LwIP but I didn't understand it completely.
I can connect my local computer with static ip and messaging with TCP.
I tried to implement the Raw/Native api sample (
LwIP wikia) but I didn't understand what is SMTP and where can I find or how can I define it. So the dns_gethostbyname() function always returns ERR_INPROGRESS. I'm new in LwIP and TCP.
Here is my Netif_Config and other functions;
static void Netif_Config(void)
{
ip_addr_t ipaddr;
ip_addr_t netmask;
ip_addr_t gw;
#ifndef LWIP_DNS
#ifdef USE_DHCP
ipaddr.addr = 0;
netmask.addr = 0;
gw.addr = 0;
#else
// default ip address settins
IP4_ADDR(&ipaddr, IPADDR0, IPADDR1, IPADDR2, IPADDR3);
IP4_ADDR(&netmask, NMADDR0, NMADDR1, NMADDR2, NMADDR3);
IP4_ADDR(&gw, GWADDR0, GWADDR1, GWADDR2, GWADDR3);
#endif
#else
switch(dns_gethostbyname(DNS_HOST_NAME, &ipaddr, smtp_serverFound, NULL))
{
case ERR_OK:
// I didn't find any smpt defined something or any extern variable has a name smtp
break;
case ERR_INPROGRESS:
break;
default:
break;
}
#endif
/*.. other initializations..*/
}
void SMTP_serverFound(const char *dns_name, const ip_addr_t *ip, void *args)
{
if ((ip) && (ip->addr))
{
/*again there are some smtp processes but.......*/
}
}
I'm confused about that implementation. How can I get that code working? I've searched it but didn't find anything.
Thanks.