#include <Loom_Manager.h>
Unifies all the various sensors to allow for collection in unison This class manages the JSON document store of all sensor information
- Author
- Will Richards
◆ Manager()
Manager::Manager |
( |
const char * |
devName, |
|
|
uint32_t |
instanceNum |
|
) |
| |
Constructs a new Manager
- Parameters
-
devName | Device name to provided for logging purposes |
instanceNum | Instance number for logging purposes |
◆ addData()
template<typename T >
void Manager::addData |
( |
const char * |
moduleName, |
|
|
const char * |
dataName, |
|
|
T |
data |
|
) |
| |
|
inline |
Add a random piece of data to the overall JSON package in the given module name with a name for the data
- Parameters
-
moduleName | Module name to store the data under |
dataName | Key name of the data we are inserting |
data | The data itself |
◆ beginSerial()
void Manager::beginSerial |
( |
bool |
waitForSerial = true | ) |
|
Start the Serial interface with some parameters, should we wait up to 20 seconds for the serial interface to open before continuing
- Parameters
-
waitForSerial | Whether or not we should wait 20 seconds for the user to open the serial monitor before continuing |
◆ display_data()
void Manager::display_data |
( |
| ) |
|
Prints out the current JSON Document to the Serial bus
◆ get_data_object()
JsonObject Manager::get_data_object |
( |
const char * |
moduleName | ) |
|
Get the JSON object to store the module data in
- Parameters
-
moduleName | Name of the module we are trying to store data for |
◆ get_device_name()
const char * Manager::get_device_name |
( |
| ) |
|
|
inline |
Gets the current device name set by the user
- Returns
- current device name
◆ get_instance_num()
int Manager::get_instance_num |
( |
| ) |
|
|
inline |
Gets the current device instance number
- Returns
- current device instance number
◆ get_packet_number()
int Manager::get_packet_number |
( |
| ) |
|
|
inline |
Get the current packet number that will be packaged by the manager
◆ get_serial_num()
const char * Manager::get_serial_num |
( |
| ) |
|
|
inline |
Get the unique serial number of the Feather m0
- Returns
- Unique serial number
◆ getDocument()
DynamicJsonDocument & Manager::getDocument |
( |
| ) |
|
Get a reference to the JSON document that sensor data is stored in
- Returns
- reference to the main JSON document
◆ getJSONString()
void Manager::getJSONString |
( |
char |
array[2000] | ) |
|
Get a serialized version of the JSON packet as a string
- Parameters
-
array | Array to store the string in |
◆ initialize()
void Manager::initialize |
( |
| ) |
|
Calls the initialization function on all added modules
◆ measure()
void Manager::measure |
( |
| ) |
|
Calls the measure function to pull data from the sensors on all added modules
◆ package()
void Manager::package |
( |
| ) |
|
Calls the package function to store all data from those sensors into a nice JSON package
◆ pause()
void Manager::pause |
( |
const uint32_t |
ms | ) |
const |
Pause execution for a specified length of time
- Parameters
-
ms | Time to wait for in milliseconds |
◆ power_down()
void Manager::power_down |
( |
| ) |
|
Calls the power_down function on each module to safely enter sleep
◆ power_up()
void Manager::power_up |
( |
| ) |
|
Calls the power_up function on each module to re-init after sleep
◆ registerModule()
void Manager::registerModule |
( |
Module * |
module | ) |
|
Registers a new sub-module to be controlled by the manager (Used on sensors so measure and package calls can all be called at once)
- Parameters
-
module | Pointer to a class the inherits from Module that we want to add |
◆ set_device_name()
void Manager::set_device_name |
( |
const char * |
name | ) |
|
|
inline |
Set the device name at runtime
- Parameters
-
name | New name of the device |
◆ set_instance_num()
void Manager::set_instance_num |
( |
int |
num | ) |
|
|
inline |
Set the instance number at runtime
- Parameters
-
num | New instance number of the device |
◆ setEnableState()
void Manager::setEnableState |
( |
bool |
state | ) |
|
|
inline |
Set the current state of the hypnos enable
- Parameters
-
state | New state of the hypnos board |
◆ useHypnos()
void Manager::useHypnos |
( |
| ) |
|
|
inline |
Called by the Hypnos on construction to tell the manager it is in use
The documentation for this class was generated from the following files:
- C:/Users/jwilt/AppData/Local/Arduino15/packages/loom4/hardware/samd/4.5/libraries/Loom/src/Loom_Manager.h
- C:/Users/jwilt/AppData/Local/Arduino15/packages/loom4/hardware/samd/4.5/libraries/Loom/src/Loom_Manager.cpp