本文整理汇总了C++中Topic::getArgAsLong方法的典型用法代码示例。如果您正苦于以下问题:C++ Topic::getArgAsLong方法的具体用法?C++ Topic::getArgAsLong怎么用?C++ Topic::getArgAsLong使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Topic
的用法示例。
在下文中一共展示了Topic::getArgAsLong方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: call
String Controller::call(Topic &topic) {
// MQTT state information via API-call
if (topic.modifyTopic(0) == "event/mqtt/connected") {
if (topic.argIs(0, "1")) {
on_mqtt_connected();
} else {
on_mqtt_disconnected();
}
}
// D("Controller: begin call");
// set
if (topic.itemIs(1, "set")) {
if (topic.itemIs(2, "ffs")) {
return ffs.set(topic);
} else if (topic.itemIs(2, "clock")) {
return clock.set(topic);
} else if (topic.itemIs(2, "esp")) {
return espTools.set(topic);
} else if (topic.itemIs(2, "wifi")) {
return wifi.set(topic);
} else if (topic.itemIs(2, "device")) {
if (topic.itemIs(3, "fillDashboard")) {
return device.fillDashboard();
} else {
return device.set(topic);
}
} else if (topic.itemIs(2, "controller")) {
if (topic.itemIs(3, "reconnectDelay")) {
D("set reconnectDelay");
Di("arg=", topic.getArgAsLong(0));
reconnectDelay = topic.getArgAsLong(0);
if (reconnectDelay < 1)
reconnectDelay = 1;
if (reconnectDelay > RECONNECT_DELAY_MAX)
reconnectDelay = RECONNECT_DELAY_MAX;
reconnectDelayed = 0;
return TOPIC_OK;
} else {
return TOPIC_NO;
}
} else {
return TOPIC_NO;
}
// get
} else if (topic.itemIs(1, "get")) {
if (topic.itemIs(2, "ffs")) {
return ffs.get(topic);
} else if (topic.itemIs(2, "clock")) {
return clock.get(topic);
} else if (topic.itemIs(2, "esp")) {
return espTools.get(topic);
} else if (topic.itemIs(2, "wifi")) {
return wifi.get(topic);
} else if (topic.itemIs(2, "device")) {
if(topic.itemIs(3, "flags")) {
return fwConfig();
} else if(topic.itemIs(3, "version")) {
return device.getVersion();
} else if (topic.itemIs(3, "type")) {
return device.getType();
} else if (topic.itemIs(3, "dashboard")) {
return device.getDashboard();
} else {
return device.get(topic);
}
} else {
return TOPIC_NO;
}
} else {
return TOPIC_NO;
}
// D("Controller: end call");
}