| 
    Bluenet
    5.7.0
    
   Bluenet, firmware for nRF52 smart home devices 
   | 
 
Class that takes care of synchronizing the asset filters between crownstones. More...
#include <cs_AssetFilterSyncer.h>


Public Member Functions | |
| cs_ret_code_t | init () | 
| Init the class:  More... | |
| void | handleEvent (event_t &evt) | 
| Internal usage.  More... | |
  Public Member Functions inherited from EventListener | |
| EventListener () | |
| virtual | ~EventListener () | 
| unregisters the listener.  More... | |
| virtual void | handleEvent (event_t &event)=0 | 
| Handle events.  More... | |
| void | listen () | 
| Registers this with the EventDispatcher.  More... | |
  Public Member Functions inherited from Component | |
| template<class T > | |
| T * | getComponent (Component *requester=nullptr) | 
| Returns a component of type T* from _parent->children(), If not found try again with ancestors: _parent-> ... ->_parent->children().  More... | |
| virtual cs_ret_code_t | init () | 
| Components can implement this if they need to get references to sibling or if they need to do specific initialization.  More... | |
| void | parentAllChildren () | 
| utility that loops over all elements of getChildren() and setParent on the non-nullptr ones.  More... | |
| virtual | ~Component ()=default | 
Static Public Attributes | |
| static constexpr uint16_t | VERSION_BROADCAST_NORMAL_INTERVAL_SECONDS = 5 * 60 | 
| Interval at which the master version is broadcasted.  More... | |
| static constexpr uint16_t | VERSION_BROADCAST_LOW_INTERVAL_SECONDS = 1 | 
| static constexpr uint16_t | VERSION_BROADCAST_INTERVAL_RESET_SECONDS = 60 | 
| How long the low interval will be used after setting it to low interval.  More... | |
Private Types | |
| enum class | SyncStep {  NONE , CONNECT , GET_FILTER_SUMMARIES , REMOVE_FILTERS , UPLOAD_FILTERS , COMMIT , DISCONNECT }  | 
| Async steps that are taken when synchronizing filters to another crownstone.  More... | |
| enum class | VersionCompare { UNKOWN , OLDER , EQUAL , NEWER } | 
| Results of comparing master version with another crownstone.  More... | |
Private Member Functions | |
| void | sendVersion (bool reliable) | 
| Sends the master version and CRC over the mesh.  More... | |
| void | sendVersionAtLowInterval () | 
| Send version at a low interval for some time.  More... | |
| void | setStep (SyncStep step) | 
| Set the current step of the sync process.  More... | |
| void | reset () | 
| Abort the sync process.  More... | |
| VersionCompare | compareToMyVersion (asset_filter_cmd_protocol_t protocol, uint16_t masterVersion, uint32_t masterCrc) | 
| Compare given master version with the master version of this crownstone.  More... | |
| void | syncFilters (stone_id_t stoneId) | 
| Start updating filters of another crownstone.  More... | |
| void | connect (stone_id_t stoneId) | 
| Steps of the sync process.  More... | |
| void | removeNextFilter () | 
| void | uploadNextFilter () | 
| void | commit () | 
| void | disconnect () | 
| void | done () | 
| When the whole sync process to a stone was successful, call done().  More... | |
| cs_ret_code_t | onVersion (stone_id_t stoneId, cs_mesh_model_msg_asset_filter_version_t &packet) | 
| Handle a received version mesh message.  More... | |
| void | onModificationInProgress (bool inProgress) | 
| Handle a possible change of "filter modification in progress".  More... | |
| void | onConnectResult (cs_ret_code_t retCode) | 
| Handle steps of the sync process.  More... | |
| void | onDisconnect () | 
| void | onWriteResult (cs_central_write_result_t &result) | 
| void | onFilterSummaries (cs_data_t &payload) | 
| void | onTick (uint32_t tickCount) | 
| Handle the tick event.  More... | |
Private Attributes | |
| AssetFilterStore * | _store = nullptr | 
| Pointer to the (intialized) filter store.  More... | |
| SyncStep | _step = SyncStep::NONE | 
| Current step.  More... | |
| uint8_t | _nextFilterIndex | 
| Next index of filter IDs to upload/remove array.  More... | |
| uint16_t | _nextChunkIndex | 
| Next chunk index to upload.  More... | |
| uint8_t | _filterIdsToUpload [AssetFilterStore::MAX_FILTER_IDS] | 
| Filter IDs that should be uploaded.  More... | |
| uint8_t | _filterUploadCount | 
| uint8_t | _filterIdsToRemove [AssetFilterStore::MAX_FILTER_IDS] | 
| Filter IDs that should be removed.  More... | |
| uint8_t | _filterRemoveCount | 
| uint16_t | _sendVersionAtLowIntervalCountdown = 0 | 
| Countdown counter that keeps track when the send version interval should go back to normal again.  More... | |
| uint16_t | _sendVersionCountdown = 0 | 
| Countdown counter that keeps track when to call sendVersion again.  More... | |
Additional Inherited Members | |
  Protected Member Functions inherited from Component | |
| virtual std::vector< Component * > | getChildren () | 
| Components with children can override this method to return them.  More... | |
| cs_ret_code_t | initChildren () | 
| void | setParent (Component *p) | 
| Children that are instantiated later can also be added individually.  More... | |
Class that takes care of synchronizing the asset filters between crownstones.
      
  | 
  strongprivate | 
      
  | 
  strongprivate | 
      
  | 
  private | 
      
  | 
  private | 
Compare given master version with the master version of this crownstone.
      
  | 
  private | 
Steps of the sync process.
      
  | 
  private | 
      
  | 
  private | 
When the whole sync process to a stone was successful, call done().
      
  | 
  virtual | 
Internal usage.
Implements EventListener.
      
  | 
  virtual | 
      
  | 
  private | 
Handle steps of the sync process.
      
  | 
  private | 
      
  | 
  private | 
      
  | 
  private | 
Handle a possible change of "filter modification in progress".
      
  | 
  private | 
Handle the tick event.
      
  | 
  private | 
Handle a received version mesh message.
      
  | 
  private | 
      
  | 
  private | 
      
  | 
  private | 
Abort the sync process.
      
  | 
  private | 
Sends the master version and CRC over the mesh.
      
  | 
  private | 
Send version at a low interval for some time.
      
  | 
  private | 
Set the current step of the sync process.
      
  | 
  private | 
Start updating filters of another crownstone.
      
  | 
  private | 
      
  | 
  private | 
Filter IDs that should be removed.
      
  | 
  private | 
Filter IDs that should be uploaded.
      
  | 
  private | 
      
  | 
  private | 
      
  | 
  private | 
Next chunk index to upload.
      
  | 
  private | 
Next index of filter IDs to upload/remove array.
      
  | 
  private | 
Countdown counter that keeps track when the send version interval should go back to normal again.
      
  | 
  private | 
Countdown counter that keeps track when to call sendVersion again.
      
  | 
  private | 
Current step.
      
  | 
  private | 
Pointer to the (intialized) filter store.
      
  | 
  staticconstexpr | 
How long the low interval will be used after setting it to low interval.
      
  | 
  staticconstexpr | 
      
  | 
  staticconstexpr | 
Interval at which the master version is broadcasted.