Class that provides APIs to add, update, and access SmartStart List. Also it offers callback for notifying that entries await inclusion.
More...
#include <smartstart_management.hpp>
Class that provides APIs to add, update, and access SmartStart List. Also it offers callback for notifying that entries await inclusion.
◆ Management() [1/2]
smartstart::Management::Management |
( |
| ) |
|
|
privatedefault |
◆ Management() [2/2]
smartstart::Management::Management |
( |
Management & |
other | ) |
|
|
delete |
Disable assign and constructor.
◆ get_cache()
const std::unordered_map< std::string, Entry > & smartstart::Management::get_cache |
( |
| ) |
const |
◆ get_cache_entries()
std::vector< Entry > smartstart::Management::get_cache_entries |
( |
const Query & |
query | ) |
|
Get the cache entries with given query conditions.
- Parameters
-
query | Query criterias defined for searching. |
◆ get_instance()
static Management * smartstart::Management::get_instance |
( |
| ) |
|
|
static |
Get the singleton instance.
◆ has_entries_awaiting_inclusion()
bool smartstart::Management::has_entries_awaiting_inclusion |
( |
| ) |
|
Polling function which returns True if there is any entries with Include == true. This could be useful e.g. when just boot.
◆ init()
Initialize function that takes protocol controller unid and a callback function signaling when entries awaits inclusion.
- Parameters
-
protocol_controller_unid | Protocol Controller Unid as string in which this SmartStart Management belongs to. |
has_entries_awaiting_inclusion_callback | Function callback regsitered and called when there are entries awaiting inclusion in the SmartStart List. |
◆ notify_node_added()
sl_status_t smartstart::Management::notify_node_added |
( |
const std::string & |
dsk, |
|
|
const std::string & |
device_unid |
|
) |
| |
Called when a node has been added and SSM will then update the cache map.
- Parameters
-
dsk | DSK as string to be added. |
device_unid | Device Unid as string to be updated in the corresponding entry. |
◆ notify_node_removed()
sl_status_t smartstart::Management::notify_node_removed |
( |
const std::string & |
unid | ) |
|
Called when a node has been removed and SSM will then update the cache map.
- Parameters
-
unid | Unid as string to be removed. |
◆ operator=()
void smartstart::Management::operator= |
( |
const Management & |
| ) |
|
|
delete |
◆ set_manual_intervention_required()
sl_status_t smartstart::Management::set_manual_intervention_required |
( |
const std::string & |
dsk, |
|
|
bool |
manual_intervention_required |
|
) |
| |
Call this function to change the value of the "ManualInterventionRequired" field.
- Parameters
-
dsk | DSK of the entry to be modified |
manual_intervention_required | Set to true if the entry needs some network exclusion before it can join our network. False otherwise |
- Returns
- SL_STATUS_OK if the entry was updated SL_STATUS_NOT_FOUND If the DSK is not in the list. SL_STATUS_FAIL If the DSK returns more than 1 entry in the list
◆ teardown()
◆ update_smartstart_cache()
sl_status_t smartstart::Management::update_smartstart_cache |
( |
const std::string & |
smartstart_list | ) |
|
Update the internal cache of SmartStartList.
This function parses the SmartStartList to internal representation, stores the data in smartstart_cache, and signals other components if there are entries waiting for inclusion for the protocol controller by calling notify_has_entries_for_inclusion.
- Parameters
-
smartstart_list | String with JSON representation of SmartStart list. |
◆ _instance
◆ _notify_has_entries_awaiting_inclusion
Function called when there are entries waiting for inclusion in the SmartStart list.
◆ _protocol_controller_unid
std::string smartstart::Management::_protocol_controller_unid |
|
private |
◆ _smartstart_cache
std::unordered_map<std::string, Entry> smartstart::Management::_smartstart_cache |
|
private |
SmartStart List cache map, key is DSK as a string.
The documentation for this class was generated from the following file: