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

Method getTopic

lib/MultiIconPlugin/src/MultiIconPlugin.cpp:90–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88}
89
90bool MultiIconPlugin::getTopic(const String& topic, JsonObject& value) const
91{
92 bool isSuccessful = false;
93
94 /* Single slot requested? */
95 if (true == topic.startsWith(String(TOPIC_SLOT) + "/"))
96 {
97 uint8_t slotId = _MultiIconPlugin::View::MAX_ICON_SLOTS;
98 bool status = getSlotIdFromTopic(slotId, topic);
99
100 if ((true == status) &&
101 (_MultiIconPlugin::View::MAX_ICON_SLOTS > slotId))
102 {
103 value["fileId"] = getIconFileId(slotId);
104
105 isSuccessful = true;
106 }
107 }
108 /* All slots requested? */
109 else if (true == topic.equals(TOPIC_SLOTS))
110 {
111 getConfiguration(value);
112 isSuccessful = true;
113 }
114 else
115 {
116 ;
117 }
118
119 return isSuccessful;
120}
121
122bool MultiIconPlugin::setTopic(const String& topic, const JsonObjectConst& value)
123{

Callers

nothing calls this directly

Calls 2

StringClass · 0.85
startsWithMethod · 0.80

Tested by

no test coverage detected