Building and Running Sample Application
This section describes all the steps required to build a TELNETs-based application. The instructions provided in this section are not intended for any particular toolchain, but instead are described in a generic way that can be adapted to any toolchain.
The best way to start building a TELNETs-based project is to start from an existing µC/TCP-IP project.
Working project with µC/TCP-IP
The first step before including the µC/TELNETs is to have a working project with the µC/TCP-IP. As previously mentioned, Micriµm may offer starting example with µC/OS-III kernels and µC/TCP-IP and even with µC/TELNETs for many evaluation boards.
If no project that include µC/TCP-IP is available, you should follow the µC/TCP-IP - Getting Started Guide to start with a working TCP/IP project before starting integrating µC/TELNETs. Then you can follow the following steps to build and run your first µC/TELNETs sample application.
Including Additional Modules to the Project
Once you have a working project with your RTOS and µC/TCP-IP additional modules are needed by the Micriµm TELNET server Module that are not necessarily already included in your project. Therefore, be sure to add µC/CPU and µC/LIB to your project.
Refer to the following manuals for further information about MIcrium modules:.
Optional module
µC/TELNETs comes with a set of command that can be executed from a shell command line tool. If you want to use it you have to include µC/Shell to your project:
Including µC/TELNETs Source Code
Include the following files in your project tree from the µC/TELNETs source code distribution, as indicated in Figure - µC/TELNETs Source Code.
As indicated in the Figure - µC/TELNETs Source Code, all the files in the Source folder must be added to your project tree.
Compiler settings
Finally, add the following include paths to your project’s C compiler settings:
\Micrium\Software\uC-TELNETs
\Micrium\Software\uC-TCPIP
\Micrium\Software\uC-Shell (optional if uC/Shell is used)
Copying and Modifying Template Files
Copy the files from the µC-TELNETs configuration folder into your application as illustrated in Figure - µC/TELNETs Copying Template Files.
telnet-s_cfg.h
define µC/TELNETs module static parameters and run-time configuration structure. Refer to sectionModule Configuration for more details on all the configurations inside templates files.
Modifying the HEAP memory configuration
The µC/TELNETs Module uses additional heap memory space. Therefore, it is possible that your sample application will require more allocation of heap memory. If ti is the case, you can increase the HEAP memory size of your sample project, refer to µC/LIB Memory Heap Configuration for more details on the heap usage.
Adding µC/TELNETs application function
Before running the sample application, you will need to add the new function call, in your application file to initialize and setup the µC/TELNETs module. Section Sample Application gives an example of how to initialize µC/TELNETs and launch a TELNETs server.
This code example will need to be modified in accordance with your project.
Adding Additional includes
When you initialize µC/TELNETs and where call API you need to include the following files.
#include <Source/telnet-s.h>