TBBAS-2923, TBBAS-2924#6
Conversation
0b599ea to
a43e19b
Compare
a43e19b to
0d2c0ef
Compare
NikolaiShipilov
left a comment
There was a problem hiding this comment.
lgtm, just added few suggestions.
And also maybe a general note on statuses - currently the state while client is trying to reconnect to the broker isn't really informative for python GUI users - because only ComponentStatus is visible in main window (additional statuses are displayed in separate windows) - and it is always OK.
The best approach to address this would be to show all statuses (or just important ones) in main window. However, we should keep in mind if this won't be possible for some reason then the making the ComponentStatus be dependent on ConnectionStatus is a solution.
|
|
||
| void MqttRootFbImpl::initProperties(const PropertyObjectPtr& config) | ||
| { | ||
| for (const auto& prop : config.getAllProperties()) |
There was a problem hiding this comment.
To simplify implementation here I suggest to make the whole config object to be a single object-type property (nested property object) of FB
auto prop = ObjectPropertyBuilder("Config", config).setReadOnly(true).build();
objPtr.addProperty(prop);
| subscriber->setConnectionLostCb( | ||
| [this](std::string msg) | ||
| { | ||
| setConnectionStatus(ConnectionStatus::Reconnecting, msg); |
There was a problem hiding this comment.
Since paho itself does not provide anything as info message for disconnection callbacks it makes sense to add a short descriptive message default into our paho wrapper:
void MqttAsyncClient::onConnectionLost(void* context, char* cause)
{
std::string msg((cause) ? cause : "some descriptive message");
// Reconnect procedure here!
if (context != nullptr)
{
auto clienttInst = (MqttAsyncClient*)context;
clienttInst->pendingConnect = false;
auto lock = clienttInst->getCbLock();
if (clienttInst->onConnectionLostCb)
clienttInst->onConnectionLostCb(msg);
}
}
Uh oh!
There was an error while loading. Please reload this page.