Introduction
Last updated
Last updated
This guide explains the Waspmote Frame features and functions. There are some variations in this library for our new product lines Waspmote v15 and Plug & Sense! v15, released on October 2016.
Some functions may not be compatible with Waspmote v12 or Plug & Sense! v12. Besides, old functions may no longer exist. If you are using previous versions of our products, please use the corresponding guides, available on our .
You can get more information about the generation change on the document "".
Differences of this library compared to the previous version:
New sensor field table and definitions which most of them are not compatible with former version
Some old sensor field definitions have been deprecated for Waspmote v15 because they are no longer needed
New frame type is used for both Binary and ASCII frame in Waspmote v15. Only new Meshlium devices will be able to receive frames from the new lines Waspmote v15 and Plug & Sense! v15
Some frame types have been deprecated because they are no longer needed
WaspFrame.h, WaspFrame.cpp, WaspFrameConstantsv12.h, WaspFrameConstantsv15.h
It is mandatory to include the WaspFrame library when using this class. The following line must be introduced at the beginning of the code:
Libelium recommends the use of the official Data Frame format, explained in this guide. It is especially good for the projects with a Meshlium, because it can parse frames in an automatic way thanks to the feature "Sensor Parser".
To start using the Waspmote Frame library, an object from the WaspFrame
class must be created. This object, called frame
, is created inside the Waspmote Frame library and it is public to all libraries. It is used through the guide to show how the Waspmote Frame library works.
When creating this constructor, some variables are defined with a value by default.
Through this guide there are many examples of the WaspFrame class usage. In these examples, library functions are called to execute the commands, storing in their related variables the parameter value in each case.
Example of use:
There are some predefined constants in a file called 'WaspFrame.h'. These constants define some parameters like the maximum size of each frame:
MAX_FRAME: (default value 255) specifies the maximum size of the frames to be created.
ASCII: this constant is used to define an ASCII frame mode.
BINARY: this constant is used to define a Binary frame mode.
ENCRYPTED_FRAME: this constant is used to define an encrypted frame.
Besides, there are sensor TAGs defined for each kind of sensor. These labels are used to set different fields inside the frame in order to distinguish between different sensor values and identify them.