![]() |
NetBurner 3.3.9
PDF Version |
The NetBurner Programming Guide is intended to provide an overview of the features and capabilities of the NetBurner Network Development Kit. The primary goal of this guide is to provide a brief explanation of common network applications and illustrate how you can implement these applications using NetBurner hardware, software and development tools. Prerequisites for this guide:
The approach of this guide is to learn by example. The first program example, called Template, can be used as a starting point for most applications, and each application in this guide uses it as a base.
Source code for the examples in this document are located in the \nburn\examples
directory of your NetBurner tools installation.
This documentation applies to the following version of the NNDK, which utilizes the listed external tools and libraries.
NetBurner Network Development Kit Tools 3.3.2
wolfSSL 4.3 Utilized by the SSL/TLS library.
GNU GCC 8.1 The documentation for this compiler can be found can be found here.
We will start with a basic application created with the NBEclipse Application Wizard. If you are not familiar with creating an application or NBEclipse please refer to the NBEclipse Getting Started Guide before continuing. When running the Application Wizard select the Standard Initialization and Web server options. Once the project is complete, you should have a main.cpp file as shown below:
The system will automatically start the RTOS and UserMain() as a its own task. This simple application is a fully functional network application with a web server.
The init() function will do the following:
The WaitForActiveNetwork() function will wait for an active network link before proceeding, up until the specified timeout.
StartHttp() starts the web server. The default port is 80. If you wish to start on a different port you can specify the port number as a parameter to the function.
The system supports printf()
and iprintf()
. The iprintf()
function (i = integer only) will consume less system resources if you do not need floating point support.
Your application should never return from UserMain()
; the while() loop will run forever. The
should be used with the delay function in case the system ticks per second value is ever modified.