Commit 8708174a authored by Michael Ott's avatar Michael Ott
Browse files

Switch to 112bit MQTT topics

parent 4e284396
......@@ -319,13 +319,13 @@ boost::log::trivial::severity_level Configuration::translateLogLevel(int logLeve
}
bool Configuration::checkMqtt(const std::string& mqtt) {
//MQTT topic must have 128 bit = 16 bytes = 32 hex chars
//MQTT topic must have 112 bit = 14 bytes = 28 hex chars
//but can have more with some extra '/', therefore remove all '/'
std::string str(mqtt);
str.erase(std::remove(str.begin(), str.end(), '/'), str.end());
if (str.length() != 32) {
LOG(error) << "MQTT-Topic \"" << mqtt << "\" does not consist of 32 hex chars!";
if (str.length() != 28) {
LOG(error) << "MQTT-Topic \"" << mqtt << "\" does not consist of 28 hex chars!";
return false;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment