|
|
|
|
@ -346,7 +346,7 @@ ThingSetupInfo *ThingManagerImplementation::addConfiguredThing(const ThingDescri
|
|
|
|
|
ThingDescriptor descriptor = m_discoveredThings.value(thingDescriptorId);
|
|
|
|
|
if (!descriptor.isValid()) {
|
|
|
|
|
qCWarning(dcThingManager()) << "Cannot add thing. ThingDescriptor" << thingDescriptorId << "not found.";
|
|
|
|
|
ThingSetupInfo *info = new ThingSetupInfo(nullptr, this);
|
|
|
|
|
ThingSetupInfo *info = new ThingSetupInfo(this);
|
|
|
|
|
info->finish(Thing::ThingErrorThingDescriptorNotFound);
|
|
|
|
|
return info;
|
|
|
|
|
}
|
|
|
|
|
@ -354,13 +354,13 @@ ThingSetupInfo *ThingManagerImplementation::addConfiguredThing(const ThingDescri
|
|
|
|
|
ThingClass thingClass = findThingClass(descriptor.thingClassId());
|
|
|
|
|
if (!thingClass.isValid()) {
|
|
|
|
|
qCWarning(dcThingManager()) << "Cannot add thing. ThingClass" << descriptor.thingClassId() << "not found.";
|
|
|
|
|
ThingSetupInfo *info = new ThingSetupInfo(nullptr, this);
|
|
|
|
|
ThingSetupInfo *info = new ThingSetupInfo(this);
|
|
|
|
|
info->finish(Thing::ThingErrorThingClassNotFound);
|
|
|
|
|
return info;
|
|
|
|
|
}
|
|
|
|
|
if (!thingClass.createMethods().testFlag(ThingClass::CreateMethodDiscovery)) {
|
|
|
|
|
qCWarning(dcThingManager()) << "Cannot add thing. This thing of" << thingClass << "cannot be added via discovery.";
|
|
|
|
|
ThingSetupInfo *info = new ThingSetupInfo(nullptr, this);
|
|
|
|
|
ThingSetupInfo *info = new ThingSetupInfo(this);
|
|
|
|
|
info->finish(Thing::ThingErrorCreationMethodNotSupported);
|
|
|
|
|
return info;
|
|
|
|
|
}
|
|
|
|
|
@ -376,7 +376,7 @@ ThingSetupInfo* ThingManagerImplementation::reconfigureThing(const ThingId &thin
|
|
|
|
|
Thing *thing = findConfiguredThing(thingId);
|
|
|
|
|
if (!thing) {
|
|
|
|
|
qCWarning(dcThingManager()) << "Cannot reconfigure thing. Thing with id" << thingId.toString() << "not found.";
|
|
|
|
|
ThingSetupInfo *info = new ThingSetupInfo(nullptr, this);
|
|
|
|
|
ThingSetupInfo *info = new ThingSetupInfo(this);
|
|
|
|
|
info->finish(Thing::ThingErrorThingNotFound);
|
|
|
|
|
return info;
|
|
|
|
|
}
|
|
|
|
|
@ -384,14 +384,14 @@ ThingSetupInfo* ThingManagerImplementation::reconfigureThing(const ThingId &thin
|
|
|
|
|
ThingClass thingClass = findThingClass(thing->thingClassId());
|
|
|
|
|
if (thingClass.id().isNull()) {
|
|
|
|
|
qCWarning(dcThingManager()) << "Cannot reconfigure thing. ThingClass for thing" << thing->name() << thingId.toString() << "not found.";
|
|
|
|
|
ThingSetupInfo *info = new ThingSetupInfo(nullptr, this);
|
|
|
|
|
ThingSetupInfo *info = new ThingSetupInfo(this);
|
|
|
|
|
info->finish(Thing::ThingErrorThingClassNotFound);
|
|
|
|
|
return info;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
foreach (const ParamType ¶mType, thingClass.paramTypes()) {
|
|
|
|
|
if (paramType.readOnly() && params.hasParam(paramType.id())) {
|
|
|
|
|
ThingSetupInfo *info = new ThingSetupInfo(nullptr, this);
|
|
|
|
|
ThingSetupInfo *info = new ThingSetupInfo(this);
|
|
|
|
|
qCWarning(dcThingManager()) << "Cannot reconfigure thing" << thing << "because the parameter" << paramType.name() << paramType.id().toString() << "is not writable";
|
|
|
|
|
info->finish(Thing::ThingErrorParameterNotWritable);
|
|
|
|
|
return info;
|
|
|
|
|
@ -408,14 +408,14 @@ ThingSetupInfo *ThingManagerImplementation::reconfigureThing(const ThingDescript
|
|
|
|
|
ThingDescriptor descriptor = m_discoveredThings.value(thingDescriptorId);
|
|
|
|
|
if (!descriptor.isValid()) {
|
|
|
|
|
qCWarning(dcThingManager()) << "Cannot reconfigure thing. No thing descriptor with ID" << thingDescriptorId << "found.";
|
|
|
|
|
ThingSetupInfo *info = new ThingSetupInfo(nullptr, this);
|
|
|
|
|
ThingSetupInfo *info = new ThingSetupInfo(this);
|
|
|
|
|
info->finish(Thing::ThingErrorThingDescriptorNotFound);
|
|
|
|
|
return info;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Thing *thing = findConfiguredThing(descriptor.thingId());
|
|
|
|
|
if (!thing) {
|
|
|
|
|
ThingSetupInfo *info = new ThingSetupInfo(nullptr, this);
|
|
|
|
|
ThingSetupInfo *info = new ThingSetupInfo(this);
|
|
|
|
|
qCWarning(dcThingManager()) << "Cannot reconfigure thing. No thing with ID" << descriptor.thingId() << "found.";
|
|
|
|
|
info->finish(Thing::ThingErrorThingNotFound);
|
|
|
|
|
return info;
|
|
|
|
|
@ -424,7 +424,7 @@ ThingSetupInfo *ThingManagerImplementation::reconfigureThing(const ThingDescript
|
|
|
|
|
ThingClass thingClass = findThingClass(thing->thingClassId());
|
|
|
|
|
if (!thingClass.isValid()) {
|
|
|
|
|
qCWarning(dcThingManager()) << "Cannot reconfigure thing. No ThingClass with ID" << thing->thingClassId() << "found.";
|
|
|
|
|
ThingSetupInfo *info = new ThingSetupInfo(nullptr, this);
|
|
|
|
|
ThingSetupInfo *info = new ThingSetupInfo(this);
|
|
|
|
|
info->finish(Thing::ThingErrorThingClassNotFound);
|
|
|
|
|
return info;
|
|
|
|
|
}
|
|
|
|
|
@ -438,7 +438,7 @@ ThingSetupInfo *ThingManagerImplementation::reconfigureThingInternal(Thing *thin
|
|
|
|
|
IntegrationPlugin *plugin = m_integrationPlugins.value(thing->thingClass().pluginId());
|
|
|
|
|
if (!plugin) {
|
|
|
|
|
qCWarning(dcThingManager()) << "Cannot reconfigure thing. Plugin for ThingClass" << thing->thingClassId().toString() << "not found.";
|
|
|
|
|
ThingSetupInfo *info = new ThingSetupInfo(nullptr, this);
|
|
|
|
|
ThingSetupInfo *info = new ThingSetupInfo(this);
|
|
|
|
|
info->finish(Thing::ThingErrorPluginNotFound);
|
|
|
|
|
return info;
|
|
|
|
|
}
|
|
|
|
|
@ -446,7 +446,7 @@ ThingSetupInfo *ThingManagerImplementation::reconfigureThingInternal(Thing *thin
|
|
|
|
|
Thing::ThingError result = ThingUtils::verifyParams(thing->thingClass().paramTypes(), params);
|
|
|
|
|
if (result != Thing::ThingErrorNoError) {
|
|
|
|
|
qCWarning(dcThingManager()) << "Cannot reconfigure" << thing << "from" << plugin << "because the param verification failed with error" << result;
|
|
|
|
|
ThingSetupInfo *info = new ThingSetupInfo(nullptr, this);
|
|
|
|
|
ThingSetupInfo *info = new ThingSetupInfo(this);
|
|
|
|
|
info->finish(result);
|
|
|
|
|
return info;
|
|
|
|
|
}
|
|
|
|
|
@ -465,7 +465,7 @@ ThingSetupInfo *ThingManagerImplementation::reconfigureThingInternal(Thing *thin
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// try to setup the thing with the new params
|
|
|
|
|
ThingSetupInfo *info = new ThingSetupInfo(thing, this, 30000);
|
|
|
|
|
ThingSetupInfo *info = new ThingSetupInfo(thing, this, true, true, 30000);
|
|
|
|
|
plugin->setupThing(info);
|
|
|
|
|
connect(info, &ThingSetupInfo::destroyed, thing, [=](){
|
|
|
|
|
m_pendingSetups.remove(thing->id());
|
|
|
|
|
@ -594,7 +594,7 @@ ThingPairingInfo* ThingManagerImplementation::pairThing(const ThingClassId &thin
|
|
|
|
|
ThingClass thingClass = m_supportedThings.value(thingClassId);
|
|
|
|
|
if (!thingClass.isValid()) {
|
|
|
|
|
qCWarning(dcThingManager) << "Cannot find a ThingClass with ID" << thingClassId.toString();
|
|
|
|
|
ThingPairingInfo *info = new ThingPairingInfo(transactionId, thingClassId, ThingId(), name, ParamList(), ThingId(), this);
|
|
|
|
|
ThingPairingInfo *info = new ThingPairingInfo(transactionId, thingClassId, ThingId(), name, ParamList(), ThingId(), this, false);
|
|
|
|
|
info->finish(Thing::ThingErrorThingClassNotFound);
|
|
|
|
|
return info;
|
|
|
|
|
}
|
|
|
|
|
@ -605,7 +605,7 @@ ThingPairingInfo* ThingManagerImplementation::pairThing(const ThingClassId &thin
|
|
|
|
|
// Use given params, if there are missing some, use the defaults ones.
|
|
|
|
|
ParamList finalParams = buildParams(thingClass.paramTypes(), params);
|
|
|
|
|
|
|
|
|
|
ThingPairingInfo *info = new ThingPairingInfo(transactionId, thingClassId, newThingId, name, finalParams, ThingId(), this, 30000);
|
|
|
|
|
ThingPairingInfo *info = new ThingPairingInfo(transactionId, thingClassId, newThingId, name, finalParams, ThingId(), this, false, 30000);
|
|
|
|
|
pairThingInternal(info);
|
|
|
|
|
return info;
|
|
|
|
|
}
|
|
|
|
|
@ -616,7 +616,7 @@ ThingPairingInfo* ThingManagerImplementation::pairThing(const ThingDescriptorId
|
|
|
|
|
ThingDescriptor descriptor = m_discoveredThings.value(thingDescriptorId);
|
|
|
|
|
if (!descriptor.isValid()) {
|
|
|
|
|
qCWarning(dcThingManager) << "Cannot find a ThingDescriptor with ID" << thingDescriptorId.toString();
|
|
|
|
|
ThingPairingInfo *info = new ThingPairingInfo(pairingTransactionId, ThingClassId(), ThingId(), name, ParamList(), ThingId(), this);
|
|
|
|
|
ThingPairingInfo *info = new ThingPairingInfo(pairingTransactionId, ThingClassId(), ThingId(), name, ParamList(), ThingId(), this, false);
|
|
|
|
|
info->finish(Thing::ThingErrorThingDescriptorNotFound);
|
|
|
|
|
return info;
|
|
|
|
|
}
|
|
|
|
|
@ -624,7 +624,7 @@ ThingPairingInfo* ThingManagerImplementation::pairThing(const ThingDescriptorId
|
|
|
|
|
ThingClass thingClass = m_supportedThings.value(descriptor.thingClassId());
|
|
|
|
|
if (!thingClass.isValid()) {
|
|
|
|
|
qCWarning(dcThingManager) << "Cannot find a ThingClass with ID" << descriptor.thingClassId().toString();
|
|
|
|
|
ThingPairingInfo *info = new ThingPairingInfo(pairingTransactionId, descriptor.thingClassId(), ThingId(), name, ParamList(), ThingId(), this);
|
|
|
|
|
ThingPairingInfo *info = new ThingPairingInfo(pairingTransactionId, descriptor.thingClassId(), ThingId(), name, ParamList(), ThingId(), this, false);
|
|
|
|
|
info->finish(Thing::ThingErrorThingClassNotFound);
|
|
|
|
|
return info;
|
|
|
|
|
}
|
|
|
|
|
@ -638,7 +638,7 @@ ThingPairingInfo* ThingManagerImplementation::pairThing(const ThingDescriptorId
|
|
|
|
|
// Use given params, if there are missing some, use the discovered ones.
|
|
|
|
|
ParamList finalParams = buildParams(thingClass.paramTypes(), params, descriptor.params());
|
|
|
|
|
|
|
|
|
|
ThingPairingInfo *info = new ThingPairingInfo(pairingTransactionId, descriptor.thingClassId(), thingId, name, finalParams, descriptor.parentId(), this, 30000);
|
|
|
|
|
ThingPairingInfo *info = new ThingPairingInfo(pairingTransactionId, descriptor.thingClassId(), thingId, name, finalParams, descriptor.parentId(), this, false, 30000);
|
|
|
|
|
pairThingInternal(info);
|
|
|
|
|
return info;
|
|
|
|
|
}
|
|
|
|
|
@ -650,7 +650,7 @@ ThingPairingInfo *ThingManagerImplementation::pairThing(const ThingId &thingId,
|
|
|
|
|
Thing *thing = findConfiguredThing(thingId);
|
|
|
|
|
if (!thing) {
|
|
|
|
|
qCWarning(dcThingManager) << "Cannot find a thing with ID" << thingId.toString();
|
|
|
|
|
ThingPairingInfo *info = new ThingPairingInfo(pairingTransactionId, ThingClassId(), thingId, name, ParamList(), ThingId(), this);
|
|
|
|
|
ThingPairingInfo *info = new ThingPairingInfo(pairingTransactionId, ThingClassId(), thingId, name, ParamList(), ThingId(), this, true);
|
|
|
|
|
info->finish(Thing::ThingErrorThingDescriptorNotFound);
|
|
|
|
|
return info;
|
|
|
|
|
}
|
|
|
|
|
@ -658,7 +658,7 @@ ThingPairingInfo *ThingManagerImplementation::pairThing(const ThingId &thingId,
|
|
|
|
|
// Use new params, if there are missing some, use the existing ones.
|
|
|
|
|
ParamList finalParams = buildParams(thing->thingClass().paramTypes(), params, thing->params());
|
|
|
|
|
|
|
|
|
|
ThingPairingInfo *info = new ThingPairingInfo(pairingTransactionId, thing->thingClassId(), thingId, name, finalParams, ThingId(), this, 30000);
|
|
|
|
|
ThingPairingInfo *info = new ThingPairingInfo(pairingTransactionId, thing->thingClassId(), thingId, name, finalParams, ThingId(), this, true, 30000);
|
|
|
|
|
pairThingInternal(info);
|
|
|
|
|
return info;
|
|
|
|
|
}
|
|
|
|
|
@ -667,7 +667,7 @@ ThingPairingInfo *ThingManagerImplementation::confirmPairing(const PairingTransa
|
|
|
|
|
{
|
|
|
|
|
if (!m_pendingPairings.contains(pairingTransactionId)) {
|
|
|
|
|
qCWarning(dcThingManager()) << "No pairing transaction with id" << pairingTransactionId.toString();
|
|
|
|
|
ThingPairingInfo *info = new ThingPairingInfo(pairingTransactionId, ThingClassId(), ThingId(), QString(), ParamList(), ThingId(), this);
|
|
|
|
|
ThingPairingInfo *info = new ThingPairingInfo(pairingTransactionId, ThingClassId(), ThingId(), QString(), ParamList(), ThingId(), this, false);
|
|
|
|
|
info->finish(Thing::ThingErrorPairingTransactionIdNotFound);
|
|
|
|
|
return info;
|
|
|
|
|
}
|
|
|
|
|
@ -679,7 +679,7 @@ ThingPairingInfo *ThingManagerImplementation::confirmPairing(const PairingTransa
|
|
|
|
|
IntegrationPlugin *plugin = m_integrationPlugins.value(thingClass.pluginId());
|
|
|
|
|
if (!plugin) {
|
|
|
|
|
qCWarning(dcThingManager) << "Can't find a plugin for this" << thingClass;
|
|
|
|
|
ThingPairingInfo *info = new ThingPairingInfo(pairingTransactionId, thingClassId, context.thingId, context.thingName, context.params, context.parentId, this);
|
|
|
|
|
ThingPairingInfo *info = new ThingPairingInfo(pairingTransactionId, thingClassId, context.thingId, context.thingName, context.params, context.parentId, this, false);
|
|
|
|
|
info->finish(Thing::ThingErrorPluginNotFound);
|
|
|
|
|
return info;
|
|
|
|
|
}
|
|
|
|
|
@ -691,8 +691,8 @@ ThingPairingInfo *ThingManagerImplementation::confirmPairing(const PairingTransa
|
|
|
|
|
// We're using two different info objects here, one to hand over to the plugin for the pairing, the other we give out
|
|
|
|
|
// to the user. After the internal one has finished, we'll start a setupThing job and finish the external pairingInfo only after
|
|
|
|
|
// both, the internal pairing and the setup have completed.
|
|
|
|
|
ThingPairingInfo *internalInfo = new ThingPairingInfo(pairingTransactionId, thingClassId, thingId, context.thingName, context.params, context.parentId, this);
|
|
|
|
|
ThingPairingInfo *externalInfo = new ThingPairingInfo(pairingTransactionId, thingClassId, thingId, context.thingName, context.params, context.parentId, this);
|
|
|
|
|
ThingPairingInfo *internalInfo = new ThingPairingInfo(pairingTransactionId, thingClassId, thingId, context.thingName, context.params, context.parentId, this, false);
|
|
|
|
|
ThingPairingInfo *externalInfo = new ThingPairingInfo(pairingTransactionId, thingClassId, thingId, context.thingName, context.params, context.parentId, this, false);
|
|
|
|
|
plugin->confirmPairing(internalInfo, username, secret);
|
|
|
|
|
|
|
|
|
|
connect(internalInfo, &ThingPairingInfo::finished, this, [this, internalInfo, externalInfo, plugin, addNewThing](){
|
|
|
|
|
@ -733,7 +733,7 @@ ThingPairingInfo *ThingManagerImplementation::confirmPairing(const PairingTransa
|
|
|
|
|
|
|
|
|
|
initThing(thing);
|
|
|
|
|
|
|
|
|
|
ThingSetupInfo *info = setupThing(thing);
|
|
|
|
|
ThingSetupInfo *info = setupThing(thing, true);
|
|
|
|
|
connect(info, &ThingSetupInfo::finished, thing, [this, info, externalInfo, addNewThing](){
|
|
|
|
|
|
|
|
|
|
externalInfo->finish(info->status(), info->displayMessage());
|
|
|
|
|
@ -780,14 +780,14 @@ ThingSetupInfo* ThingManagerImplementation::addConfiguredThingInternal(const Thi
|
|
|
|
|
ThingClass thingClass = findThingClass(thingClassId);
|
|
|
|
|
if (thingClass.id().isNull()) {
|
|
|
|
|
qCWarning(dcThingManager()) << "Cannot add thing. The ThingClass ID" << thingClassId.toString() << "could not be found.";
|
|
|
|
|
ThingSetupInfo *info = new ThingSetupInfo(nullptr, this);
|
|
|
|
|
ThingSetupInfo *info = new ThingSetupInfo(this);
|
|
|
|
|
info->finish(Thing::ThingErrorThingClassNotFound);
|
|
|
|
|
return info;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (thingClass.setupMethod() != ThingClass::SetupMethodJustAdd) {
|
|
|
|
|
qCWarning(dcThingManager()) << "Cannot add thing of" << thingClass << "this way. (SetupMethodJustAdd)";
|
|
|
|
|
ThingSetupInfo *info = new ThingSetupInfo(nullptr, this);
|
|
|
|
|
ThingSetupInfo *info = new ThingSetupInfo(this);
|
|
|
|
|
info->finish(Thing::ThingErrorCreationMethodNotSupported);
|
|
|
|
|
return info;
|
|
|
|
|
}
|
|
|
|
|
@ -801,7 +801,7 @@ ThingSetupInfo* ThingManagerImplementation::addConfiguredThingInternal(const Thi
|
|
|
|
|
IntegrationPlugin *plugin = m_integrationPlugins.value(thingClass.pluginId());
|
|
|
|
|
if (!plugin) {
|
|
|
|
|
qCWarning(dcThingManager()) << "Cannot add thing. Plugin for thing class" << thingClass << "not found.";
|
|
|
|
|
ThingSetupInfo *info = new ThingSetupInfo(nullptr, this);
|
|
|
|
|
ThingSetupInfo *info = new ThingSetupInfo(this);
|
|
|
|
|
info->finish(Thing::ThingErrorPluginNotFound);
|
|
|
|
|
return info;
|
|
|
|
|
}
|
|
|
|
|
@ -810,7 +810,7 @@ ThingSetupInfo* ThingManagerImplementation::addConfiguredThingInternal(const Thi
|
|
|
|
|
Thing::ThingError paramsResult = ThingUtils::verifyParams(thingClass.paramTypes(), params);
|
|
|
|
|
if (paramsResult != Thing::ThingErrorNoError) {
|
|
|
|
|
qCWarning(dcThingManager()) << "Cannot add thing of" << thingClass << "from" << plugin << "because the param verification failed with error" << paramsResult;
|
|
|
|
|
ThingSetupInfo *info = new ThingSetupInfo(nullptr, this);
|
|
|
|
|
ThingSetupInfo *info = new ThingSetupInfo(this);
|
|
|
|
|
info->finish(paramsResult);
|
|
|
|
|
return info;
|
|
|
|
|
}
|
|
|
|
|
@ -832,7 +832,7 @@ ThingSetupInfo* ThingManagerImplementation::addConfiguredThingInternal(const Thi
|
|
|
|
|
|
|
|
|
|
initThing(thing);
|
|
|
|
|
|
|
|
|
|
ThingSetupInfo *info = setupThing(thing);
|
|
|
|
|
ThingSetupInfo *info = setupThing(thing, true);
|
|
|
|
|
connect(info, &ThingSetupInfo::finished, this, [this, info](){
|
|
|
|
|
if (info->status() != Thing::ThingErrorNoError) {
|
|
|
|
|
qCWarning(dcThingManager) << "Thing setup failed for" << info->thing() << "Not adding thing to system.";
|
|
|
|
|
@ -1770,7 +1770,7 @@ void ThingManagerImplementation::onAutoThingsAppeared(const ThingDescriptors &th
|
|
|
|
|
|
|
|
|
|
qCDebug(dcThingManager()) << "Setting up auto thing:" << thing;
|
|
|
|
|
|
|
|
|
|
ThingSetupInfo *info = setupThing(thing);
|
|
|
|
|
ThingSetupInfo *info = setupThing(thing, true);
|
|
|
|
|
connect(info, &ThingSetupInfo::finished, thing, [this, info](){
|
|
|
|
|
|
|
|
|
|
if (info->status() != Thing::ThingErrorNoError) {
|
|
|
|
|
@ -2078,12 +2078,12 @@ void ThingManagerImplementation::pairThingInternal(ThingPairingInfo *info)
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ThingSetupInfo* ThingManagerImplementation::setupThing(Thing *thing)
|
|
|
|
|
ThingSetupInfo* ThingManagerImplementation::setupThing(Thing *thing, bool initialSetup)
|
|
|
|
|
{
|
|
|
|
|
ThingClass thingClass = findThingClass(thing->thingClassId());
|
|
|
|
|
IntegrationPlugin *plugin = m_integrationPlugins.value(thingClass.pluginId());
|
|
|
|
|
|
|
|
|
|
ThingSetupInfo *info = new ThingSetupInfo(thing, this, 30000);
|
|
|
|
|
ThingSetupInfo *info = new ThingSetupInfo(thing, this, initialSetup, false, 30000);
|
|
|
|
|
|
|
|
|
|
if (!plugin) {
|
|
|
|
|
qCWarning(dcThingManager) << "Can't find a plugin for this thing" << thing;
|
|
|
|
|
@ -2240,7 +2240,7 @@ QVariant ThingManagerImplementation::mapValue(const QVariant &value, const State
|
|
|
|
|
void ThingManagerImplementation::trySetupThing(Thing *thing)
|
|
|
|
|
{
|
|
|
|
|
thing->setSetupStatus(Thing::ThingSetupStatusInProgress, Thing::ThingErrorNoError);
|
|
|
|
|
ThingSetupInfo *info = setupThing(thing);
|
|
|
|
|
ThingSetupInfo *info = setupThing(thing, false);
|
|
|
|
|
// Set receiving object to "thing" because at startup we load it in any case, knowing that it worked at
|
|
|
|
|
// some point. However, it'll be marked as non-working until the setup succeeds so the user might delete
|
|
|
|
|
// it in the meantime... In that case we don't want to call postsetup on it.
|
|
|
|
|
|