MCPcopy Create free account
hub / github.com/BlueAndi/Pixelix / unregisterTopic

Method unregisterTopic

lib/TopicHandlerService/src/TopicHandlerService.cpp:350–375  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

348}
349
350void TopicHandlerService::unregisterTopic(const String& deviceId, const String& entityId, const String& topic, bool purge)
351{
352 if ((false == deviceId.isEmpty()) &&
353 (false == topic.isEmpty()))
354 {
355 uint8_t idx = 0U;
356 uint8_t count = 0U;
357 ITopicHandler** topicHandlerList = TopicHandlers::getList(count);
358
359 /* Unregister topic by every known topic handler. */
360 while (count > idx)
361 {
362 ITopicHandler* handler = topicHandlerList[idx];
363
364 if (nullptr != handler)
365 {
366 handler->unregisterTopic(deviceId, entityId, topic, purge);
367 }
368
369 ++idx;
370 }
371
372 /* If topic is stored for automatic publishing, it will be removed. */
373 removeFromTopicMetaDataList(deviceId, entityId, topic);
374 }
375}
376
377/******************************************************************************
378 * Protected Methods

Callers 1

stopMethod · 0.45

Calls 1

isEmptyMethod · 0.45

Tested by

no test coverage detected