|
Tezzeret
1
Tezzeret
|
This document briefly describes how the application handles WiFi startup. It provides little detail, except to provide pointers to a few files and objects in the code that can be used in an editor or in a debugger to gain a good understanding of the subject. Because that approach (browsing the code and using a debugger) is very easy and fully informative for this subject, no additional documentation work is planned. Wired ethernet startup is described in EthernetStartup.
This describes the startup for the CC3100 chip in applications with the main file TezzeretApp.cpp.
A Tiva-based board, using the CC3100 WiFi chip
WiFi startup occurs in 2 stages:
Core startup happens in 3 main stages:
To trace the core startup process, look for the WiFi semaphores in TezzeretApp.cpp. The process bounces between a few different threads, but it's not hard to trace the process; just look for the semaphore posts and pends.
If the WiFi does not initialize correctly, the process will not freeze in the main thread of execution, but will log error messages if possible and continue into the rest of the application functionality (limited of course by the lack of functioning WiFi).
When the CC3100 connects to another system or disconnects, events are inserted into a queue, to be handled in a loop in the function setupwifiConnection(). The events are handled in setupwifiConnection, by starting and stopping various network daemons as well as doing any other wifi tasks.
The queue-based approach is needed because the various events and tasks often occur with some delay, so that a pure interrupt-style approach to the handling might break some of the ordering invariants.