Specifications

1–22 Chapter 1: Using the NicheStack TCP/IP Stack
Important NicheStack TCP/IP Stack Concepts
Using the NicheStack TCP/IP Stack - Nios II Edition Tutorial June 2011 Altera Corporation
Calls
SSS_handle_receive()
to serve the TCP/IP connection. If you require
multiple TCP/IP connections, you can modify this task to create other tasks that
handle each individual TCP/IP connection.
Calls
SSS_reset_connection()
,
SSS_send_menu()
, and
SSS_exec_command()
.
When the
SSSNiosIISimpleSocketServerTask()
task receives data packets, the
task extracts, and passes the LED commands to
LEDManagementTask()
via the
SSSLEDCommandQ
.
The following list describes the LED tasks (located in leds.c):
The
LEDManagementTask()
task consumes and processes LED commands received
on the
SSSLEDCommandQ
. The task reads the
SSSLEDCommandQ
for an incoming
message command from
SSSNiosIISimpleSocketServerTask()
, converts the
command to an LED pulse rate, and posts the pulse rate to the
SSSLEDFreqMailbox
mailbox for the
LEDBlinkTask()
task.
LEDBlinkTask()
blinks the LED based on the pulse rate the
LEDManagementTask()
task sets in the MicroC/OS-II
SSSLEDFreqMailbox
mailbox.
Important NicheStack TCP/IP Stack Concepts
The following topics could have a significant impact on your design.
Error Handling
A suite of error-handling functions defined in
alt_error_handler()
check error
handling of the Nios II Simple Socket Server application, NicheStack TCP/IP Stack,
and MicroC-OS/II system call error-codes. All system, socket, and application calls
check for error conditions whenever an error could exist.
NicheStack TCP/IP Stack Default Task Creation
The NicheStack TCP/IP Stack creates one or more system level tasks during system
initialization, when you call the
netmain()
function. Users have complete control over
these system level tasks through a global configuration file named ipport.h, located in
the directory structure for the BSP project, in the iniche/src/h/nios2 folder.
You can edit the
#define
statements in ipport.h to configure the following options for
the NicheStack TCP/IP Stack:
Module Inclusion—Identifies which built-in NicheStack modules should be
started
Module Priority—Identifies what MicroC/OS-II priority the module task should
use
Module Stack Size—Identifies what MicroC/OS-II stack size the module should
use
f For more information about other NicheStack TCP/IP Stack options that can be
enabled at run-time, refer to the NicheStack TCP/IP Stack documentation in
NicheStackRef.zip located in the <Nios II EDS install
path>/components/altera_iniche/UCOSII/31src directory.