Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagecpp
titleTelnet standard mode initialization code
CPU_BOOLEAN AppTELNETs_Init (void)
{
	CPU_BOOLEAN          success;
    NET_SOCK_ADDR_FAMILY ip_family; 
 
    ip_family = NET_SOCK_ADDR_FAMILY_IP_V4; 		                                 		 (1)
 
	printf("Initialize telnet server...\n\r");
	success = TELNETs_Init(ip_family, DEF_NULL);                                            (2)
                    
	if (success == DEF_OK) {           
		printf("TELNET server successfully initialized\n\r");      
	} else { 
		printf("TELNET server initialization failed\n\r");         
	}
	return (success)
}


Panel
bgColor#f0f0f0
  1. µC/TELNETs works either IPv4 or IPv6, but not both at the same time. During the initialization, the user must specified the IP family :  
        NET_SOCK_ADDR_FAMILY_IP_V4
    NET_SOCK_ADDR_FAMILY_IP_V6
  2. Initialization of the µC/TELNETs module with secure mode disabled. When this function returns, the system is ready to accept standard connection requests from clients.