NetBurner 3.3
Initialization - System Initialization Functions

Functions

void init ()
 System initialization. Normally called at the beginning of all applications. More...
 
void StartHttp (uint16_t port=80)
 Start the HTTP web server. More...
 
void StartHttps (uint16_t ssl_port=443, uint16_t http_port=80)
 Start the HTTPS secure web server. More...
 
bool WaitForActiveNetwork (uint32_t ticks_to_wait=120 *TICKS_PER_SECOND, int interface=-1)
 Wait for an active network connection on at least one interface. More...
 
void EnableSecureConfigServer (bool bHSTS)
 Enable the minimal http config server to operate over TLS. More...
 

Detailed Description

Function Documentation

◆ EnableSecureConfigServer()

void EnableSecureConfigServer ( bool  bHSTS)

Enable the minimal http config server to operate over TLS.

Due to the nature of the server operating on a non-standard HTTP port, a client (such as a webbrowser) cannot infer whether to utilize TLS unless explicitly told to do so. Therefore, the secure configuration server has two modes it can operate in: a less secure, more compliant manner that allows both plaintext and TLS secured transactions and a HSTS (Http Strict Transport Security) mode that will only respond to plaintext requests with a redirect indicating the TLS requirement.

Parameters
bHSTSWhether the SecureConfigServer should disallow non-secure requests
Returns
nothing

◆ init()

void init ( )

System initialization. Normally called at the beginning of all applications.

Initialize the system including the following:

  • Enable interrupt driven stdio
  • Read the configuration record and set parameters accordingly. If the configuration speficies DHCP, start the DHCP Client. All interfaces will be checked.
  • Initialize the network stack
  • Start the configuration server for both web and serial
  • Assign the UserMain() task priority to MAIN_PRIO
  • Enable the Task Monitor diagnostic tool
  • Initialize the GDB stub if in debug mode
Returns
nothing

◆ StartHttp()

void StartHttp ( uint16_t  port = 80)

Start the HTTP web server.

If no parameters are specified it will listen on port 80, and enable the configuration mirror feature so an application can create it's own custom configuration web page.

Parameters
portListen port, defaults to port 80
Returns
nothing
See also
StartHttps(), StopHttp()

◆ StartHttps()

void StartHttps ( uint16_t  ssl_port = 443,
uint16_t  http_port = 80 
)

Start the HTTPS secure web server.

If no parameters are specified the web server will listen on ports 443 and 80, and enable the configuration mirror feature so an application can create it's own custom configuration web page. If no user key is installed the default system key will be used.

Parameters
ssl_portSecure listen port, defaults to port 443
http_portNon-secure listen port, defaults to port 80
Returns
nothing
See also
StartHttp(), StopHttp()

If no parameters are specified, the web server will listen on ports 443 and 80, and enable the configuration mirror feature so an application can create it's own custom configuration web page. If no user certificate/key is installed, the default system key will be used.

Default parameter values defined in init.h

Parameters
ssl_portSecure listen port, defaults to port 443
http_portNon-secure listen port, defaults to port 80
Returns
nothing
See also
StartHttp(), StopHttp()

◆ WaitForActiveNetwork()

bool WaitForActiveNetwork ( uint32_t  ticks_to_wait = 120 *TICKS_PER_SECOND,
int  interface = -1 
)

Wait for an active network connection on at least one interface.

If DHCP is enabled it will wait for a lease. If static IP parameters are configured it will wait for link.

Parameters
ticks_to_waitNumber of system time ticks to wait. Default is 120 seconds.
interfaceInterface number to check. Default is -1, which checks all interfaces.
Returns
nothing