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

Method hasTopicChanged

lib/MultiIconPlugin/src/MultiIconPlugin.cpp:216–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214}
215
216bool MultiIconPlugin::hasTopicChanged(const String& topic)
217{
218 bool hasTopicChanged = false;
219
220 if (true == topic.startsWith(String(TOPIC_SLOT) + "/"))
221 {
222 uint8_t slotId = _MultiIconPlugin::View::MAX_ICON_SLOTS;
223 bool status = getSlotIdFromTopic(slotId, topic);
224
225 if ((true == status) &&
226 (_MultiIconPlugin::View::MAX_ICON_SLOTS > slotId))
227 {
228 MutexGuard<MutexRecursive> guard(m_mutex);
229
230 hasTopicChanged = m_slots[slotId].hasSlotChanged;
231 m_slots[slotId].hasSlotChanged = false;
232 }
233 }
234 else if (true == topic.equals(TOPIC_SLOTS))
235 {
236 MutexGuard<MutexRecursive> guard(m_mutex);
237
238 hasTopicChanged = m_hasTopicSlotsChanged;
239 m_hasTopicSlotsChanged = false;
240 }
241 else
242 {
243 ;
244 }
245
246 return hasTopicChanged;
247}
248
249void MultiIconPlugin::start(uint16_t width, uint16_t height)
250{

Callers

nothing calls this directly

Calls 2

StringClass · 0.85
startsWithMethod · 0.80

Tested by

no test coverage detected