Skip to end of metadata
Go to start of metadata

This section describes the examples that are related to the Micrium OS Telnet server module.

Telnet Server Initialization Example

Description

This is a generic example that shows how to initialize the Telnet Server module. 

Configuration

Mandatory

The following #define must be added in ex_description.h to allow other examples to initialize the IPerf module correctly:

#define
Description
EX_TELNET_SERVER_INIT_AVAILLets the upper example layer know that the Telnet Server example is present and must be called by other examples.


Location

  • /examples/net/telnet/ex_telnet_server.c
  • /examples/net/telnet/ex_telnet_server.h

API

API
Description

Ex_TELNET_Server_Init()

Initialize the Micrium OS Telnet Server module for the example application.

Notes

None.

Telnet Server Instance Example

Description

This is a basic Telnet server examples that show how to start a Telnet server instance and execute commands from a remote client.

The example starts a Telnet server with default configuration and can execute commands loaded in Shell module.

It accomplishes the following tasks:

  • Create user 
  • Initialize the telnet server instance
  • Start the telnet server instance

Configuration

Optional

The following #define can be added to ex_description.h, as described in Example Applications section, to change default configuration value used by the example:

#define
Default value
Description
EX_TELNET_USERNAME 

"DUT"

Specify the username to access the telnet server
EX_TELNET_PASSWORD"micrium"Specify the password to access the telnet server
EX_TELNET_SERVER_SRV_TASK_STK_SIZE

TELNET_SERVER_TASK_CFG_STK_SIZE_ELEMENTS_DFLT

Specify a stack size for the telnet service task
EX_TELNET_SERVER_SRV_TASK_PRIOTELNET_SERVER_SRV_TASK_PRIO_DFLTSpecify a priority for the telnet service task
EX_TELNET_SERVER_SESSION_TASK_STK_SIZETELNET_SERVER_SESSION_TASK_CFG_STK_SIZE_ELEMENTS_DFLTSpecify a stack size for the telnet session task
EX_TELNET_SERVER_SESSION_TASK_PRIOTELNET_SERVER_SESSION_TASK_PRIO_DFLTSpecify a priority for the telnet session task

Location

  • /examples/net/telnet/ex_telnet_server.c
  • /examples/net/telnet/ex_telnet_server.h

API

API
Description

Ex_TELNET_Server_InstanceCreate()

Initializes and starts a default telnet server instance.

Notes

None.

Requirements

Target
  • Authentication module: See Authentication Module Programming Guide
    • Must create a user which will be used to log on Telnet server
       
  • Shell Module: See Shell Module Programming Guide
    • You can create your own function to be executed from telnet or can use a build in command provided by a module such as "ifconfig" provided by the Network core Module. 
PC
  • Your preferred Telnet client

Running the example

  1. Start your preferred telnet client and connect to the target using the IP address assigned to the target. See Starting a Network Interface for further information about how to retrieve target's IP address.
  2. Once the connection is accepted, the telnet server will ask for a user and a password.  Use the credential created as described in the Requirements.
  3. When successfully logged in, you will see the welcome message appear following by the command prompt. You can then execute any command loaded in the Shell module.