VanGo
High-Rate Data Acquisition System
»Home
»Download
»Install
»Brief Intro
System Overview

Initialization

Before the VanGo applications can run, the framework initializes the application. First, the basic modules are started - TimerC and GenericComm; these are TinyOS specific modules that control the underlying hardware. Next, ReliableSendC, ReliableReceiveC, ControlM, and ControlUnpacketizerM is initialized in that order.

ReliableSendC and ReliableReceiveC

ReliableSendC and ReliableReceiveC use already initialized GenericComm to send and receive messages between the mote and the microserver.

ControlM

ControlM is the core initialization component for VanGo. It is responsible for initializing the BufferPool - used for memory management - the SampleSet, the Sampler, and finally all of the filters.

BufferPool

BufferPool is responsible for maintaining all of the dynamically allocated memory in a VanGo application. There are two different BufferPool implimantations. There is a microserver version that uses malloc to allocate memory and there is a mote version that is described below.

At compile time, the user instructs the BufferPool to allocate a specified amount of space for three different buffers; all of this is expressed in the application SnackConstats file.

Example: vango/apps/AuricleDemo2/SnackConstants.h
...
#define BufferPoolM____bigSize (512)
#define BufferPoolM____smallSize (32)
#define BufferPoolM____packetSize (sizeof(TOS_Msg))
#define BufferPoolM____bigCount (5)
#define BufferPoolM____smallCount (16)
#define BufferPoolM____packetCount (28)
...

BufferPool can allocate only these three discrete buffer sizes. A request that falls between these three numbers will result in an allocation of a buffer that will satisfy the request but will leave memory unused. This allocation scheme was chosen to reduce the complexity of the memory allocator. This choice is justified because the majority of the memory allocations are either packets, small attribute buffers, or large SampleSets. The number of buffers per buffer type is calculated empirically and evaluated by the performance of the system. Too few "big" buffers will reduce the amount of SampleSets allowed at any time in the filter chain reducing the effective frequency of the Sampler (collected data will be discarded due to lack of memory). Too many "big" buffers will reduce the amount of memory available for packet construction at the end of the chain resulting in lost packets.

At complie time, BufferPool creates one large buffer that holds all the individual buffers: the dynamic memory pool. During initialization, BufferPool divides the pool among the different buffers and sets guard bytes in each unallocated buffer so that the pool can be checked for errors at a latter time.

SampleSetM

The SampleSet does not to need to initialize because it is a collection of functions that help manage SampleSets.

Sampler

During initialization, the Sampler takes as an argument the number of channels that will be sampled and initializes the ADC.

Filters

Filters are initialized by setting the default filter parameter values described in the SnackConstants file. Since the typical filter has an enable FilterControl parameter, it acts as the initialization function.

ControlUnpacketizerM

ControlUnpacketizerM sets up to receive control messages from the microserver and forward them to the ControlM modules to actuate the filters.