Commit e82b0bfa authored by luz's avatar luz

EnOcean: x-p44-addProfile must return a OK status, now reports number of...

EnOcean: x-p44-addProfile must return a OK status, now reports number of devices created from the profile
parent b5237149
......@@ -298,9 +298,16 @@ ErrorPtr EnoceanDeviceContainer::addProfile(VdcApiRequestPtr aRequest, ApiValueP
// now create device(s)
if (Error::isOK(respErr)) {
// create devices as if this was a learn-in
if (EnoceanDevice::createDevicesFromEEP(this, addr, eep, manufacturer_unknown)<1) {
int newDevices = EnoceanDevice::createDevicesFromEEP(this, addr, eep, manufacturer_unknown);
if (newDevices<1) {
respErr = ErrorPtr(new WebError(400, "Unknown EEP specification, no device(s) created"));
}
else {
ApiValuePtr r = aRequest->newApiValue();
r->setType(apivalue_object);
r->add("newDevices", r->newUint64(newDevices));
respErr = aRequest->sendResult(r);
}
}
}
}
......
Markdown is supported
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