Added support for WNC M14A2A Cellular LTE Data Module.

Dependencies:   WNC14A2AInterface

Dependents:   http-example-wnc http-example-wnc-modified

Embed: (wiki syntax)

« Back to documentation index

SPIRIT_PktStack.h File Reference

SPIRIT_PktStack.h File Reference

Configuration and management of SPIRIT STack packets. More...

Go to the source code of this file.


Detailed Description

Configuration and management of SPIRIT STack packets.

Author:
VMA division - AMS
Version:
3.2.2
Date:
08-July-2015

This module can be used to manage the configuration of Spirit STack packets, and it is quite similar to the Basic packets one since the STack packets can be considered an extension of Basic. The user can obtain a packet configuration filling the structure PktStackInit, defining in it some general parameters for the Spirit STack packet format. Another structure the user can fill is PktStackAddressesInit to define the addresses which will be used during the communication. The structure PktStackLlpInit is provided in order to configure the link layer protocol features like autoack, autoretransmission or piggybacking. Moreover, functions to set the payload length and the destination address are provided.

Example:

 PktStackInit stackInit={
   PKT_PREAMBLE_LENGTH_08BYTES,       // preamble length in bytes
   PKT_SYNC_LENGTH_4BYTES,            // sync word length in bytes
   0x1A2635A8,                        // sync word
   PKT_LENGTH_VAR,                    // variable or fixed payload length
   7,                                 // length field width in bits (used only for variable length)
   PKT_NO_CRC,                        // CRC mode
   PKT_CONTROL_LENGTH_0BYTES,         // control field length
   S_DISABLE,                         // FEC
   S_ENABLE                           // whitening
 };

 PktStackAddressesInit addressInit={
   S_ENABLE,                          // enable/disable filtering on my address
   0x34,                              // my address (address of the current node)
   S_DISABLE,                         // enable/disable filtering on multicast address
   0xEE,                              // multicast address
   S_DISABLE,                         // enable/disable filtering on broadcast address
   0xFF                               // broadcast address
 };

 PktStackLlpInit stackLLPInit ={
   S_DISABLE,                         // enable/disable the autoack feature
   S_DISABLE,                         // enable/disable the piggybacking feature
   PKT_DISABLE_RETX                   // set the max number of retransmissions or disable them
 };
 ...

 SpiritPktStackInit(&stackInit);
 SpiritPktStackAddressesInit(&addressInit);
 SpiritPktStackLlpInit(&stackLLPInit);

 ...

 SpiritPktStackSetPayloadLength(20);
 SpiritPktStackSetDestinationAddress(0x44);

 ...

The module provides some other functions that can be used to modify or read only some configuration parameters.

Attention:

© COPYRIGHT(c) 2015 STMicroelectronics

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file SPIRIT_PktStack.h.