-12-
v7.0
General considerations
4. General considerations
4.1. Waspmote libraries
4.1.1. Waspmote SX1272 files
WaspSX1272.h, WaspSX1272.cpp
It is mandatory to include the SX1272 library when using this module. The following line must be introduced at the beginning
of the code:
#include <WaspSX1272.h>
4.1.2. Constructor
To start using the Waspmote SX1272 library, an object from class
WaspSX1272
must be created. This object, called
sx1272
,
is created inside the Waspmote SX1272 library and it is public to all libraries. It is used through the guide to show how the
Waspmote SX1272 library works.
When creating this object, some variables are defined with a value by default.
4.2. API functions
Through the guide there are many examples of using parameters. In these examples, API functions are called to execute the
commands, storing in their related variables the parameter value in each case.
Example of use:
{
sx1272.getPreambleLength(); // Gets the preamble length that is going to be send
}
Related variables:
sx1272._preamblelength
→
stores the preamble length
When returning from
sx1272.getPreambleLength()
the variable
sx1272._preamblelength
will be filled with the
appropriate values.
Before calling the function, the related variable is created but it is empty.
All the functions return a flag to know if the function called was successful or not. Available values for this flag:
•
0 : Success. The function was executed without errors and the variable was filled.
•
1 : Error. The function was executed but an error occurred while executing.
•
2 : Not executed. An error occurred before executing the function.
•
-1 : Function not allowed in this mode.